Skip to content

Commit 45e8951

Browse files
authored
chore(target_chains/sui): update sui and wormhole dependency (#1341)
* chore(target_chains/sui): update sui and wormhole dependency Developers on Sui need to pin the same Sui version as their dependencies and it enforces everyone to use the same Sui version. Pyth and Wormhole Sui versions have been old and this change updates them to the latest testnet version (1.19.1) to make integrations with us easier. Wormhole has undergone a similar change and thereforce its version has changed as well. No contract deployment is needed for this change as it only unblocks downstream consumers for compiling their contracts. * fix: update sui version in the ci workflow
1 parent 1d28c04 commit 45e8951

16 files changed

+45
-49
lines changed

.github/workflows/ci-sui-contract.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: rustup update stable
2525

2626
- name: Install Sui CLI
27-
run: cargo install --locked --git https://github.com/MystenLabs/sui.git --rev 09b2081498366df936abae26eea4b2d5cafb2788 sui
27+
run: cargo install --locked --git https://github.com/MystenLabs/sui.git --rev 041c5f2bae2fe52079e44b70514333532d69f4e6 sui
2828

2929
- name: Run tests
3030
run: sui move test

target_chains/sui/contracts/Move.lock

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[move]
44
version = 0
5+
manifest_digest = "320300697C11C4D84BF6ED32C1DB48A4EE830B6B44F4DFDA4E89345875C5EA11"
6+
deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600"
57

68
dependencies = [
79
{ name = "Sui" },
@@ -10,20 +12,25 @@ dependencies = [
1012

1113
[[move.package]]
1214
name = "MoveStdlib"
13-
source = { git = "https://github.com/MystenLabs/sui.git", rev = "09b2081498366df936abae26eea4b2d5cafb2788", subdir = "crates/sui-framework/packages/move-stdlib" }
15+
source = { git = "https://github.com/MystenLabs/sui.git", rev = "041c5f2bae2fe52079e44b70514333532d69f4e6", subdir = "crates/sui-framework/packages/move-stdlib" }
1416

1517
[[move.package]]
1618
name = "Sui"
17-
source = { git = "https://github.com/MystenLabs/sui.git", rev = "09b2081498366df936abae26eea4b2d5cafb2788", subdir = "crates/sui-framework/packages/sui-framework" }
19+
source = { git = "https://github.com/MystenLabs/sui.git", rev = "041c5f2bae2fe52079e44b70514333532d69f4e6", subdir = "crates/sui-framework/packages/sui-framework" }
1820

1921
dependencies = [
2022
{ name = "MoveStdlib" },
2123
]
2224

2325
[[move.package]]
2426
name = "Wormhole"
25-
source = { git = "https://github.com/wormhole-foundation/wormhole.git", rev = "d050ad1d67a5b7da9fb65030aad12ef5d774ccad", subdir = "sui/wormhole" }
27+
source = { git = "https://github.com/wormhole-foundation/wormhole.git", rev = "82d82bffd5a8566e4b5d94be4e4678ad55ab1f4f", subdir = "sui/wormhole" }
2628

2729
dependencies = [
2830
{ name = "Sui" },
2931
]
32+
33+
[move.toolchain-version]
34+
compiler-version = "1.19.1"
35+
edition = "legacy"
36+
flavor = "sui"

target_chains/sui/contracts/Move.mainnet.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ published-at = "0x04e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad
66
[dependencies.Sui]
77
git = "https://github.com/MystenLabs/sui.git"
88
subdir = "crates/sui-framework/packages/sui-framework"
9-
rev = "09b2081498366df936abae26eea4b2d5cafb2788"
9+
rev = "041c5f2bae2fe52079e44b70514333532d69f4e6"
1010

1111
[dependencies.Wormhole]
12-
local = "../../../../wormhole/sui/wormhole"
12+
git = "https://github.com/wormhole-foundation/wormhole.git"
13+
subdir = "sui/wormhole"
14+
rev = "sui-upgrade-mainnet"
1315

1416
[addresses]
1517
pyth = "0x0"

target_chains/sui/contracts/Move.testnet.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ published-at = "0xf7114cc10266d90c0c9e4b84455bddf29b40bd78fe56832c7ac98682c3daa9
66
[dependencies.Sui]
77
git = "https://github.com/MystenLabs/sui.git"
88
subdir = "crates/sui-framework/packages/sui-framework"
9-
rev = "09b2081498366df936abae26eea4b2d5cafb2788"
9+
rev = "041c5f2bae2fe52079e44b70514333532d69f4e6"
1010

1111
[dependencies.Wormhole]
12-
local = "../../../../wormhole/sui/wormhole"
12+
git = "https://github.com/wormhole-foundation/wormhole.git"
13+
subdir = "sui/wormhole"
14+
rev = "sui-upgrade-testnet"
1315

1416
[addresses]
1517
pyth = "0x0"

target_chains/sui/contracts/Move.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ version = "0.0.2"
55
[dependencies.Sui]
66
git = "https://github.com/MystenLabs/sui.git"
77
subdir = "crates/sui-framework/packages/sui-framework"
8-
rev = "09b2081498366df936abae26eea4b2d5cafb2788"
8+
rev = "041c5f2bae2fe52079e44b70514333532d69f4e6"
99

1010
[dependencies.Wormhole]
1111
git = "https://github.com/wormhole-foundation/wormhole.git"
1212
subdir = "sui/wormhole"
13-
rev = "d050ad1d67a5b7da9fb65030aad12ef5d774ccad"
13+
rev = "82d82bffd5a8566e4b5d94be4e4678ad55ab1f4f"
1414

1515
[addresses]
1616
pyth = "0x00b53b0f4174108627fbee72e2498b58d6a2714cded53fac537034c220d26302"

target_chains/sui/contracts/sources/governance/contract_upgrade.move

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ module pyth::contract_upgrade {
2727
const E_GOVERNANCE_CONTRACT_UPGRADE_CHAIN_ID_ZERO: u64 = 2;
2828
const E_CANNOT_EXECUTE_GOVERNANCE_ACTION_WITH_OBSOLETE_SEQUENCE_NUMBER: u64 = 3;
2929

30-
/// Specific governance payload ID (action) to complete upgrading the
31-
/// contract.
32-
/// TODO: is it okay for the contract upgrade action for Pyth to be 0? Or should it be 1?
33-
const CONTRACT_UPGRADE: u8 = 0;
34-
3530
// Event reflecting package upgrade.
3631
struct ContractUpgraded has drop, copy {
3732
old_contract: ID,
@@ -131,6 +126,13 @@ module pyth::contract_upgrade {
131126
UpgradeContract { digest }
132127
}
133128

129+
#[test_only]
130+
/// Specific governance payload ID (action) to complete upgrading the
131+
/// contract.
132+
/// TODO: is it okay for the contract upgrade action for Pyth to be 0? Or should it be 1?
133+
const CONTRACT_UPGRADE: u8 = 0;
134+
135+
134136
#[test_only]
135137
public fun action(): u8 {
136138
CONTRACT_UPGRADE

target_chains/sui/contracts/sources/governance/governance.move

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module pyth::governance {
1414
const E_INVALID_GOVERNANCE_ACTION: u64 = 0;
1515
const E_MUST_USE_CONTRACT_UPGRADE_MODULE_TO_DO_UPGRADES: u64 = 1;
1616
const E_CANNOT_EXECUTE_GOVERNANCE_ACTION_WITH_OBSOLETE_SEQUENCE_NUMBER: u64 = 2;
17-
const E_OLD_GUARDIAN_SET_GOVERNANCE: u64 = 3;
1817
const E_INVALID_GOVERNANCE_DATA_SOURCE: u64 = 4;
1918

2019
// this struct does not have the store or key ability so it must be

target_chains/sui/contracts/sources/governance/set_data_sources.move

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module pyth::set_data_sources_tests {
7676
test_scenario::next_tx(&mut scenario, DEPLOYER);
7777
let (pyth_state, worm_state) = take_wormhole_and_pyth_states(&scenario);
7878

79-
let verified_vaa = wormhole::vaa::parse_and_verify(&mut worm_state, SET_DATA_SOURCES_VAA, &clock);
79+
let verified_vaa = wormhole::vaa::parse_and_verify(&worm_state, SET_DATA_SOURCES_VAA, &clock);
8080

8181
let receipt = pyth::governance::verify_vaa(&pyth_state, verified_vaa);
8282

target_chains/sui/contracts/sources/governance/set_stale_price_threshold.move

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module pyth::set_stale_price_threshold_test {
5151
test_scenario::next_tx(&mut scenario, DEPLOYER);
5252
let (pyth_state, worm_state) = take_wormhole_and_pyth_states(&scenario);
5353

54-
let verified_vaa = wormhole::vaa::parse_and_verify(&mut worm_state, SET_STALE_PRICE_THRESHOLD_VAA, &clock);
54+
let verified_vaa = wormhole::vaa::parse_and_verify(&worm_state, SET_STALE_PRICE_THRESHOLD_VAA, &clock);
5555

5656
let receipt = pyth::governance::verify_vaa(&pyth_state, verified_vaa);
5757

target_chains/sui/contracts/sources/governance/set_update_fee.move

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module pyth::set_update_fee {
88

99
friend pyth::governance;
1010

11-
const MAX_U64: u128 = (1 << 64) - 1;
1211
const E_EXPONENT_DOES_NOT_FIT_IN_U8: u64 = 0;
1312

1413
struct UpdateFee {
@@ -65,7 +64,7 @@ module pyth::set_update_fee_tests {
6564
test_scenario::next_tx(&mut scenario, DEPLOYER);
6665
let (pyth_state, worm_state) = take_wormhole_and_pyth_states(&scenario);
6766

68-
let verified_vaa = wormhole::vaa::parse_and_verify(&mut worm_state, SET_FEE_VAA, &clock);
67+
let verified_vaa = wormhole::vaa::parse_and_verify(&worm_state, SET_FEE_VAA, &clock);
6968

7069
let receipt = pyth::governance::verify_vaa(&pyth_state, verified_vaa);
7170

0 commit comments

Comments
 (0)