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

Release 0.8.7 #597

Merged
merged 10 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
344 changes: 135 additions & 209 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 1 addition & 6 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.8.6"
version = "0.8.7"

[[bin]]
name = "darwinia"
Expand All @@ -23,11 +23,6 @@ parity-util-mem = { version = "*", default-features = false, features = ["jemall
darwinia-cli = { path = "cli" }
darwinia-service = { path = "node/service" }

[dev-dependencies]
assert_cmd = { version = "1.0.1" }
nix = { version = "0.19.0" }
tempfile = { version = "3.1.0" }

[features]
default = ["darwinia-cli/wasmtime"]
dev = [
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.8.6"
version = "0.8.7"

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
Expand Down
2 changes: 1 addition & 1 deletion node/service/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-service"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.8.6"
version = "0.8.7"

[dependencies]
# crates
Expand Down
2 changes: 2 additions & 0 deletions node/service/src/chain_spec/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ pub fn darwinia_build_spec_genesis() -> GenesisConfig {
backed_ring: 90_403_994_952_547_849_178_882_078_u128 / COIN + 1,
backed_kton: 1_357_120_581_926_771_954_238_u128 / COIN + 1,
}),
darwinia_democracy: Some(Default::default()),
}
}

Expand Down Expand Up @@ -433,6 +434,7 @@ pub fn darwinia_testnet_genesis(
backed_ring: 1 << 56,
backed_kton: 1 << 56,
}),
darwinia_democracy: Some(Default::default()),
}
}

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.8.6"
version = "0.8.7"

[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.8.6"
version = "0.8.7"

[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.8.6"
version = "0.8.7"

[dependencies]
# crates
Expand Down
4 changes: 2 additions & 2 deletions runtime/crab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "crab-runtime"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.8.6"
version = "0.8.7"

[dependencies]
# crates
codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false, features = ["derive"] }
serde = { version = "1.0.118", optional = true }
smallvec = { version = "1.6.0" }
smallvec = { version = "1.6.1" }
static_assertions = { version = "1.1.0" }
# darwinia frame
darwinia-balances = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
Expand Down
33 changes: 23 additions & 10 deletions runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,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 @@ -137,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: 31,
spec_version: 32,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
Expand Down Expand Up @@ -1315,12 +1315,25 @@ impl_runtime_apis! {
}
}

// pub struct CustomOnRuntimeUpgrade;
// impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
// fn on_runtime_upgrade() -> frame_support::weights::Weight {
// // --- substrate ---
// use frame_support::{migration::*, traits::Currency};
pub struct CustomOnRuntimeUpgrade;
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
// --- substrate ---
use frame_support::migration::*;

if let Some(term) = take_storage_value::<darwinia_relay_primitives::relay_authorities::Term>(
b"Instance0DarwiniaRelayAuthorities",
b"AuthorityTerm",
&[],
) {
put_storage_value(
b"Instance0DarwiniaRelayAuthorities",
b"AuthorityTerm",
&[],
term - 1,
);
}

