Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
39 changes: 22 additions & 17 deletions Cargo.lock

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

12 changes: 11 additions & 1 deletion bin/node/runtime/pangolin/polkadot-compatible-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,16 @@
},
"AddressT": "[u8; 20; AddressT]",
"__[pallet.header-mmr]__": {},
"NodeIndex": "u64",
"MerkleMountainRangeRootLog": {
"prefix": "[u8; 4; Prefix]",
"parent_mmr_root": "Hash"
},
"MmrNodesPruningConfiguration": {
"step": "NodeIndex",
"progress": "NodeIndex",
"last_position": "NodeIndex"
},
"__[primitives.relay]__": {},
"OpCode": "[u8; 4; OpCode]",
"Term": "u32",
Expand All @@ -223,14 +229,18 @@
},
"RelayAuthorityT": {
"account_id": "AccountId",
"signer": "Signer",
"signer": "EthereumAddress",
"stake": "Balance",
"term": "BlockNumber"
},
"ScheduledAuthoritiesChangeT": {
"next_authorities": "Vec<RelayAuthorityT>",
"deadline": "BlockNumber"
},
"MmrRootToSign": {
"mmr_root": "Hash",
"signatures": "Vec<(EthereumAddress, EcdsaSignature)>"
},
"MMRRoot": "Hash",
"__[pangolin.runtime]__": {
"ProxyType": {
Expand Down
7 changes: 6 additions & 1 deletion bin/node/runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ impl_runtime_apis! {
block_number_of_member_leaf: u64,
block_number_of_last_leaf: u64
) -> HeaderMMRRuntimeDispatchInfo<Hash> {
HeaderMMR::gen_proof_rpc(block_number_of_member_leaf, block_number_of_last_leaf )
HeaderMMR::gen_proof_rpc(block_number_of_member_leaf, block_number_of_last_leaf)
}
}

Expand Down Expand Up @@ -848,6 +848,11 @@ pub struct CustomOnRuntimeUpgrade;
impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
// <--- Hack for local test
use frame_support::traits::Currency;
let _ = Ring::deposit_creating(&BridgeMillauMessages::relayer_fund_account_id(), 1 << 50);
// --->

Ok(())
}

Expand Down
6 changes: 5 additions & 1 deletion bin/node/runtime/pangolin/src/pallets/header_mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
use crate::*;
use darwinia_header_mmr::Config;

impl Config for Runtime {}
impl Config for Runtime {
type WeightInfo = ();

const INDEXING_PREFIX: &'static [u8] = b"header-mmr-";
}
12 changes: 11 additions & 1 deletion bin/node/runtime/pangolin/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,16 @@
},
"AddressT": "[u8; 20; AddressT]",
"__[pallet.header-mmr]__": {},
"NodeIndex": "u64",
"MerkleMountainRangeRootLog": {
"prefix": "[u8; 4; Prefix]",
"parent_mmr_root": "Hash"
},
"MmrNodesPruningConfiguration": {
"step": "NodeIndex",
"progress": "NodeIndex",
"last_position": "NodeIndex"
},
"__[primitives.relay]__": {},
"OpCode": "[u8; 4; OpCode]",
"Term": "u32",
Expand All @@ -215,14 +221,18 @@
},
"RelayAuthorityT": {
"account_id": "AccountId",
"signer": "Signer",
"signer": "EthereumAddress",
"stake": "Balance",
"term": "BlockNumber"
},
"ScheduledAuthoritiesChangeT": {
"next_authorities": "Vec<RelayAuthorityT>",
"deadline": "BlockNumber"
},
"MmrRootToSign": {
"mmr_root": "Hash",
"signatures": "Vec<(EthereumAddress, EcdsaSignature)>"
},
"MMRRoot": "Hash",
"__[pangolin.runtime]__": {
"ProxyType": {
Expand Down
2 changes: 1 addition & 1 deletion frame/bridge/ethereum/backing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ pub mod pallet {
(<frame_system::Pallet<T>>::block_number().saturated_into::<u32>() / 10 * 10
+ 10)
.saturated_into(),
);
)?;
}

Ok(().into())
Expand Down
4 changes: 3 additions & 1 deletion frame/bridge/ethereum/backing/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ macro_rules! decl_tests {
impl RelayAuthorityProtocol<BlockNumber> for EcdsaAuthorities {
type Signer = EthereumAddress;

fn schedule_mmr_root(_: BlockNumber) {}
fn schedule_mmr_root(_: BlockNumber) -> DispatchResult {
Ok(())
}

fn check_authorities_change_to_sync(_: Term, _: Vec<Self::Signer>) -> DispatchResult {
Ok(())
Expand Down
15 changes: 9 additions & 6 deletions frame/bridge/relay-authorities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ version = "2.4.0"
[dependencies]
# crates
codec = { package = "parity-scale-codec", version = "2.1.1", default-features = false, features = ["derive"] }
log = { version = "0.4.14" }
# darwinia
darwinia-relay-primitives = { default-features = false, path = "../../../primitives/relay" }
darwinia-support = { default-features = false, path = "../../support" }
Expand All @@ -25,11 +26,13 @@ sp-std = { default-features = false, git = "https://github.com/darwinia-n
# crates
array-bytes = { version = "1.1.0" }
# darwinia
darwinia-balances = { path = "../../balances" }
darwinia-support = { path = "../../support" }
darwinia-balances = { path = "../../balances" }
darwinia-header-mmr = { features = ["easy-testing"], path = "../../header-mmr" }
darwinia-support = { path = "../../support" }
# substrate
sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.1" }
sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.1" }
sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.1" }
sp-io = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.1" }
sp-tracing = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.1" }

[features]
default = ["std"]
Expand All @@ -40,10 +43,10 @@ std = [
"substrate-std",
]

crates-std = [
crates-std = [
"codec/std",
]
darwinia-std = [
darwinia-std = [
"darwinia-relay-primitives/std",
"darwinia-support/std",
]
Expand Down
Loading