Skip to content
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

feat: add script to upgrade sui gateway #306

Merged
merged 42 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
019e354
refactor: update cgp-sui dependency
blockchainguyy Jul 18, 2024
21834b6
refactor: update script acccording to latest sui changes
blockchainguyy Jul 18, 2024
5bf01b6
feat: add script to upgrade gateway
blockchainguyy Jul 18, 2024
90e2c0f
Merge branch 'main' into feat/upgrade-sui-gateway
blockchainguyy Jul 18, 2024
4ca5ee0
docs: add command to upgrade gateway
blockchainguyy Jul 18, 2024
01eba29
refactor: clean logging
blockchainguyy Jul 18, 2024
62a0de9
improved readability
blockchainguyy Jul 18, 2024
ccc84b0
Merge branch 'main' into feat/upgrade-sui-gateway
blockchainguyy Jul 19, 2024
cfa3985
refactor: update cgp sui package
blockchainguyy Jul 19, 2024
d0d847b
refactor: export deploy utils
blockchainguyy Jul 19, 2024
0443b68
refactor: move gateway upgrade script
blockchainguyy Jul 19, 2024
4a6b97b
docs: update gateway upgrade command
blockchainguyy Jul 19, 2024
eb81dc3
refactor: add check for previos signers
blockchainguyy Jul 19, 2024
a5f72af
refactor: update variable name
blockchainguyy Jul 19, 2024
6e0710e
chore: update sui sdk and cgp sui dependency
blockchainguyy Jul 25, 2024
89b9905
refactor: resolve PR comments and update accroding to new cgp version
blockchainguyy Jul 25, 2024
73482f6
Merge branch 'main' into feat/upgrade-sui-gateway
blockchainguyy Jul 25, 2024
48a1358
fix: default previous signers param
blockchainguyy Jul 25, 2024
75ac00a
docs: update docs with new gateway deployment script
blockchainguyy Jul 25, 2024
0bc2346
fix: updated gmp dependency
blockchainguyy Jul 25, 2024
093cd1c
refactor: add option for policy in gateay-deployment
blockchainguyy Jul 25, 2024
34e38f8
refactor: remove extra contract object creation
blockchainguyy Jul 25, 2024
04e323c
fix: multisig combined tx execution
blockchainguyy Jul 25, 2024
bdce17b
refactor: remove check for policy type
blockchainguyy Jul 25, 2024
110ebf5
added optimizations
blockchainguyy Jul 26, 2024
a631ac8
refactor: increase readability and add logs
blockchainguyy Jul 26, 2024
edab277
Merge branch 'main' into feat/upgrade-sui-gateway
blockchainguyy Jul 26, 2024
ba2699a
docs: update package names in deploy commands
blockchainguyy Jul 26, 2024
94cb012
chore: remove extra spacing
npty Jul 29, 2024
6104684
chore: move upgrading gateway section
npty Jul 29, 2024
add6d16
chore: add more description to policy
npty Jul 29, 2024
7d7f4ae
chore: define suiPackageAddress
npty Jul 29, 2024
1cf6f5f
chore: update policy values
npty Jul 29, 2024
278bce1
chore: rename cmd
npty Jul 29, 2024
6f52fc2
chore: remove default for domain separator
npty Jul 29, 2024
e0dece9
chore: convert minimumRotation delay into seconds unit
npty Jul 29, 2024
d087705
chore: fix description for upgrade cmd
npty Jul 29, 2024
6b30578
chore: assign hardcoded value
npty Jul 29, 2024
79f3990
chore: refactor
npty Jul 29, 2024
ec033eb
chore: remove colon in printInfo
npty Jul 29, 2024
d7a3397
chore: fix printWallet duplication
npty Jul 29, 2024
2ec7f0b
Merge branch 'main' into feat/upgrade-sui-gateway
npty Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 68 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"homepage": "https://github.com/axelarnetwork/axelar-contract-deployments#readme",
"dependencies": {
"@axelar-network/axelar-cgp-solidity": "6.3.1",
"@axelar-network/axelar-cgp-sui": "^0.3.0",
"@axelar-network/axelar-cgp-sui": "0.3.0",
"@axelar-network/axelar-gmp-sdk-solidity": "5.10.0",
"@axelar-network/interchain-token-service": "1.2.4",
"@cosmjs/cosmwasm-stargate": "^0.32.1",
Expand Down
18 changes: 14 additions & 4 deletions sui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ Deploy the gateway package:
- By querying the signer set from the Amplifier contract (this only works if Amplifier contracts have been setup):

```bash
node sui/deploy-gateway.js
node sui/deploy-contract.js deploy axelar_gateway
```

Use `--help` flag to see other setup params that can be overridden.

- For testing convenience, you can use the secp256k1 wallet as the signer set for the gateway.

```bash
node sui/deploy-gateway.js --signers wallet --nonce test
node sui/deploy-contract.js deploy axelar_gateway --signers wallet --nonce test
```

- You can also provide a JSON object with a full signer set:

```bash
node sui/deploy-gateway.js -e testnet --signers '{"signers": [{"pub_key": "0x020194ead85b350d90472117e6122cf1764d93bf17d6de4b51b03d19afc4d6302b", "weight": 1}], "threshold": 1, "nonce": "0x0000000000000000000000000000000000000000000000000000000000000000"}'
node sui/deploy-contract.js deploy axelar_gateway -e testnet --signers '{"signers": [{"pub_key": "0x020194ead85b350d90472117e6122cf1764d93bf17d6de4b51b03d19afc4d6302b", "weight": 1}], "threshold": 1, "nonce": "0x0000000000000000000000000000000000000000000000000000000000000000"}'
```

Deploy the Gas Service package:

```bash
node sui/deploy-contract.js GasService
node sui/deploy-contract.js deploy gas_service
```

Deploy the test GMP package:
Expand Down Expand Up @@ -121,6 +121,16 @@ node sui/gateway.js rotate --signers wallet --proof wallet --currentNonce test -

Use the same nonce for `--currentNonce` as the `--nonce` when deploying the gateway.

Upgrading Gateway:
npty marked this conversation as resolved.
Show resolved Hide resolved

To update the gateway run the following command:

```bash
node sui/deploy-contract.js upgrade axelar_gateway <policy>
npty marked this conversation as resolved.
Show resolved Hide resolved
```
policy should be one of 0, 128, or 192.
npty marked this conversation as resolved.
Show resolved Hide resolved
Provide `--txFilePath` with `--offline` to generate tx data file for offline signing.

### Multisig

To create a Multisig, follow the documentation [here](https://docs.sui.io/guides/developer/cryptography/multisig).
Expand Down
Loading
Loading