// <Runtime as frame_system::Trait>::MaximumBlockWeight::get()
// }
// }
<Runtime as frame_system::Trait>::MaximumBlockWeight::get()
}
}
6 changes: 6 additions & 0 deletions runtime/crab/src/weights/darwinia_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ impl<T: frame_system::Trait> darwinia_staking::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(3 as Weight))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
}
fn rebond(l: u32, ) -> Weight {
(44_834_000 as Weight)
.saturating_add((103_000 as Weight).saturating_mul(l as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn set_history_depth(e: u32) -> Weight {
(0 as Weight)
.saturating_add((36_641_000 as Weight).saturating_mul(e as Weight))
Expand Down
6 changes: 4 additions & 2 deletions runtime/darwinia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ homepage = "https://darwinia.network/"
license = "GPL-3.0"
name = "darwinia-runtime"
repository = "https://github.com/darwinia-network/darwinia/"
version = "0.8.6"
version = "0.8.7"

[dependencies]
# crates
array-bytes = { version = "0.3.0" }
codec = { package = "parity-scale-codec", version = "1.3.5", default-features = false, features = ["derive"] }
serde = { version = "1.0.118", optional = true }
serde_json = { version = "1.0.61", optional = true }
smallvec = { version = "1.6.0" }
smallvec = { version = "1.6.1" }
static_assertions = { version = "1.1.0" }
# darwinia frame
darwinia-balances = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-balances-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-crab-backing = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-democracy = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-elections-phragmen = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-ethereum-backing = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
darwinia-ethereum-relay = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" }
Expand Down Expand Up @@ -95,6 +96,7 @@ std = [
"darwinia-balances/std",
"darwinia-balances-rpc-runtime-api/std",
"darwinia-crab-backing/std",
"darwinia-democracy/std",
"darwinia-elections-phragmen/std",
"darwinia-ethereum-backing/std",
"darwinia-ethereum-relay/std",
Expand Down
91 changes: 89 additions & 2 deletions runtime/darwinia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("Darwinia"),
impl_name: create_runtime_str!("Darwinia"),
authoring_version: 0,
spec_version: 12,
spec_version: 13,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
Expand Down Expand Up @@ -604,6 +604,88 @@ impl darwinia_treasury::Trait for Runtime {
type WeightInfo = weights::darwinia_treasury::WeightInfo<Runtime>;
}

parameter_types! {
pub const LaunchPeriod: BlockNumber = 28 * DAYS;
pub const VotingPeriod: BlockNumber = 28 * DAYS;
pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS;
AurevoirXavier marked this conversation as resolved.
Show resolved Hide resolved
pub const MinimumDeposit: Balance = 100 * COIN;
pub const EnactmentPeriod: BlockNumber = 28 * DAYS;
pub const CooloffPeriod: BlockNumber = 7 * DAYS;
// One milli: $10,000 / MB
pub const PreimageByteDeposit: Balance = 1 * MILLI;
pub const InstantAllowed: bool = true;
pub const MaxVotes: u32 = 100;
pub const MaxProposals: u32 = 100;
}
impl darwinia_democracy::Trait for Runtime {
type Proposal = Call;
type Event = Event;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = frame_system::EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>,
frame_system::EnsureRoot<AccountId>,
>;
/// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin = frame_system::EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
frame_system::EnsureRoot<AccountId>,
>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin = frame_system::EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>,
frame_system::EnsureRoot<AccountId>,
>;
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = frame_system::EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>,
frame_system::EnsureRoot<AccountId>,
>;
type InstantOrigin = frame_system::EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
frame_system::EnsureRoot<AccountId>,
>;
type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
EnsureRoot<AccountId>,
>;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree.
type CancelProposalOrigin = EnsureOneOf<
AccountId,
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
EnsureRoot<AccountId>,
>;
type BlacklistOrigin = EnsureRoot<AccountId>;
// Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cooloff period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type OperationalPreimageOrigin = pallet_collective::EnsureMember<AccountId, CouncilCollective>;
type Slash = Treasury;
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = weights::darwinia_democracy::WeightInfo<Runtime>;
type MaxProposals = MaxProposals;
}

parameter_types! {
pub const MinVestedTransfer: Balance = 100 * MILLI;
}
Expand Down Expand Up @@ -740,6 +822,7 @@ impl InstanceFilter<Call> for ProxyType {
Call::ElectionsPhragmen(..) |
Call::TechnicalMembership(..) |
Call::Treasury(..) |
Call::Democracy(..) |
Call::Utility(..) |
Call::Identity(..) |
Call::Society(..) |
Expand All @@ -766,7 +849,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::Council(..)
| Call::TechnicalCommittee(..)
| Call::ElectionsPhragmen(..)
| Call::Treasury(..) | Call::Utility(..)
| Call::Treasury(..) | Call::Democracy(..)
| Call::Utility(..)
),
ProxyType::Staking => matches!(c, Call::Staking(..) | Call::Utility(..)),
ProxyType::IdentityJudgement => matches!(
Expand Down Expand Up @@ -1031,6 +1115,9 @@ construct_runtime!(

// Ethereum bridge.
EthereumRelayAuthorities: darwinia_relay_authorities::<Instance0>::{Module, Call, Storage, Event<T>},

// Governance stuff; uncallable initially.
Democracy: darwinia_democracy::{Module, Call, Storage, Config, Event<T>},
}
);

Expand Down
Loading