-
Notifications
You must be signed in to change notification settings - Fork 369
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
Sealevel warp route UI: support IGP payments when transferring tokens #2546
Comments
As promised, the details: high levelThe existing warp routes we've been running with (e.g. the one on mainnet Solana) have the ability to be configured with an IGP or to be configured to not use an IGP. At the moment, they're configured to not use an IGP. So some logic is required when crafting the accounts to pass in that depends on if an IGP is configured / what IGP is configured. The IGP-related accounts are not plugin-specific, and come after the existing non-plugin-specific accounts. You can determine whether an IGP has been configured and which IGP has been configured by looking at the hyperlane-monorepo/rust/sealevel/libraries/hyperlane-sealevel-token/src/accounts.rs Line 43 in 17a6e79
If this is set to None, then no IGP is configured. If it's set to Some, the contained tuple (Pubkey, InterchainGasPaymasterType) includes the IGP program ID as the Pubkey at index 0, and then an enum at index 1 that indicates whether an overhead IGP is being used, or just a normal IGP, and the Pubkey for a data account relating to that type of IGP.
That enum can be found here: hyperlane-monorepo/rust/sealevel/programs/hyperlane-sealevel-igp/src/accounts.rs Lines 24 to 29 in 17a6e79
IGP typesTo take a step back - in the EVM world, we also have "overhead IGPs" and "normal IGPs", but an overhead IGP has the exact same interface as a normal IGP. An overhead IGP is just intended to add an amount of gas to the amount of gas passed in, and then call an inner IGP with that new amount of gas. In the EVM world an overhead IGP is its own smart contract. However in Solana, making a cross-program invocation (CPI) is a more costly operation and there's a limit to the size of the CPI call stack, so instead there's a single IGP program that can work with many IGP data accounts or overhead IGP data accounts. This is why two pieces of info are stored in the warp route program -- first, the IGP program ID, and second, what account data to use with the IGP program ID. If the In the OverheadIgp case, you can find what the inner IGP data account is by fetching the account data and decoding it to get the hyperlane-monorepo/rust/sealevel/programs/hyperlane-sealevel-igp/src/accounts.rs Lines 91 to 102 in 17a6e79
accountsYou can find a comment with the accounts here, where accounts 0 through 8 are unchanged, but 9 through 13 are new and are in the case where an IGP is used: hyperlane-monorepo/rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs Lines 257 to 274 in 17a6e79
Breakdown of the accounts:
Example warp route & txI deployed a new warp route on devnet with an Info on the warp route deployment: solanadevnetprogram ID:
proteus testnetcontract: example txHere's an example tx I sent that pays for gas. You can see in the logs |
### Description - Build on #2684, migrates the EvmAdapter and missing utils from the warp UI - Remove the token App as it's unused and redundant with adapters - Add IGP serialization code for #2546 - Simplify multi-protocol adapters in SDK - Make token adapters extend base adapters - Move token serialization code to token package ### Drive-by changes - Update Sepolia RPC which was causing errors ### Related issues #2652 ### Backward compatibility Yes ### Testing Tested these in warp UI --------- Co-authored-by: Yorke Rhodes <yorke@hyperlane.xyz>
previously blocked by #2500
Update the accounts required when transferring tokens to remote chains following gas payments being added. Deets to come
The text was updated successfully, but these errors were encountered: