feat(sui)!: also register the new its transaction upon upgrade#993
Open
Foivos wants to merge 18 commits into
Open
feat(sui)!: also register the new its transaction upon upgrade#993Foivos wants to merge 18 commits into
Foivos wants to merge 18 commits into
Conversation
Comment on lines
+496
to
+499
| await builder.moveCall({ | ||
| target: `${contractConfig.address}::discovery::register_transaction`, | ||
| arguments: [InterchainTokenService, RelayerDiscovery], | ||
| }); |
Contributor
There was a problem hiding this comment.
logic: Should verify RelayerDiscovery exists before using it to prevent runtime errors
…nsaction-post-upgrade
drewstaylor
reviewed
Sep 16, 2025
Contributor
|
@Foivos I tried updating the npm snapshot, not sure why it causes everything to fail even after updating lock file. I'll stay out of your way now 😏 |
…nsaction-post-upgrade
…nsaction-post-upgrade
…ITS, which is not present in the test environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
Updated On: 2025-09-05 09:23:24 UTC
This PR adds a crucial registration step to the InterchainTokenService (ITS) upgrade process on Sui. When the ITS contract is upgraded, it now re-registers itself with the RelayerDiscovery service to maintain proper integration with the Axelar network.
The change mirrors the existing pattern in the
postDeployItsfunction, which registers the ITS with RelayerDiscovery during initial deployment (lines 358-363). Without this change, upgraded ITS contracts would lose their registration with the discovery service, potentially breaking relayer functionality.The implementation adds a
discovery::register_transactionmove call to the InterchainTokenService migration case in the upgrade function. This ensures that after migration completes, the upgraded ITS contract is properly registered and discoverable by relayers, maintaining the same state that existed before the upgrade.This change is part of the broader contract upgrade infrastructure in the Sui deployment system, specifically targeting the migration logic that handles contract state transitions during upgrades.
Important Files Changed
Changed Files
Confidence score: 4/5
Sequence Diagram
sequenceDiagram participant User participant CLI as "deploy-contract CLI" participant Config as "Config Manager" participant Wallet as "Wallet Manager" participant Client as "Sui Client" participant TxBuilder as "Transaction Builder" participant Blockchain as "Sui Blockchain" User->>CLI: "node deploy-contract migrate InterchainTokenService" CLI->>Config: "loadConfig(options.env)" Config-->>CLI: "configuration loaded" CLI->>Config: "getChainConfig(config.chains, options.chainName)" Config-->>CLI: "chain configuration" CLI->>Wallet: "getWallet(sui, options)" Wallet-->>CLI: "[keypair, client]" CLI->>Wallet: "printWalletInfo(keypair, client, sui, options)" CLI->>CLI: "validateParameters(chain.contracts[packageName])" CLI->>TxBuilder: "new TxBuilder(client)" TxBuilder-->>CLI: "builder instance" alt packageName is "InterchainTokenService" CLI->>TxBuilder: "moveCall(interchain_token_service::migrate)" CLI->>TxBuilder: "moveCall(discovery::register_transaction)" CLI->>TxBuilder: "broadcastFromTxBuilder(builder, keypair, message, options)" TxBuilder->>Client: "build and sign transaction" Client->>Blockchain: "broadcast transaction" Blockchain-->>Client: "transaction result" Client-->>TxBuilder: "result" TxBuilder-->>CLI: "migration complete" else packageName is "AxelarGateway" CLI->>CLI: "GatewayCli.migrate(keypair, client, config, chain, contractConfig, null, options)" CLI->>Client: "broadcast(client, keypair, result.tx, result.message, options)" Client->>Blockchain: "broadcast transaction" Blockchain-->>Client: "transaction result" Client-->>CLI: "migration complete" else unsupported package CLI-->>User: "Error: Post-upgrade migration not supported" end CLI->>Config: "saveConfig(config, options.env)" CLI-->>User: "Migration completed successfully"Note
Registers InterchainTokenService with RelayerDiscovery during migration and broadens ITS default pause/unpause function coverage; minor CI workflow cleanup.
InterchainTokenServicewithdiscovery::register_transactionafterinterchain_token_service::migrateinsui/deploy-contract.js.InterchainTokenServicedefault functions and alignversionsinsui/contract.jsto support granular pausing/unpausing across many functions..github/workflows/test-sui.yaml.Written by Cursor Bugbot for commit 683f429. This will update automatically on new commits. Configure here.