Skip to content

Commit

Permalink
Release 0.7.4 (#576)
Browse files Browse the repository at this point in the history
* bump: dependencies

* bump: futures

* bump: version

* bump: spec

* update: ethereum relay & migrations

* fix: `ProxyType`

* update: types

* fix: `ProxyType`
  • Loading branch information
AurevoirXavier authored Oct 26, 2020
1 parent 37d08ce commit f5f4fca
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 255 deletions.
281 changes: 146 additions & 135 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[[bin]]
name = "darwinia"
Expand All @@ -17,7 +17,7 @@ maintenance = { status = "actively-developed" }

[dependencies]
# crates
futures = { version = "0.3.6" }
futures = { version = "0.3.7" }
parity-util-mem = { version = "*", default-features = false, features = ["jemalloc-global"] }
# darwinia
darwinia-cli = { path = "cli" }
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-cli"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
Expand Down
4 changes: 2 additions & 2 deletions node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-service"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
codec = { package = "parity-scale-codec", version = "1.3.5", features = ["derive"] }
futures = { version = "0.3.6" }
futures = { version = "0.3.7" }
log = { version = "0.4.11" }
serde = { version = "1.0.117", features = ["derive"] }
serde_json = { version = "1.0.59" }
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-primitives"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-rpc"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-runtime-common"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
Expand Down
2 changes: 1 addition & 1 deletion runtime/crab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "crab-runtime"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
Expand Down
34 changes: 19 additions & 15 deletions runtime/crab/polkadot-compatible-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,30 +203,34 @@
"mmr_root": "Hash"
},
"__[pallet.relayer-game]__": {},
"RelayHeaderId": "Vec<u8>",
"RelayHeaderParcel": "Vec<u8>",
"RelayProofs": "Vec<u8>",
"RelayHeaderId": "EthereumBlockNumber",
"RelayHeaderParcel": "EthereumRelayHeaderParcel",
"RelayProofs": "EthereumRelayProof",
"RelayAffirmationId": {
"relay_header_id": "Vec<u8>",
"game_id": "EthereumBlockNumber",
"round": "u32",
"index": "u32"
},
"RelayAffirmationT": {
"relayer": "AccountId",
"relay_header_parcels": "Vec<u8>",
"relay_header_parcels": "EthereumRelayHeaderParcel",
"bond": "Balance",
"maybe_extended_relay_affirmation_id": "Option<Vec<u8>>",
"maybe_extended_relay_affirmation_id": "Option<RelayAffirmationId>",
"verified": "bool"
},
"__[crab.runtime]__": {
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
"RelayVotingState": {
"ayes": "Vec<AccountId>",
"nays": "Vec<AccountId>"
},
"__[crab.runtime]__": {},
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Governance": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
},
"__[node.rpc]__": {},
Expand Down
59 changes: 34 additions & 25 deletions runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ use static_assertions::const_assert;
use frame_support::{
construct_runtime, debug, parameter_types,
traits::{
Imbalance, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, Randomness,
ChangeMembers, Imbalance, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
OnUnbalanced, Randomness,
},
weights::Weight,
};
Expand Down Expand Up @@ -111,7 +112,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
darwinia_ethereum_relay::CheckEthereumRelayHeaderHash<Runtime>,
darwinia_ethereum_relay::CheckEthereumRelayHeaderParcel<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
Expand All @@ -124,7 +125,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllModules,
CustomOnRuntimeUpgrade,
// CustomOnRuntimeUpgrade,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
Expand All @@ -136,7 +137,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("Crab"),
impl_name: create_runtime_str!("Darwinia Crab"),
authoring_version: 0,
spec_version: 23,
spec_version: 24,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
Expand Down Expand Up @@ -553,6 +554,17 @@ impl darwinia_elections_phragmen::Trait for Runtime {
type WeightInfo = weights::darwinia_elections_phragmen::WeightInfo<Runtime>;
}

