mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
[BridgeHub] Correct Accounts setup for bridge pallets
This commit is contained in:
@@ -12,23 +12,34 @@ Every _BridgeHub_ is meant to be **_common good parachain_** with main responsib
|
||||
- sync finality proofs between BridgeHub parachains
|
||||
- pass (XCM) messages between different BridgeHub parachains
|
||||
|
||||

|
||||

|
||||
|
||||
## How to test locally Rococo <-> Wococo
|
||||
|
||||
### Deploy
|
||||
### Build/Deploy
|
||||
```
|
||||
# Prepare empty directory for testing
|
||||
mkdir -p ~/local_bridge_testing/bin
|
||||
mkdir -p ~/local_bridge_testing/logs
|
||||
|
||||
|
||||
# 1. Build polkadot binary
|
||||
TODO: description
|
||||
|
||||
# 2. Build cumulus polkadot-parachain binary
|
||||
cd <cumulus-git-repo-dir>
|
||||
cargo build --release --locked -p polkadot-parachain@0.9.230
|
||||
|
||||
mkdir -p ~/local_bridge_testing/bin
|
||||
|
||||
rm ~/local_bridge_testing/bin/polkadot-parachain
|
||||
cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain
|
||||
ls -lrt ~/local_bridge_testing/bin/polkadot-parachain
|
||||
|
||||
# 3. Build substrate-relay binary
|
||||
git clone https://github.com/paritytech/parity-bridges-common.git
|
||||
cd parity-bridges-common
|
||||
cargo build -p substrate-relay
|
||||
rm ~/local_bridge_testing/bin/substrate-relay
|
||||
cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay
|
||||
```
|
||||
|
||||
### Run with Zombienet
|
||||
### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) with Zombienet
|
||||
|
||||
```
|
||||
# Rococo
|
||||
@@ -42,7 +53,7 @@ POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
|
||||
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./zombienet_tests/0004-run_bridge_hubs_wococo.toml
|
||||
```
|
||||
|
||||
### Run from cmd
|
||||
### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) from `cmd`
|
||||
|
||||
#### Run relay chains (Rococo, Wococo)
|
||||
```
|
||||
@@ -64,7 +75,8 @@ POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
|
||||
We need at least 5 nodes together (validator + collator) to finalize blocks.
|
||||
|
||||
#### Run BridgeHub parachains (Rococo, Wococo)
|
||||
##### Generate spec + genesis + wasm (paraId=1013)
|
||||
|
||||
**1. Generate spec + genesis + wasm (paraId=1013)**
|
||||
```
|
||||
# Rococo
|
||||
rm ~/local_bridge_testing/bridge-hub-rococo-local-raw.json
|
||||
@@ -79,7 +91,7 @@ rm ~/local_bridge_testing/bridge-hub-wococo-local-raw.json
|
||||
~/local_bridge_testing/bin/polkadot-parachain export-genesis-wasm --chain ~/local_bridge_testing/bridge-hub-wococo-local-raw.json > ~/local_bridge_testing/bridge-hub-wococo-local-genesis-wasm
|
||||
```
|
||||
|
||||
##### Run collators (Rococo, Wococo)
|
||||
**2. Run collators (Rococo, Wococo)**
|
||||
```
|
||||
# Rococo
|
||||
~/local_bridge_testing/bin/polkadot-parachain --collator --alice --force-authoring --tmp --port 40333 --rpc-port 8933 --ws-port 8943 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 41333 --rpc-port 48933 --ws-port 48943
|
||||
@@ -90,7 +102,7 @@ rm ~/local_bridge_testing/bridge-hub-wococo-local-raw.json
|
||||
~/local_bridge_testing/bin/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --rpc-port 8936 --ws-port 8946 --chain ~/local_bridge_testing/bridge-hub-wococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/wococo-local-cfde.json --port 41336 --rpc-port 48936 --ws-port 48946
|
||||
```
|
||||
|
||||
##### Activate parachains (Rococo, Wococo) (paraId=1013)
|
||||
**3. Activate parachains (Rococo, Wococo) (paraId=1013)**
|
||||
```
|
||||
# Rococo
|
||||
https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9942#/explorer
|
||||
@@ -99,11 +111,53 @@ https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9942#/explorer
|
||||
https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9945#/explorer
|
||||
```
|
||||
|
||||
##### After parachain activation, we should see new blocks in collator's node
|
||||
**4. After parachain activation, we should see new blocks in collator's node**
|
||||
```
|
||||
https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains
|
||||
```
|
||||
|
||||
### Run relayers (Rococo, Wococo)
|
||||
|
||||
**Accounts of BridgeHub parachains:**
|
||||
- `Bob` is pallet owner of all bridge pallets
|
||||
- `Alice` is `Sudo`
|
||||
|
||||
**1. Init bridges**
|
||||
```
|
||||
# Rococo -> Wococo
|
||||
RUST_LOG=runtime=trace,rpc=trace,runtime::bridge=trace \
|
||||
~/local_bridge_testing/bin/substrate-relay init-bridge bridge-hub-rococo-to-bridge-hub-wococo \
|
||||
--source-host localhost \
|
||||
--source-port 48943 \
|
||||
--target-host localhost \
|
||||
--target-port 8945 \
|
||||
--target-signer //Bob
|
||||
|
||||
# Wococo -> Rococo
|
||||
RUST_LOG=runtime=trace,rpc=trace,runtime::bridge=trace \
|
||||
~/local_bridge_testing/bin/substrate-relay init-bridge bridge-hub-wococo-to-bridge-hub-rococo \
|
||||
--source-host localhost \
|
||||
--source-port 48945 \
|
||||
--target-host localhost \
|
||||
--target-port 8943 \
|
||||
--target-signer //Bob
|
||||
```
|
||||
|
||||
**2. Relay headers**
|
||||
|
||||
TODO:
|
||||
|
||||
**2. Relay (Grandpa relay-chain) headers**
|
||||
|
||||
TODO:
|
||||
|
||||
**3. Relay (BridgeHub parachain) headers**
|
||||
|
||||
TODO:
|
||||
|
||||
**4. Relay (XCM) messages**
|
||||
|
||||
TODO:
|
||||
|
||||
## Git subtree `./bridges`
|
||||
|
||||
|
||||
@@ -82,6 +82,9 @@ default = [
|
||||
"std",
|
||||
]
|
||||
std = [
|
||||
"bp-polkadot-core/std",
|
||||
"bp-rococo/std",
|
||||
"bp-wococo/std",
|
||||
"codec/std",
|
||||
"log/std",
|
||||
"scale-info/std",
|
||||
@@ -101,6 +104,11 @@ std = [
|
||||
"pallet-aura/std",
|
||||
"pallet-authorship/std",
|
||||
"pallet-balances/std",
|
||||
"pallet-bridge-grandpa/std",
|
||||
"pallet-bridge-messages/std",
|
||||
"pallet-bridge-parachains/std",
|
||||
"pallet-bridge-relayers/std",
|
||||
"pallet-shift-session-manager/std",
|
||||
"pallet-collator-selection/std",
|
||||
"pallet-session/std",
|
||||
"pallet-sudo/std",
|
||||
|
||||
@@ -467,6 +467,11 @@ impl pallet_collator_selection::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl pallet_sudo::Config for Runtime {
|
||||
type Call = Call;
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
// Add bridge pallets (GPA)
|
||||
parameter_types! {
|
||||
pub const MaxRequests: u32 = 64;
|
||||
@@ -558,15 +563,18 @@ construct_runtime!(
|
||||
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
|
||||
|
||||
// Consensus support.
|
||||
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
|
||||
ShiftSessionManager: pallet_shift_session_manager::{Pallet} = 40,
|
||||
|
||||
// Wococo bridge modules
|
||||
BridgeWococoGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Storage},
|
||||
BridgeWococoParachain: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage},
|
||||
BridgeWococoGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Storage, Config<T>} = 41,
|
||||
BridgeWococoParachain: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage} = 42,
|
||||
|
||||
// Rococo bridge modules
|
||||
BridgeRococoGrandpa: pallet_bridge_grandpa::<Instance2>::{Pallet, Call, Storage},
|
||||
BridgeRococoParachain: pallet_bridge_parachains::<Instance2>::{Pallet, Call, Storage},
|
||||
BridgeRococoGrandpa: pallet_bridge_grandpa::<Instance2>::{Pallet, Call, Storage, Config<T>} = 43,
|
||||
BridgeRococoParachain: pallet_bridge_parachains::<Instance2>::{Pallet, Call, Storage} = 44,
|
||||
|
||||
// Sudo
|
||||
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Event<T>, Storage} = 100,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ pub mod rococo {
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
],
|
||||
para_id,
|
||||
Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
|
||||
Some(get_account_id_from_seed::<sr25519::Public>("Bob")),
|
||||
)
|
||||
},
|
||||
Vec::new(),
|
||||
@@ -158,6 +160,8 @@ pub mod rococo {
|
||||
invulnerables: Vec<(AccountId, AuraId)>,
|
||||
endowed_accounts: Vec<AccountId>,
|
||||
id: ParaId,
|
||||
root_key: Option<AccountId>,
|
||||
bridges_pallet_owner: Option<AccountId>,
|
||||
) -> bridge_hub_rococo_runtime::GenesisConfig {
|
||||
bridge_hub_rococo_runtime::GenesisConfig {
|
||||
system: bridge_hub_rococo_runtime::SystemConfig {
|
||||
@@ -193,6 +197,16 @@ pub mod rococo {
|
||||
polkadot_xcm: bridge_hub_rococo_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
// TODO: when go live, check it: https://github.com/paritytech/parity-bridges-common/issues/1551
|
||||
sudo: bridge_hub_rococo_runtime::SudoConfig { key: root_key },
|
||||
bridge_wococo_grandpa: bridge_hub_rococo_runtime::BridgeWococoGrandpaConfig {
|
||||
owner: bridges_pallet_owner.clone(),
|
||||
..Default::default()
|
||||
},
|
||||
bridge_rococo_grandpa: bridge_hub_rococo_runtime::BridgeRococoGrandpaConfig {
|
||||
owner: bridges_pallet_owner,
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user