diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index e4b0577dde6..6f1a9fd174e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -93,7 +93,7 @@ snowbridge-beacon-primitives = { path = "../../../../../parachain/primitives/bea snowbridge-router-primitives = { path = "../../../../../parachain/primitives/router", default-features = false } snowbridge-inbound-queue = { path = "../../../../../parachain/pallets/inbound-queue", default-features = false } snowbridge-outbound-queue = { path = "../../../../../parachain/pallets/outbound-queue", default-features = false } -snowbridge-ethereum-beacon-client = { path = "../../../../../parachain/pallets/ethereum-beacon-client", default-features = false, features=["minimal"]} +snowbridge-ethereum-beacon-client = { path = "../../../../../parachain/pallets/ethereum-beacon-client", default-features = false } [dev-dependencies] static_assertions = "1.1" @@ -229,3 +229,6 @@ try-runtime = [ "pallet-xcm/try-runtime", "parachain-info/try-runtime", ] +minimal = [ + "snowbridge-ethereum-beacon-client/minimal", +] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 7d21aa10680..b9f2392c2e4 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -579,6 +579,7 @@ impl snowbridge_outbound_queue::Config for Runtime { type WeightInfo = (); } +#[cfg(feature = "minimal")] parameter_types! { pub const MaxSyncCommitteeSize: u32 = 32; pub const MaxProofBranchSize: u32 = 20; @@ -610,6 +611,40 @@ parameter_types! { }; } +#[cfg(not(feature = "minimal"))] +parameter_types! { + pub const MaxSyncCommitteeSize: u32 = 512; + pub const MaxProofBranchSize: u32 = 20; + pub const MaxExtraDataSize: u32 = 32; + pub const MaxLogsBloomSize: u32 = 256; + pub const MaxFeeRecipientSize: u32 = 20; + pub const MaxPublicKeySize: u32 = 48; + pub const MaxSignatureSize: u32 = 96; + pub const MaxSlotsPerHistoricalRoot: u64 = 8192; + pub const MaxFinalizedHeaderSlotArray: u32 = 1000; + // accordingly to https://notes.ethereum.org/@adiasg/weak-subjectvity-eth2 + // Epochs required is 3277 as 1258368 seconds about 2 weeks + pub const WeakSubjectivityPeriodSeconds: u32 = 1258368; + pub const ChainForkVersions: ForkVersions = ForkVersions{ + genesis: Fork { + version: [0, 0, 16, 32], // 0x00001020 + epoch: 0, + }, + altair: Fork { + version: [1, 0, 16, 32], // 0x01001020 + epoch: 36660, + }, + bellatrix: Fork { + version: [2, 0, 16, 32], // 0x02001020 + epoch: 112260, + }, + capella: Fork { + version: [3, 0, 16, 32], // 0x03001020 + epoch: 162304, + }, + }; +} + impl snowbridge_ethereum_beacon_client::Config for Runtime { type RuntimeEvent = RuntimeEvent; type TimeProvider = pallet_timestamp::Pallet; @@ -730,7 +765,7 @@ mod benches { [pallet_bridge_relayers, BridgeRelayersBench::] // Ethereum Bridge //[snowbridge_basic_channel::inbound, BasicInboundChannel] - [snowbridge_outbound_queue, EthereumOutboundChannel] + // [snowbridge_outbound_queue, EthereumOutboundChannel] //[snowbridge_dispatch, Dispatch] [snowbridge_ethereum_beacon_client, EthereumBeaconClient] ); diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs index 823cdb9f35e..2fa8c874f8d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs @@ -1,41 +1,29 @@ -// Copyright Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . //! Autogenerated weights for `snowbridge_ethereum_beacon_client` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-03-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-04-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ip-172-31-4-183`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz` +//! HOSTNAME: `ip-172-31-8-124`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet +// --base-path +// /mnt/scratch/benchmark // --chain=bridge-hub-rococo-dev -// --execution=wasm -// --wasm-execution=compiled // --pallet=snowbridge_ethereum_beacon_client // --extrinsic=* -// --steps=50 -// --repeat=20 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 50 +// --repeat +// 20 +// --output +// ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_ethereum_beacon_client.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -52,7 +40,7 @@ impl snowbridge_ethereum_beacon_client::WeightInfo for /// Storage: EthereumBeaconClient LatestSyncCommitteePeriod (r:1 w:1) /// Proof: EthereumBeaconClient LatestSyncCommitteePeriod (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient SyncCommittees (r:2 w:1) - /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(1593), added: 4068, mode: MaxEncodedLen) + /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(24634), added: 27109, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient ValidatorsRoot (r:1 w:0) /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient FinalizedBeaconHeaderSlots (r:1 w:1) @@ -67,11 +55,11 @@ impl snowbridge_ethereum_beacon_client::WeightInfo for /// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn sync_committee_period_update() -> Weight { // Proof Size summary in bytes: - // Measured: `1921` - // Estimated: `26135` - // Minimum execution time: 47_657_897_000 picoseconds. - Weight::from_parts(47_722_703_000, 0) - .saturating_add(Weight::from_parts(0, 26135)) + // Measured: `24964` + // Estimated: `72217` + // Minimum execution time: 125_394_127_000 picoseconds. + Weight::from_parts(125_431_125_000, 0) + .saturating_add(Weight::from_parts(0, 72217)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -82,7 +70,7 @@ impl snowbridge_ethereum_beacon_client::WeightInfo for /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient SyncCommittees (r:1 w:0) - /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(1593), added: 4068, mode: MaxEncodedLen) + /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(24634), added: 27109, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient ValidatorsRoot (r:1 w:0) /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient FinalizedBeaconHeaderSlots (r:1 w:1) @@ -93,11 +81,11 @@ impl snowbridge_ethereum_beacon_client::WeightInfo for /// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn import_finalized_header() -> Weight { // Proof Size summary in bytes: - // Measured: `1921` - // Estimated: `20574` - // Minimum execution time: 47_461_268_000 picoseconds. - Weight::from_parts(47_502_607_000, 0) - .saturating_add(Weight::from_parts(0, 20574)) + // Measured: `24964` + // Estimated: `43615` + // Minimum execution time: 119_688_074_000 picoseconds. + Weight::from_parts(119_733_837_000, 0) + .saturating_add(Weight::from_parts(0, 43615)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -110,19 +98,54 @@ impl snowbridge_ethereum_beacon_client::WeightInfo for /// Storage: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (r:1 w:0) /// Proof: EthereumBeaconClient FinalizedBeaconHeadersBlockRoot (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient SyncCommittees (r:1 w:0) - /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(1593), added: 4068, mode: MaxEncodedLen) + /// Proof: EthereumBeaconClient SyncCommittees (max_values: None, max_size: Some(24634), added: 27109, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient ValidatorsRoot (r:1 w:0) /// Proof: EthereumBeaconClient ValidatorsRoot (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: EthereumBeaconClient ExecutionHeaders (r:0 w:1) /// Proof: EthereumBeaconClient ExecutionHeaders (max_values: None, max_size: Some(188), added: 2663, mode: MaxEncodedLen) fn import_execution_header() -> Weight { // Proof Size summary in bytes: - // Measured: `1965` - // Estimated: `14688` - // Minimum execution time: 47_535_909_000 picoseconds. - Weight::from_parts(47_607_054_000, 0) - .saturating_add(Weight::from_parts(0, 14688)) + // Measured: `25008` + // Estimated: `37729` + // Minimum execution time: 119_457_513_000 picoseconds. + Weight::from_parts(119_497_745_000, 0) + .saturating_add(Weight::from_parts(0, 37729)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) } + /// Storage: EthereumBeaconClient Blocked (r:0 w:1) + /// Proof: EthereumBeaconClient Blocked (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + fn unblock_bridge() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_651_000 picoseconds. + Weight::from_parts(13_941_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn bls_aggregate_pubkey() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 94_456_150_000 picoseconds. + Weight::from_parts(94_487_034_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn bls_verify_message() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 28_358_076_000 picoseconds. + Weight::from_parts(28_368_043_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn bls_fast_aggregate_verify() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 123_429_381_000 picoseconds. + Weight::from_parts(123_459_134_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } } diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 3f3798e3d2e..5a77d334ab1 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -127,3 +127,4 @@ try-runtime = [ "shell-runtime/try-runtime", "try-runtime-cli/try-runtime", ] +minimal = []