pub struct MembershipChangedGroup;
impl ChangeMembers<AccountId> for MembershipChangedGroup {
fn change_members_sorted(
incoming: &[AccountId],
outgoing: &[AccountId],
sorted_new: &[AccountId],
) {
TechnicalCommittee::change_members_sorted(incoming, outgoing, sorted_new);
EthereumRelay::change_members_sorted(incoming, outgoing, sorted_new);
}
}
type EnsureRootOrMoreThanHalfCouncil = EnsureOneOf<
AccountId,
EnsureRoot<AccountId>,
Expand All @@ -566,7 +578,7 @@ impl pallet_membership::Trait<pallet_membership::Instance0> for Runtime {
type ResetOrigin = EnsureRootOrMoreThanHalfCouncil;
type PrimeOrigin = EnsureRootOrMoreThanHalfCouncil;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
type MembershipChanged = MembershipChangedGroup;
}

type ApproveOrigin = EnsureOneOf<
Expand Down Expand Up @@ -777,11 +789,9 @@ impl InstanceFilter<Call> for ProxyType {
Call::Scheduler(..) |
Call::Proxy(..) |
Call::Multisig(..) |
Call::EthereumBacking(..) |
// Specifically omitting the entire EthereumBacking pallet
Call::EthereumRelay(..) |
Call::EthereumRelayerGame(..) |
Call::HeaderMMR(..) |
Call::CrabIssuing(..)
Call::HeaderMMR(..) // Specifically omitting the entire CrabIssuing pallet
),
ProxyType::Governance => matches!(
c,
Expand Down Expand Up @@ -885,6 +895,9 @@ type EnsureRootOrHalfTechnicalComittee = EnsureOneOf<
parameter_types! {
pub const EthereumRelayModuleId: ModuleId = ModuleId(*b"da/ethrl");
pub const EthereumNetwork: EthereumNetworkType = EthereumNetworkType::Ropsten;
pub const ConfirmPeriod: BlockNumber = 200;
pub const ApproveThreshold: Perbill = Perbill::from_percent(60);
pub const RejectThreshold: Perbill = Perbill::from_percent(1);
}
impl darwinia_ethereum_relay::Trait for Runtime {
type ModuleId = EthereumRelayModuleId;
Expand All @@ -895,21 +908,19 @@ impl darwinia_ethereum_relay::Trait for Runtime {
type RelayerGame = EthereumRelayerGame;
type ApproveOrigin = TechnicalCommitteeApproveOrigin;
type RejectOrigin = EnsureRootOrHalfTechnicalComittee;
type ConfirmPeriod = ConfirmPeriod;
type TechnicalMembership = TechnicalMembership;
type ApproveThreshold = ApproveThreshold;
type RejectThreshold = RejectThreshold;
type WeightInfo = ();
}

type EthereumRelayerGameInstance = darwinia_relayer_game::Instance0;
parameter_types! {
pub const ConfirmPeriod: BlockNumber = 200;
}
impl darwinia_relayer_game::Trait<EthereumRelayerGameInstance> for Runtime {
type Call = Call;
type Event = Event;
type RingCurrency = Ring;
type RingSlash = Treasury;
type RelayerGameAdjustor = EthereumRelayerGameAdjustor;
type RelayableChain = EthereumRelay;
type ConfirmPeriod = ConfirmPeriod;
type WeightInfo = ();
}

Expand Down Expand Up @@ -990,7 +1001,7 @@ construct_runtime!(

EthereumBacking: darwinia_ethereum_backing::{Module, Call, Storage, Config<T>, Event<T>},
EthereumRelay: darwinia_ethereum_relay::{Module, Call, Storage, Config<T>, Event<T>},
EthereumRelayerGame: darwinia_relayer_game::<Instance0>::{Module, Call, Storage, Event<T>},
EthereumRelayerGame: darwinia_relayer_game::<Instance0>::{Module, Storage},

// Consensus support.
HeaderMMR: darwinia_header_mmr::{Module, Call, Storage},
Expand Down Expand Up @@ -1037,7 +1048,7 @@ where
frame_system::CheckNonce::<Runtime>::from(nonce),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
darwinia_ethereum_relay::CheckEthereumRelayHeaderHash::<Runtime>::new(),
darwinia_ethereum_relay::CheckEthereumRelayHeaderParcel::<Runtime>::new(),
);
let raw_payload = SignedPayload::new(call, extra)
.map_err(|e| {
Expand Down Expand Up @@ -1259,11 +1270,9 @@ impl_runtime_apis! {
}
}

pub struct CustomOnRuntimeUpgrade;
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
<darwinia_ethereum_relay::Module<Runtime>>::migrate_genesis(false);

<Runtime as frame_system::Trait>::MaximumBlockWeight::get()
}
}
// pub struct CustomOnRuntimeUpgrade;
// impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
// fn on_runtime_upgrade() -> frame_support::weights::Weight {
// <Runtime as frame_system::Trait>::MaximumBlockWeight::get()
// }
// }
34 changes: 19 additions & 15 deletions runtime/crab/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,30 +195,34 @@
"mmr_root": "Hash"
},
"__[pallet.relayer-game]__": {},
"RelayHeaderId": "Vec<u8>",
"RelayHeaderParcel": "Vec<u8>",
"RelayProofs": "Vec<u8>",
"RelayHeaderId": "EthereumBlockNumber",
"RelayHeaderParcel": "EthereumRelayHeaderParcel",
"RelayProofs": "EthereumRelayProof",
"RelayAffirmationId": {
"relay_header_id": "Vec<u8>",
"game_id": "EthereumBlockNumber",
"round": "u32",
"index": "u32"
},
"RelayAffirmationT": {
"relayer": "AccountId",
"relay_header_parcels": "Vec<u8>",
"relay_header_parcels": "EthereumRelayHeaderParcel",
"bond": "Balance",
"maybe_extended_relay_affirmation_id": "Option<Vec<u8>>",
"maybe_extended_relay_affirmation_id": "Option<RelayAffirmationId>",
"verified": "bool"
},
"__[crab.runtime]__": {
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
"RelayVotingState": {
"ayes": "Vec<AccountId>",
"nays": "Vec<AccountId>"
},
"__[crab.runtime]__": {},
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Governance": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
},
"__[node.rpc]__": {},
Expand Down
2 changes: 1 addition & 1 deletion runtime/darwinia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-runtime"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.7.3"
version = "0.7.4"

