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

Remove minimal spec #1119

Merged
merged 26 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Comment on lines -128 to -134
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast runtime isn't necessary for the ethereum client anymore, since the runtime is sped up outside of the spec.

# 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python is necessary to build lodestar.

nodePackages.pnpm
nodePackages.yarn
nodejs-18_x
nodejs_20
(yarn.override { nodejs = nodejs_20; })
Comment on lines +42 to +43
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarn comes with node 18 so we need to override it here. Lodestar 1.12.0 doesn't build with 18.16.1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw the lodestar in our repo is the forked branch https://github.com/Snowfork/lodestar/tree/snowbridge which is based on 1.14.0 with a hack to work with node 18.16.

Anyway, the hack here is necessary for working with node 20 so happy to see it.


# 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 = []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more this annoying feature...

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
Loading