-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Bridge Header Sync to Rococo Runtime #2983
Changes from 11 commits
f6682b8
eed0d61
2c5e641
060c9e2
99a4c21
8d5c068
c52b752
e969faf
fbbc6a5
7727420
348a5f2
ff0fee4
9cf8fbb
8a029c9
f65482d
5e30ceb
3b69d93
1bcf77a
d998df1
92f2205
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
|
||
| # | ||
| # Run an instance of the Rococo -> Wococo header sync. | ||
| # | ||
| # Right now this relies on local Wococo and Rococo networks | ||
| # running (which include `pallet-bridge-grandpa` in their | ||
| # runtimes), but in the future it could use use public RPC nodes. | ||
|
|
||
| set -xeu | ||
|
|
||
| RUST_LOG=rpc=trace,bridge=trace ./target/debug/substrate-relay init-bridge RococoToWococo \ | ||
| --source-host 127.0.0.1 \ | ||
| --source-port 9955 \ | ||
| --target-host 127.0.0.1 \ | ||
| --target-port 9944 \ | ||
| --target-signer //Dave | ||
|
|
||
| RUST_LOG=rpc=trace,bridge=trace ./target/debug/substrate-relay relay-headers RococoToWococo \ | ||
| --source-host 127.0.0.1 \ | ||
| --source-port 9955 \ | ||
| --target-host 127.0.0.1 \ | ||
| --target-port 9944 \ | ||
| --target-signer //Bob \ | ||
| --prometheus-host=0.0.0.0 \ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Run an instance of the Wococo -> Rococo header sync. | ||
| # | ||
| # Right now this relies on local Wococo and Rococo networks | ||
| # running (which include `pallet-bridge-grandpa` in their | ||
| # runtimes), but in the future it could use use public RPC nodes. | ||
|
|
||
| set -xeu | ||
|
|
||
| RUST_LOG=rpc=trace,bridge=trace ./target/debug/substrate-relay init-bridge WococoToRococo \ | ||
| --source-host 127.0.0.1 \ | ||
| --source-port 9944 \ | ||
| --target-host 127.0.0.1 \ | ||
| --target-port 9955 \ | ||
| --target-signer //Eve | ||
|
|
||
| RUST_LOG=rpc=trace,bridge=trace ./target/debug/substrate-relay relay-headers WococoToRococo \ | ||
| --source-host 127.0.0.1 \ | ||
| --source-port 9944 \ | ||
| --target-host 127.0.0.1 \ | ||
| --target-port 9955 \ | ||
| --target-signer //Charlie \ | ||
| --prometheus-host=0.0.0.0 \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Run a development instance of the Wococo Substrate bridge node. | ||
| # To override the default port just export WOCOCO_PORT=9955 | ||
| # | ||
| # Note: This script will not work out of the box with the bridges | ||
| # repo since it relies on a Polkadot binary. | ||
|
|
||
| WOCOCO_PORT="${WOCOCO_PORT:-9944}" | ||
|
|
||
| RUST_LOG=runtime=trace,runtime::bridge=trace \ | ||
| ./target/debug/polkadot --chain=wococo-dev --alice --tmp \ | ||
| --rpc-cors=all --unsafe-rpc-external --unsafe-ws-external \ | ||
| --port 33033 --rpc-port 9933 --ws-port $WOCOCO_PORT \ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -921,6 +921,14 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: | |||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { | ||||||||||||||||||||||||||||||
| owner: Some(get_account_id_from_seed::<sr25519::Public>("Dave")), | ||||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | ||||||||||||||||||||||||||||||
| owner: Some(get_account_id_from_seed::<sr25519::Public>("Eve")), | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
@@ -1475,6 +1483,14 @@ pub fn rococo_testnet_genesis( | |||||||||||||||||||||||||||||
| paras: vec![], | ||||||||||||||||||||||||||||||
| _phdata: Default::default(), | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { | ||||||||||||||||||||||||||||||
| owner: Some(get_account_id_from_seed::<sr25519::Public>("Dave")), | ||||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | ||||||||||||||||||||||||||||||
| owner: Some(get_account_id_from_seed::<sr25519::Public>("Eve")), | ||||||||||||||||||||||||||||||
| ..Default::default() | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess |
||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -235,6 +235,8 @@ construct_runtime! { | |||||
| Mmr: pallet_mmr::{Pallet, Call, Storage}, | ||||||
| Beefy: pallet_beefy::{Pallet, Config<T>, Storage}, | ||||||
| MmrLeaf: mmr_common::{Pallet, Storage}, | ||||||
| BridgeRococoGrandpa: pallet_bridge_grandpa::{Pallet, Call, Storage, Config<T>} = 40, | ||||||
| BridgeWococoGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Storage, Config<T>} = 41, | ||||||
|
Comment on lines
+242
to
+243
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think an explanatory comment would be nice here, cause we are adding |
||||||
|
|
||||||
| // Validator Manager pallet. | ||||||
| ValidatorManager: validator_manager::{Pallet, Call, Storage, Event<T>}, | ||||||
|
|
@@ -789,6 +791,40 @@ impl mmr_common::Config for Runtime { | |||||
| type ParachainHeads = Paras; | ||||||
| } | ||||||
|
|
||||||
| parameter_types! { | ||||||
| // This is a pretty unscientific cap. | ||||||
| // | ||||||
| // Note that once this is hit the pallet will essentially throttle incoming requests down to one | ||||||
| // call per block. | ||||||
| pub const MaxRequests: u32 = 50; | ||||||
|
||||||
| pub const MaxRequests: u32 = 50; | |
| pub const MaxRequests: u32 = 4 * HOURS as u32; |
Can we do something like that instead? This will allow us to catch-up immediately in case of 4 hours downtime.
Uh oh!
There was an error while loading. Please reload this page.