Add Fulu boilerplate (#6695)

* Add Fulu boilerplate

* Add more boilerplate

* Change fulu_time to osaka_time

* Merge branch 'unstable' into fulu-boilerplate

* Fix tests

* Merge branch 'unstable' into fulu-boilerplate

* More test fixes

* Apply suggestions

* Remove `get_payload` boilerplate

* Add lightclient fulu types and fix beacon-chain-tests

* Disable Fulu in ef-tests

* Reduce boilerplate for future forks

* Small fixes

* One more fix

* Apply suggestions

* Merge branch 'unstable' into fulu-boilerplate

* Fix lints
This commit is contained in:
Mac L
2025-01-10 09:25:23 +04:00
committed by GitHub
parent 722573f7ed
commit ecdf2d891f
91 changed files with 2365 additions and 674 deletions

View File

@@ -1239,14 +1239,11 @@ mod release_tests {
let stats = op_pool.attestation_stats();
let fork_name = state.fork_name_unchecked();
match fork_name {
ForkName::Electra => {
assert_eq!(stats.num_attestation_data, 1);
}
_ => {
assert_eq!(stats.num_attestation_data, committees.len());
}
};
if fork_name.electra_enabled() {
assert_eq!(stats.num_attestation_data, 1);
} else {
assert_eq!(stats.num_attestation_data, committees.len());
}
assert_eq!(
stats.num_attestations,
@@ -1258,25 +1255,19 @@ mod release_tests {
let best_attestations = op_pool
.get_attestations(&state, |_| true, |_| true, spec)
.expect("should have best attestations");
match fork_name {
ForkName::Electra => {
assert_eq!(best_attestations.len(), 8);
}
_ => {
assert_eq!(best_attestations.len(), max_attestations);
}
};
if fork_name.electra_enabled() {
assert_eq!(best_attestations.len(), 8);
} else {
assert_eq!(best_attestations.len(), max_attestations);
}
// All the best attestations should be signed by at least `big_step_size` (4) validators.
for att in &best_attestations {
match fork_name {
ForkName::Electra => {
assert!(att.num_set_aggregation_bits() >= small_step_size);
}
_ => {
assert!(att.num_set_aggregation_bits() >= big_step_size);
}
};
if fork_name.electra_enabled() {
assert!(att.num_set_aggregation_bits() >= small_step_size);
} else {
assert!(att.num_set_aggregation_bits() >= big_step_size);
}
}
}
@@ -1357,17 +1348,14 @@ mod release_tests {
let num_big = target_committee_size / big_step_size;
let fork_name = state.fork_name_unchecked();
match fork_name {
ForkName::Electra => {
assert_eq!(op_pool.attestation_stats().num_attestation_data, 1);
}
_ => {
assert_eq!(
op_pool.attestation_stats().num_attestation_data,
committees.len()
);
}
};
if fork_name.electra_enabled() {
assert_eq!(op_pool.attestation_stats().num_attestation_data, 1);
} else {
assert_eq!(
op_pool.attestation_stats().num_attestation_data,
committees.len()
);
}
assert_eq!(
op_pool.num_attestations(),
@@ -1380,14 +1368,11 @@ mod release_tests {
.get_attestations(&state, |_| true, |_| true, spec)
.expect("should have valid best attestations");
match fork_name {
ForkName::Electra => {
assert_eq!(best_attestations.len(), 8);
}
_ => {
assert_eq!(best_attestations.len(), max_attestations);
}
};
if fork_name.electra_enabled() {
assert_eq!(best_attestations.len(), 8);
} else {
assert_eq!(best_attestations.len(), max_attestations);
}
let total_active_balance = state.get_total_active_balance().unwrap();