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

Runtime codegen tuning #3008

Merged
merged 5 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Updated script for regenerate all
bkontur committed Jun 4, 2024
commit 0fa499b1e4ce93fde6c07ec75c40034c0457852a
28 changes: 19 additions & 9 deletions scripts/regenerate_runtimes.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
#!/bin/bash

cd tools/runtime-codegen
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-bridge-hub-rpc.polkadot.io:443" > ../../relays/client-bridge-hub-rococo/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-rpc.polkadot.io:443" > ../../relays/client-rococo/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://westend-rpc.polkadot.io:443" > ../../relays/client-westend/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://kusama-rpc.polkadot.io:443" > ../../relays/client-kusama/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://rpc.polkadot.io:443" > ../../relays/client-polkadot/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-bridge-hub-rpc.polkadot.io:443" > ../../relay-clients/client-bridge-hub-rococo/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-rpc.polkadot.io:443" > ../../relay-clients/client-rococo/src/codegen_runtime.rs

cargo run --bin runtime-codegen -- --from-node-url "wss://westend-rpc.polkadot.io:443" > ../../relay-clients/client-westend/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://westend-bridge-hub-rpc.polkadot.io:443" > ../../relay-clients/client-bridge-hub-westend/src/codegen_runtime.rs

cargo run --bin runtime-codegen -- --from-node-url "wss://kusama-rpc.polkadot.io" > ../../relay-clients/client-kusama/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://kusama-bridge-hub-rpc.polkadot.io" > ../../relay-clients/client-bridge-hub-kusama/src/codegen_runtime.rs

cargo run --bin runtime-codegen -- --from-node-url "wss://dot-rpc.stakeworld.io" > ../../relay-clients/client-polkadot/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://polkadot-bridge-hub-rpc.polkadot.io" > ../../relay-clients/client-bridge-hub-polkadot/src/codegen_runtime.rs

# Uncomment to update other runtimes

# For `polkadot-sdk` testnet runtimes:
# TODO: there is a bug, probably needs to update subxt, generates: `::sp_runtime::generic::Header<::core::primitive::u32>` withtout second `Hash` parameter.
# cargo run --bin runtime-codegen -- --from-wasm-file ../../../polkadot-sdk/target/release/wbuild/bridge-hub-rococo-runtime/bridge_hub_rococo_runtime.compact.compressed.wasm > ../../relays/client-bridge-hub-rococo/src/codegen_runtime.rs
# cargo run --bin runtime-codegen -- --from-wasm-file ../../../polkadot-sdk/target/release/wbuild/bridge-hub-westend-runtime/bridge_hub_westend_runtime.compact.compressed.wasm > ../../relays/client-bridge-hub-westend/src/codegen_runtime.rs
# OR for production runtimes:
# cargo run --bin runtime-codegen -- --from-node-url wss://kusama-bridge-hub-rpc.polkadot.io/ > ../../relay-clients/client-bridge-hub-kusama/src/codegen_runtime.rs
# cargo run --bin runtime-codegen -- --from-node-url wss://polkadot-bridge-hub-rpc.polkadot.io/ > ../../relay-clients/client-bridge-hub-polkadot/src/codegen_runtime.rs

cd -
cargo fmt --all
cargo +nightly fmt --all

# **IMPORTANT**: due to [well-known issue](https://github.com/paritytech/parity-bridges-common/issues/2669)
find . -name codegen_runtime.rs -exec \
sed -i 's/::sp_runtime::generic::Header<::core::primitive::u32>/::sp_runtime::generic::Header<::core::primitive::u32, ::sp_runtime::traits::BlakeTwo256>/g' {} +

cargo +nightly fmt --all


# Polkadot Bulletin Chain:
#