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

benchmark beacon bridge #14

Merged
merged 13 commits into from
Apr 18, 2023
5 changes: 4 additions & 1 deletion parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -229,3 +229,6 @@ try-runtime = [
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
minimal = [
"snowbridge-ethereum-beacon-client/minimal",
]
39 changes: 37 additions & 2 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Runtime>;
Expand All @@ -624,7 +659,7 @@ impl snowbridge_ethereum_beacon_client::Config for Runtime {
type MaxFinalizedHeaderSlotArray = MaxFinalizedHeaderSlotArray;
type ForkVersions = ChainForkVersions;
type WeakSubjectivityPeriodSeconds = WeakSubjectivityPeriodSeconds;
type WeightInfo = weights::snowbridge_ethereum_beacon_client::WeightInfo<Runtime>;
type WeightInfo = ();
yrong marked this conversation as resolved.
Show resolved Hide resolved
}

// Create the runtime by composing the FRAME pallets that were previously configured.
Expand Down Expand Up @@ -730,7 +765,7 @@ mod benches {
[pallet_bridge_relayers, BridgeRelayersBench::<Runtime>]
// Ethereum Bridge
//[snowbridge_basic_channel::inbound, BasicInboundChannel]
[snowbridge_outbound_queue, EthereumOutboundChannel]
// [snowbridge_outbound_queue, EthereumOutboundChannel]
//[snowbridge_dispatch, Dispatch]
[snowbridge_ethereum_beacon_client, EthereumBeaconClient]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub mod pallet_utility;
pub mod pallet_xcm;
pub mod paritydb_weights;
pub mod rocksdb_weights;
pub mod snowbridge_ethereum_beacon_client;
pub mod xcm;

pub use block_weights::constants::BlockExecutionWeight;
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ try-runtime = [
"shell-runtime/try-runtime",
"try-runtime-cli/try-runtime",
]
minimal = []