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

Theo/polkadot v0.9.29 #726

Merged
merged 10 commits into from
Oct 18, 2022
1,508 changes: 786 additions & 722 deletions Cargo.lock

Large diffs are not rendered by default.

363 changes: 190 additions & 173 deletions Cargo.toml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions crates/annuity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive"
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

# Substrate dependencies
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true }

[dev-dependencies]
mocktopus = "0.7.0"
rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

Expand Down
32 changes: 16 additions & 16 deletions crates/annuity/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: EscrowRewards TotalRewards (r:1 w:1)
// Storage: Tokens Accounts (r:2 w:0)
fn withdraw_rewards() -> Weight {
(42_255_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(42_255_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Tokens Accounts (r:1 w:0)
// Storage: EscrowAnnuity RewardPerBlock (r:0 w:1)
fn update_rewards() -> Weight {
(9_601_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(9_601_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: EscrowAnnuity RewardPerWrapped (r:0 w:1)
fn set_reward_per_wrapped() -> Weight {
(3_288_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(3_288_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}

Expand All @@ -73,20 +73,20 @@ impl WeightInfo for () {
// Storage: EscrowRewards TotalRewards (r:1 w:1)
// Storage: Tokens Accounts (r:2 w:0)
fn withdraw_rewards() -> Weight {
(42_255_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(6 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
Weight::from_ref_time(42_255_000 as u64)
.saturating_add(RocksDbWeight::get().reads(6 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Tokens Accounts (r:1 w:0)
// Storage: EscrowAnnuity RewardPerBlock (r:0 w:1)
fn update_rewards() -> Weight {
(9_601_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
Weight::from_ref_time(9_601_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: EscrowAnnuity RewardPerWrapped (r:0 w:1)
fn set_reward_per_wrapped() -> Weight {
(3_288_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
Weight::from_ref_time(3_288_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
}
2 changes: 1 addition & 1 deletion crates/annuity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub mod pallet {
if let Err(e) = Self::begin_block(n) {
sp_runtime::print(e);
}
0
Weight::from_ref_time(0 as u64)
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ secp256k1 = { package = "secp256k1", git = "https://github.com/rust-bitcoin/rust
spin = { version = "0.7.1", default-features = false }

# Substrate dependencies
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

[dev-dependencies]
mocktopus = "0.7.0"
Expand Down
20 changes: 10 additions & 10 deletions crates/btc-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }

# Substrate dependencies
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false, optional = true }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

# Parachain dependencies
bitcoin = { path = "../bitcoin", default-features = false }
Expand All @@ -27,7 +27,7 @@ security = { path = "../security", default-features = false }
[dev-dependencies]
mocktopus = "0.7.0"
hex = "0.4.2"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
itertools = "0.10.0"

[features]
Expand Down
8 changes: 4 additions & 4 deletions crates/btc-relay/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
jsonrpsee = { version = "0.14.0", features = ["server", "macros"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" }
jsonrpsee = { version = "0.15.1", features = ["server", "macros"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
module-btc-relay-rpc-runtime-api = { path = "runtime-api" }
6 changes: 3 additions & 3 deletions crates/btc-relay/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }

[features]
default = ["std"]
Expand Down
48 changes: 24 additions & 24 deletions crates/btc-relay/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: BTCRelay ChainsIndex (r:0 w:1)
// Storage: BTCRelay BlockHeaders (r:0 w:1)
fn initialize() -> Weight {
(52_878_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
Weight::from_ref_time(52_878_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(8 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay BlockHeaders (r:2 w:1)
Expand All @@ -68,9 +68,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: BTCRelay BestBlock (r:0 w:1)
// Storage: BTCRelay BestBlockHeight (r:0 w:1)
fn store_block_header() -> Weight {
(68_306_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
Weight::from_ref_time(68_306_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay DisableInclusionCheck (r:1 w:0)
Expand All @@ -80,8 +80,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Security ActiveBlockCount (r:1 w:0)
// Storage: BTCRelay StableParachainConfirmations (r:1 w:0)
fn verify_and_validate_transaction() -> Weight {
(66_727_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
Weight::from_ref_time(66_727_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay DisableInclusionCheck (r:1 w:0)
Expand All @@ -91,13 +91,13 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Security ActiveBlockCount (r:1 w:0)
// Storage: BTCRelay StableParachainConfirmations (r:1 w:0)
fn verify_transaction_inclusion() -> Weight {
(38_910_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
Weight::from_ref_time(38_910_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
fn validate_transaction() -> Weight {
(11_660_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
Weight::from_ref_time(11_660_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
}

Expand All @@ -114,9 +114,9 @@ impl WeightInfo for () {
// Storage: BTCRelay ChainsIndex (r:0 w:1)
// Storage: BTCRelay BlockHeaders (r:0 w:1)
fn initialize() -> Weight {
(52_878_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
Weight::from_ref_time(52_878_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(8 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay BlockHeaders (r:2 w:1)
Expand All @@ -127,9 +127,9 @@ impl WeightInfo for () {
// Storage: BTCRelay BestBlock (r:0 w:1)
// Storage: BTCRelay BestBlockHeight (r:0 w:1)
fn store_block_header() -> Weight {
(68_306_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
Weight::from_ref_time(68_306_000 as u64)
.saturating_add(RocksDbWeight::get().reads(7 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay DisableInclusionCheck (r:1 w:0)
Expand All @@ -139,8 +139,8 @@ impl WeightInfo for () {
// Storage: Security ActiveBlockCount (r:1 w:0)
// Storage: BTCRelay StableParachainConfirmations (r:1 w:0)
fn verify_and_validate_transaction() -> Weight {
(66_727_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
Weight::from_ref_time(66_727_000 as u64)
.saturating_add(RocksDbWeight::get().reads(7 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
// Storage: BTCRelay DisableInclusionCheck (r:1 w:0)
Expand All @@ -150,13 +150,13 @@ impl WeightInfo for () {
// Storage: Security ActiveBlockCount (r:1 w:0)
// Storage: BTCRelay StableParachainConfirmations (r:1 w:0)
fn verify_transaction_inclusion() -> Weight {
(38_910_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
Weight::from_ref_time(38_910_000 as u64)
.saturating_add(RocksDbWeight::get().reads(7 as u64))
}
// Storage: Security ParachainStatus (r:1 w:0)
fn validate_transaction() -> Weight {
(11_660_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
Weight::from_ref_time(11_660_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
}

12 changes: 6 additions & 6 deletions crates/clients-info/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ pub trait WeightInfo {
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn set_current_client_release() -> Weight {
(4_130_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(4_130_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}

fn set_pending_client_release() -> Weight {
(4_130_000 as Weight)
Weight::from_ref_time(4_130_000 as u64)
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn set_current_client_release() -> Weight {
(4_130_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
Weight::from_ref_time(4_130_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}

fn set_pending_client_release() -> Weight {
(4_130_000 as Weight)
Weight::from_ref_time(4_130_000 as u64)
}
}
2 changes: 1 addition & 1 deletion crates/clients-info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub mod upgrade_client_releases {
/// For each pending client release, set the current release to that.
/// The pending release entry is removed.
pub fn try_upgrade_current_client_releases<T: Config>() -> Weight {
let mut reads: Weight = 0;
let mut reads = 0;
for (key, release) in PendingClientReleases::<T>::drain() {
log::info!("Upgrading client release for key {:?}", key);
CurrentClientReleases::<T>::insert(key, release.clone());
Expand Down
Loading