-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solana/sdk set evm cost initialize #116
Conversation
XLabs/arbitrary-token-transfers #116 Change Summary:
Risk Score: 5/10
Potential Vulnerabilities: async initialize(
signer: PublicKey,
{
owner,
feeRecipient,
admins,
}: {
owner: PublicKey;
feeRecipient: PublicKey;
admins: PublicKey[];
},
evmTransactionGas: bigint,
evmTransactionSize: bigint,
): Promise<TransactionInstruction[]> {
Code Smell: if (!signer.equals(owner) && !admins.some((key) => signer.equals(key)))
throwError(`The signer must be set as either the owner or an admin`);
Unintended Consequences: {
"evmRelayGas": "400000",
"evmRelayTxSize": "1211"
}
Debug Log: /**
* @todo Add priority fee instruction when configured to do so.
*/
export async function ledgerSignAndSend(connection: Connection, instructions: TransactionInstruction[], signers: Keypair[]) {
|
evmTransactionGas: bigint, | ||
evmTransactionSize: bigint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both could be just numbers too. 🤔
The real datatype we'd want is a uint... and preferably one with units...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're both uint64
for some reason. I think that this is excessive for the tx size but I don't recall if this makes sense for the gas limit. I think we chose uint32
in SR, right?
}): Promise<VersionedTransactionResponse | null> { | ||
return $.getTransaction($.sendAndConfirm(await this.client.initialize(args), this.signer)); | ||
async initialize( | ||
...args: Tail<Parameters<SolanaTokenBridgeRelayer["initialize"]>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice
Co-authored-by: Andreas <[email protected]>
Adds EVM cost update instruction into the
initialize
Solana sdk function.After writing this, I think embedding this into the
initialize
instruction would be simpler 😅