[dependencies]
# crates
Expand Down
34 changes: 19 additions & 15 deletions runtime/darwinia/polkadot-compatible-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,30 +203,34 @@
"mmr_root": "Hash"
},
"__[pallet.relayer-game]__": {},
"RelayHeaderId": "Vec<u8>",
"RelayHeaderParcel": "Vec<u8>",
"RelayProofs": "Vec<u8>",
"RelayHeaderId": "EthereumBlockNumber",
"RelayHeaderParcel": "EthereumRelayHeaderParcel",
"RelayProofs": "EthereumRelayProof",
"RelayAffirmationId": {
"relay_header_id": "Vec<u8>",
"game_id": "EthereumBlockNumber",
"round": "u32",
"index": "u32"
},
"RelayAffirmationT": {
"relayer": "AccountId",
"relay_header_parcels": "Vec<u8>",
"relay_header_parcels": "EthereumRelayHeaderParcel",
"bond": "Balance",
"maybe_extended_relay_affirmation_id": "Option<Vec<u8>>",
"maybe_extended_relay_affirmation_id": "Option<RelayAffirmationId>",
"verified": "bool"
},
"__[crab.runtime]__": {
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
"RelayVotingState": {
"ayes": "Vec<AccountId>",
"nays": "Vec<AccountId>"
},
"__[darwinia.runtime]__": {},
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null,
"Governance": null
}
},
"__[node.rpc]__": {},
Expand Down
Loading

0 comments on commit f5f4fca

Please sign in to comment.