EIP-7916: ProgressiveList and tests

This commit is contained in:
Michael Sproul
2025-12-01 12:23:39 +11:00
parent 7cee5d6090
commit 86f8c2e642
8 changed files with 25 additions and 6 deletions

3
Cargo.lock generated
View File

@@ -5859,8 +5859,7 @@ dependencies = [
[[package]]
name = "milhouse"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "259dd9da2ae5e0278b95da0b7ecef9c18c309d0a2d9e6db57ed33b9e8910c5e7"
source = "git+https://github.com/sigp/milhouse?branch=progressive-list#52bae1f50da93519cfb4ec31f7dab19659be4d14"
dependencies = [
"alloy-primitives",
"arbitrary",

View File

@@ -285,3 +285,6 @@ debug = true
[patch.crates-io]
quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" }
# FIXME(sproul): REMOVE patch
# milhouse = { path = "../milhouse" }
milhouse = { git = "https://github.com/sigp/milhouse", branch = "progressive-list" }

View File

@@ -293,6 +293,6 @@ pub use bls::{
};
pub use context_deserialize::{ContextDeserialize, context_deserialize};
pub use kzg::{KzgCommitment, KzgProof, VERSIONED_HASH_VERSION_KZG};
pub use milhouse::{self, List, Vector};
pub use milhouse::{self, List, ProgressiveList, Vector};
pub use ssz_types::{BitList, BitVector, FixedVector, VariableList, typenum, typenum::Unsigned};
pub use superstruct::superstruct;

View File

@@ -1,6 +1,6 @@
# To download/extract nightly tests, run:
# CONSENSUS_SPECS_TEST_VERSION=nightly make
CONSENSUS_SPECS_TEST_VERSION ?= v1.6.0-beta.1
CONSENSUS_SPECS_TEST_VERSION ?= v1.6.1
REPO_NAME := consensus-spec-tests
OUTPUT_DIR := ./$(REPO_NAME)

View File

@@ -51,7 +51,6 @@ excluded_paths = [
"tests/.*/fulu/ssz_static/MatrixEntry/.*",
# EIP-7916 is still in draft and hasn't been implemented yet https://eips.ethereum.org/EIPS/eip-7916
"tests/general/phase0/ssz_generic/progressive_bitlist",
"tests/general/phase0/ssz_generic/basic_progressive_list",
"tests/general/phase0/ssz_generic/containers/.*/ProgressiveBitsStruct.*",
"tests/general/phase0/ssz_generic/containers/.*/ProgressiveTestStruct.*",
"tests/general/phase0/ssz_generic/progressive_containers/.*",

View File

@@ -10,7 +10,7 @@ use ssz_derive::{Decode, Encode};
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
use types::typenum::*;
use types::{BitList, BitVector, FixedVector, ForkName, VariableList, Vector};
use types::{BitList, BitVector, FixedVector, ForkName, ProgressiveList, VariableList, Vector};
#[derive(Debug, Clone, Deserialize)]
#[context_deserialize(ForkName)]
@@ -157,6 +157,17 @@ impl Case for SszGeneric {
[length => typenum]
)?;
}
"basic_progressive_list" => {
let elem_ty = parts[1];
type_dispatch!(
ssz_generic_test,
(&self.path, fork_name),
ProgressiveList,
<>,
[elem_ty => primitive_type]
)?;
}
"bitlist" => {
let mut limit = parts[1];

View File

@@ -1135,6 +1135,8 @@ impl<H: TypeName> Handler for SszGenericHandler<H> {
// Supported SSZ generic handlers
pub struct BasicVector;
type_name!(BasicVector, "basic_vector");
pub struct BasicProgressiveList;
type_name!(BasicProgressiveList, "basic_progressive_list");
pub struct Bitlist;
type_name!(Bitlist, "bitlist");
pub struct Bitvector;

View File

@@ -733,6 +733,11 @@ fn ssz_generic() {
SszGenericHandler::<Containers>::default().run();
}
#[test]
fn ssz_generic_progressive() {
SszGenericHandler::<BasicProgressiveList>::default().run();
}
#[test]
fn epoch_processing_justification_and_finalization() {
EpochProcessingHandler::<MinimalEthSpec, JustificationAndFinalization>::default().run();