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

Adds Paseo to control tool #1295

Merged
merged 16 commits into from
Oct 4, 2024
Merged
5 changes: 5 additions & 0 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ BEEFY commitments & proofs extracted from `/tmp/snowbridge/beefy-relay.log`.

1. Search for `Sent SubmitFinal transaction` in relayer log file
2. Copy into `test/data/beefy-commitment.json`
```

## Deploy to Testnet

To deploy to a testnet, run script `deploy-test.sh`. Replace `--with-gas-price` with standard gas value (found at https://sepolia.beaconcha.in/gasnow). Make sure to add all the necessary envs in .envrc.
15 changes: 15 additions & 0 deletions contracts/scripts/deploy-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -eux

export FOUNDRY_PROFILE=production

forge script \
--rpc-url "${ETH_WS_ENDPOINT}" \
--broadcast \
--legacy \
--with-gas-price 110000000000 \
--verify \
--etherscan-api-key "${ETHERSCAN_API_KEY}" \
-vvvvv \
scripts/DeployLocal.sol:DeployLocal
36 changes: 36 additions & 0 deletions control/Cargo.lock

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

3 changes: 3 additions & 0 deletions control/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ members = [
"runtimes/westend",
"runtimes/bridge-hub-westend",
"runtimes/asset-hub-westend",
"runtimes/paseo",
"runtimes/bridge-hub-paseo",
"runtimes/asset-hub-paseo",
"preimage",
]

Expand Down
58 changes: 8 additions & 50 deletions control/README.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README is becoming a bit stale. Can you delete lines 43-73, and update lines 78-onwards to reflect current reality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. 02a7335.

Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,21 @@ cargo run --features polkadot --bin snowbridge-preimage -- \
--gateway-operating-mode normal
```

```shell
cargo run --features westend --bin snowbridge-preimage -- \
initialize \
--exchange-rate-numerator 1 \
--exchange-rate-denominator 400 \
--multiplier-numerator 4 \
--multiplier-denominator 3 \
--fee-per-gas 80 \
--local-reward 0.01 \
--remote-reward 0.0001 \
--checkpoint data/sepolia/initial-checkpoint.json \
--gateway-address 0x9ed8b47bc3417e3bd0507adc06e56e2fa360a4e9 \
--gateway-operating-mode normal
```

The preimage can be tested using the generated `chopsticks-execute-upgrade.js` script
To target a different chain, replace `--features polkadot` with the applicable chain, e.g. `--features westend`.

NOTE: Since the 1.2.0 upgrade has not executed yet on mainnet Polkadot, I tested the tool using a local zombienet or chopsticks environment. Pass the `--bridge-hub-api` the `--asset-hub-api` params to override the default API endpoints.
The preimage can be tested using the generated `chopsticks-execute-upgrade.js` script.

## Update runtime bindings
NOTE: To test an upgrade that has not executed yet on the relevant environment, it can be tested using a local zombienet or chopsticks environment. Pass the `--bridge-hub-api` the `--asset-hub-api` params to override the default API endpoints.

To generate runtime bindings that include the 1.2.0 runtime release, we need to start a local `polkadot-local` network using zombienet.
# Update bindings

Build polkadot executables:

```shell
cd $WORKSPACE/polkadot-sdk
cargo build --release
cp target/release/{polkadot,polkadot-prepare-worker,polkadot-execute-worker,polkadot-parachain} $WORKDIR/
```

Build the `chain-spec-generator` for production runtimes:

```shell
cd $WORKSPACE/runtimes
cargo build -p chain-spec-generator --profile production
cp target/production/chain-spec-generator $WORKDIR/
```

Create initial chainspecs:

```shell
chain-spec-generator polkadot-local > polkadot-local.json
chain-spec-generator asset-hub-polkadot-local > asset-hub-polkadot-local.json
chain-spec-generator bridge-hub-polkadot-local > bridge-hub-polkadot-local.json
```

Launch zombienet:

```shell
zombienet spawn launch-config.toml
```

Update bindings:
To update the runtime code binding, run the following commands:

```shell
subxt metadata --url ws://127.0.0.1:8000 -f bytes -o runtimes/polkadot/polkadot-metadata.bin
subxt metadata --url ws://127.0.0.1:8001 -f bytes -o runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin
subxt metadata --url ws://127.0.0.1:8002 -f bytes -o runtimes/asset-hub-polkadot/asset-hub-metadata.bin
```

To update Westend/Paseo bindings, replace the chain name in the command, e.g. replace `runtimes/polkadot/polkadot-metadata.bin`
with `runtimes/westend/polkadot-metadata.bin`.
Loading
Loading