Skip to content

Commit

Permalink
Remove minimal spec (#1119)
Browse files Browse the repository at this point in the history
* start removing minimal spec

* remove minimal spec

* remove minimal spec

* update test modules

* heap allocate test structs

* fmt

* fix tests

* remove fast runtime test run

* rename fixtures

* fmt

* adds generating test data for inbound message and refresh test data

* adds generating fixture data for inbound message and clippy

* fixes for inbound queue benchmarks

* update test fixture

* format and update polkadot-sdk

* cleanup and update fork versions

* update fixtures

* fixes after merge

* more fixes

* fix lodestar setup in nix, update fixtures with deneb fork

* use fast runtime, default fast mode

* fix fixtures

* fix fixtures

* update fixtures

* fix fork versions

* update polkadot-sdk

---------

Co-authored-by: claravanstaden <Cats 4 life!>
  • Loading branch information
claravanstaden authored Jan 23, 2024
1 parent d65afb4 commit 53a5522
Show file tree
Hide file tree
Showing 66 changed files with 4,384 additions and 9,217 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/parachain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ jobs:
cargo test
--workspace
--features runtime-benchmarks
# Run tests for fast-runtime feature
- name: Tests for fast-runtime
working-directory: parachain
run: >
cargo test
--workspace
--features fast-runtime
# Run tests for all features
- name: Tests for all features
working-directory: parachain
Expand Down
5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
ps

# typescript
python3
nodePackages.pnpm
nodePackages.yarn
nodejs-18_x
nodejs_20
(yarn.override { nodejs = nodejs_20; })

# ethereum
foundry-bin
Expand Down
2 changes: 0 additions & 2 deletions parachain/pallets/ethereum-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,3 @@ try-runtime = [
"pallet-timestamp?/try-runtime",
"sp-runtime/try-runtime",
]
beacon-spec-minimal = []
fast-runtime = ["beacon-spec-minimal"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate snowbridge_pallet_ethereum_client;

use libfuzzer_sys::fuzz_target;
use snowbridge_pallet_ethereum_client::{mock::minimal::*, types::CheckpointUpdate};
use snowbridge_pallet_ethereum_client::{mock::*, types::CheckpointUpdate};
use snowbridge_ethereum_beacon_client_fuzz::types::FuzzCheckpointUpdate;
use std::convert::TryInto;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]
extern crate snowbridge_pallet_ethereum_client;

use snowbridge_pallet_ethereum_client::{mock::minimal::*, types::Update};
use snowbridge_pallet_ethereum_client::{mock::*, types::Update};
use snowbridge_ethereum_beacon_client_fuzz::types::FuzzUpdate;
use std::convert::TryInto;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate snowbridge_pallet_ethereum_client;

use snowbridge_beacon_primitives::ExecutionHeaderUpdate;
use snowbridge_pallet_ethereum_client::mock::minimal::*;
use snowbridge_pallet_ethereum_client::mock::*;
use snowbridge_pallet_ethereum_client::types::FuzzExecutionHeaderUpdate;

use libfuzzer_sys::fuzz_target;
Expand Down
1,217 changes: 1,217 additions & 0 deletions parachain/pallets/ethereum-client/src/benchmarking/fixtures.rs

Large diffs are not rendered by default.

1,215 changes: 0 additions & 1,215 deletions parachain/pallets/ethereum-client/src/benchmarking/fixtures_mainnet.rs

This file was deleted.

248 changes: 0 additions & 248 deletions parachain/pallets/ethereum-client/src/benchmarking/fixtures_minimal.rs

This file was deleted.

24 changes: 3 additions & 21 deletions parachain/pallets/ethereum-client/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
use super::*;
mod fixtures;
mod util;

use crate::Pallet as EthereumBeaconClient;
use frame_benchmarking::v2::*;
use frame_system::RawOrigin;

#[cfg(feature = "beacon-spec-minimal")]
mod fixtures_minimal;
#[cfg(feature = "beacon-spec-minimal")]
use fixtures_minimal::*;

#[cfg(not(feature = "beacon-spec-minimal"))]
mod fixtures_mainnet;
#[cfg(not(feature = "beacon-spec-minimal"))]
use fixtures_mainnet::*;
use fixtures::*;

use primitives::{
fast_aggregate_verify, prepare_aggregate_pubkey, prepare_aggregate_signature,
Expand Down Expand Up @@ -151,16 +144,5 @@ mod benchmarks {
Ok(())
}

#[cfg(feature = "beacon-spec-minimal")]
impl_benchmark_test_suite!(
EthereumBeaconClient,
crate::mock::minimal::new_tester(),
crate::mock::minimal::Test
);
#[cfg(not(feature = "beacon-spec-minimal"))]
impl_benchmark_test_suite!(
EthereumBeaconClient,
crate::mock::mainnet::new_tester(),
crate::mock::mainnet::Test
);
impl_benchmark_test_suite!(EthereumBeaconClient, crate::mock::new_tester(), crate::mock::Test);
}
10 changes: 0 additions & 10 deletions parachain/pallets/ethereum-client/src/config/mainnet.rs

This file was deleted.

10 changes: 0 additions & 10 deletions parachain/pallets/ethereum-client/src/config/minimal.rs

This file was deleted.

16 changes: 7 additions & 9 deletions parachain/pallets/ethereum-client/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
use primitives::merkle_proof::{generalized_index_length, subtree_index};
use static_assertions::const_assert;

pub mod mainnet;
pub mod minimal;

#[cfg(feature = "beacon-spec-minimal")]
pub use minimal::*;

#[cfg(not(feature = "beacon-spec-minimal"))]
pub use mainnet::*;

// Generalized Indices

// get_generalized_index(BeaconState, 'block_roots')
Expand Down Expand Up @@ -54,3 +45,10 @@ pub const PUBKEY_SIZE: usize = 48;
pub const SIGNATURE_SIZE: usize = 96;

const_assert!(SYNC_COMMITTEE_BITS_SIZE == SYNC_COMMITTEE_SIZE / 8);

pub const SLOTS_PER_EPOCH: usize = 32;
pub const EPOCHS_PER_SYNC_COMMITTEE_PERIOD: usize = 256;
pub const SYNC_COMMITTEE_SIZE: usize = 512;
pub const SYNC_COMMITTEE_BITS_SIZE: usize = SYNC_COMMITTEE_SIZE / 8;
pub const SLOTS_PER_HISTORICAL_ROOT: usize = 8192;
pub const BLOCK_ROOT_AT_INDEX_DEPTH: usize = 13;
Loading

0 comments on commit 53a5522

Please sign in to comment.