2019-10-22 03:35:35 +00:00
|
|
|
#![cfg(feature = "ef_tests")]
|
|
|
|
|
2023-12-05 16:19:59 +00:00
|
|
|
use ef_tests::{KzgInclusionMerkleProofValidityHandler, *};
|
|
|
|
use types::{MainnetEthSpec, MinimalEthSpec, *};
|
2019-05-14 05:08:42 +00:00
|
|
|
|
2020-06-03 03:34:01 +00:00
|
|
|
// Check that the hand-computed multiplications on EthSpec are correctly computed.
|
|
|
|
// This test lives here because one is most likely to muck these up during a spec update.
|
|
|
|
fn check_typenum_values<E: EthSpec>() {
|
|
|
|
assert_eq!(
|
|
|
|
E::MaxPendingAttestations::to_u64(),
|
|
|
|
E::MaxAttestations::to_u64() * E::SlotsPerEpoch::to_u64()
|
|
|
|
);
|
|
|
|
assert_eq!(
|
|
|
|
E::SlotsPerEth1VotingPeriod::to_u64(),
|
|
|
|
E::EpochsPerEth1VotingPeriod::to_u64() * E::SlotsPerEpoch::to_u64()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn derived_typenum_values() {
|
|
|
|
check_typenum_values::<MinimalEthSpec>();
|
|
|
|
check_typenum_values::<MainnetEthSpec>();
|
|
|
|
}
|
|
|
|
|
2019-05-23 13:22:54 +00:00
|
|
|
#[test]
|
|
|
|
fn shuffling() {
|
2021-07-09 06:15:32 +00:00
|
|
|
ShufflingHandler::<MinimalEthSpec>::default().run();
|
|
|
|
ShufflingHandler::<MainnetEthSpec>::default().run();
|
2019-05-14 05:08:42 +00:00
|
|
|
}
|
2019-05-21 00:32:14 +00:00
|
|
|
|
2019-05-22 05:34:12 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_deposit() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, Deposit>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, Deposit>::default().run();
|
2019-05-22 22:48:09 +00:00
|
|
|
}
|
|
|
|
|
2019-05-23 00:11:15 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_exit() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, SignedVoluntaryExit>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, SignedVoluntaryExit>::default().run();
|
2019-05-23 00:11:15 +00:00
|
|
|
}
|
|
|
|
|
2019-05-23 14:15:12 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_proposer_slashing() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, ProposerSlashing>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, ProposerSlashing>::default().run();
|
2019-05-23 14:15:12 +00:00
|
|
|
}
|
|
|
|
|
2019-05-24 03:57:44 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_attester_slashing() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, AttesterSlashing<_>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, AttesterSlashing<_>>::default().run();
|
2019-05-24 03:57:44 +00:00
|
|
|
}
|
|
|
|
|
2019-06-04 01:05:35 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_attestation() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, Attestation<_>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, Attestation<_>>::default().run();
|
2019-06-04 01:05:35 +00:00
|
|
|
}
|
|
|
|
|
2019-06-04 06:35:33 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_block_header() {
|
2021-07-09 06:15:32 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, BeaconBlock<_>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, BeaconBlock<_>>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn operations_sync_aggregate() {
|
|
|
|
OperationsHandler::<MinimalEthSpec, SyncAggregate<_>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, SyncAggregate<_>>::default().run();
|
2019-06-04 06:35:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-24 04:55:21 +00:00
|
|
|
#[test]
|
2022-07-30 00:22:37 +00:00
|
|
|
fn operations_execution_payload_full() {
|
2023-06-29 19:35:43 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, BeaconBlockBody<_, FullPayload<_>>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, BeaconBlockBody<_, FullPayload<_>>>::default().run();
|
2021-09-24 04:55:21 +00:00
|
|
|
}
|
|
|
|
|
2022-07-30 00:22:37 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_execution_payload_blinded() {
|
2023-06-29 19:35:43 +00:00
|
|
|
OperationsHandler::<MinimalEthSpec, BeaconBlockBody<_, BlindedPayload<_>>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, BeaconBlockBody<_, BlindedPayload<_>>>::default().run();
|
2022-07-30 00:22:37 +00:00
|
|
|
}
|
|
|
|
|
2022-11-14 19:14:31 +00:00
|
|
|
#[test]
|
|
|
|
fn operations_withdrawals() {
|
|
|
|
OperationsHandler::<MinimalEthSpec, WithdrawalsPayload<_>>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, WithdrawalsPayload<_>>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn operations_bls_to_execution_change() {
|
|
|
|
OperationsHandler::<MinimalEthSpec, SignedBlsToExecutionChange>::default().run();
|
|
|
|
OperationsHandler::<MainnetEthSpec, SignedBlsToExecutionChange>::default().run();
|
|
|
|
}
|
|
|
|
|
2019-06-04 06:35:33 +00:00
|
|
|
#[test]
|
|
|
|
fn sanity_blocks() {
|
2021-07-09 06:15:32 +00:00
|
|
|
SanityBlocksHandler::<MinimalEthSpec>::default().run();
|
|
|
|
SanityBlocksHandler::<MainnetEthSpec>::default().run();
|
2019-06-04 06:35:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sanity_slots() {
|
2021-07-09 06:15:32 +00:00
|
|
|
SanitySlotsHandler::<MinimalEthSpec>::default().run();
|
|
|
|
SanitySlotsHandler::<MainnetEthSpec>::default().run();
|
2019-06-04 06:35:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-25 05:58:35 +00:00
|
|
|
#[test]
|
|
|
|
fn random() {
|
|
|
|
RandomHandler::<MinimalEthSpec>::default().run();
|
|
|
|
RandomHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
2019-08-28 08:46:16 +00:00
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
2020-02-10 23:19:36 +00:00
|
|
|
fn bls_aggregate() {
|
2021-07-09 06:15:32 +00:00
|
|
|
BlsAggregateSigsHandler::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
2020-02-10 23:19:36 +00:00
|
|
|
fn bls_sign() {
|
2021-07-09 06:15:32 +00:00
|
|
|
BlsSignMsgHandler::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
2020-02-10 23:19:36 +00:00
|
|
|
fn bls_verify() {
|
2021-07-09 06:15:32 +00:00
|
|
|
BlsVerifyMsgHandler::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
}
|
|
|
|
|
2022-10-12 23:40:42 +00:00
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
|
|
|
fn bls_batch_verify() {
|
|
|
|
BlsBatchVerifyHandler::default().run();
|
|
|
|
}
|
|
|
|
|
2019-08-28 08:46:16 +00:00
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
2020-02-10 23:19:36 +00:00
|
|
|
fn bls_aggregate_verify() {
|
2021-07-09 06:15:32 +00:00
|
|
|
BlsAggregateVerifyHandler::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
2020-02-10 23:19:36 +00:00
|
|
|
fn bls_fast_aggregate_verify() {
|
2021-07-09 06:15:32 +00:00
|
|
|
BlsFastAggregateVerifyHandler::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
}
|
|
|
|
|
2021-09-25 05:58:35 +00:00
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
|
|
|
fn bls_eth_aggregate_pubkeys() {
|
|
|
|
BlsEthAggregatePubkeysHandler::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[cfg(not(feature = "fake_crypto"))]
|
|
|
|
fn bls_eth_fast_aggregate_verify() {
|
|
|
|
BlsEthFastAggregateVerifyHandler::default().run();
|
|
|
|
}
|
|
|
|
|
2021-07-09 06:15:32 +00:00
|
|
|
/// As for `ssz_static_test_no_run` (below), but also executes the function as a test.
|
2019-09-05 00:19:52 +00:00
|
|
|
#[cfg(feature = "fake_crypto")]
|
2019-08-28 08:46:16 +00:00
|
|
|
macro_rules! ssz_static_test {
|
2021-07-09 06:15:32 +00:00
|
|
|
($($args:tt)*) => {
|
|
|
|
ssz_static_test_no_run!(#[test] $($args)*);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Generate a function to run the SSZ static tests for a type.
|
|
|
|
///
|
|
|
|
/// Quite complex in order to support an optional #[test] attrib, generics, and the two EthSpecs.
|
|
|
|
#[cfg(feature = "fake_crypto")]
|
|
|
|
macro_rules! ssz_static_test_no_run {
|
|
|
|
// Top-level
|
|
|
|
($(#[$test:meta])? $test_name:ident, $typ:ident$(<$generics:tt>)?) => {
|
|
|
|
ssz_static_test_no_run!($(#[$test])? $test_name, SszStaticHandler, $typ$(<$generics>)?);
|
2019-08-28 08:46:16 +00:00
|
|
|
};
|
|
|
|
// Generic
|
2021-07-09 06:15:32 +00:00
|
|
|
($(#[$test:meta])? $test_name:ident, $handler:ident, $typ:ident<_>) => {
|
|
|
|
ssz_static_test_no_run!(
|
|
|
|
$(#[$test])?
|
|
|
|
$test_name,
|
|
|
|
$handler,
|
|
|
|
{
|
2019-08-28 08:46:16 +00:00
|
|
|
($typ<MinimalEthSpec>, MinimalEthSpec),
|
|
|
|
($typ<MainnetEthSpec>, MainnetEthSpec)
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
// Non-generic
|
2021-07-09 06:15:32 +00:00
|
|
|
($(#[$test:meta])? $test_name:ident, $handler:ident, $typ:ident) => {
|
|
|
|
ssz_static_test_no_run!(
|
|
|
|
$(#[$test])?
|
|
|
|
$test_name,
|
|
|
|
$handler,
|
|
|
|
{
|
2019-08-28 08:46:16 +00:00
|
|
|
($typ, MinimalEthSpec),
|
|
|
|
($typ, MainnetEthSpec)
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
// Base case
|
2021-07-09 06:15:32 +00:00
|
|
|
($(#[$test:meta])? $test_name:ident, $handler:ident, { $(($($typ:ty),+)),+ }) => {
|
|
|
|
$(#[$test])?
|
2019-08-28 08:46:16 +00:00
|
|
|
fn $test_name() {
|
|
|
|
$(
|
2021-07-09 06:15:32 +00:00
|
|
|
$handler::<$($typ),+>::default().run();
|
2019-08-28 08:46:16 +00:00
|
|
|
)+
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-09-05 00:19:52 +00:00
|
|
|
#[cfg(feature = "fake_crypto")]
|
|
|
|
mod ssz_static {
|
2021-07-09 06:15:32 +00:00
|
|
|
use ef_tests::{Handler, SszStaticHandler, SszStaticTHCHandler, SszStaticWithSpecHandler};
|
2023-03-26 15:49:16 +00:00
|
|
|
use types::blob_sidecar::BlobIdentifier;
|
2023-01-11 01:40:21 +00:00
|
|
|
use types::historical_summary::HistoricalSummary;
|
2019-09-05 00:19:52 +00:00
|
|
|
use types::*;
|
|
|
|
|
2020-10-28 22:19:38 +00:00
|
|
|
ssz_static_test!(aggregate_and_proof, AggregateAndProof<_>);
|
2020-02-10 23:19:36 +00:00
|
|
|
ssz_static_test!(attestation, Attestation<_>);
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(attestation_data, AttestationData);
|
|
|
|
ssz_static_test!(attester_slashing, AttesterSlashing<_>);
|
2021-07-09 06:15:32 +00:00
|
|
|
ssz_static_test!(beacon_block, SszStaticWithSpecHandler, BeaconBlock<_>);
|
2020-02-10 23:19:36 +00:00
|
|
|
ssz_static_test!(beacon_block_header, BeaconBlockHeader);
|
2021-07-09 06:15:32 +00:00
|
|
|
ssz_static_test!(beacon_state, SszStaticTHCHandler, BeaconState<_>);
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(checkpoint, Checkpoint);
|
|
|
|
ssz_static_test!(deposit, Deposit);
|
2020-02-10 23:19:36 +00:00
|
|
|
ssz_static_test!(deposit_data, DepositData);
|
2020-10-28 22:19:38 +00:00
|
|
|
ssz_static_test!(deposit_message, DepositMessage);
|
2021-07-09 06:15:32 +00:00
|
|
|
// NOTE: Eth1Block intentionally omitted, see: https://github.com/sigp/lighthouse/issues/1835
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(eth1_data, Eth1Data);
|
|
|
|
ssz_static_test!(fork, Fork);
|
2020-10-28 22:19:38 +00:00
|
|
|
ssz_static_test!(fork_data, ForkData);
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(historical_batch, HistoricalBatch<_>);
|
2020-02-10 23:19:36 +00:00
|
|
|
ssz_static_test!(indexed_attestation, IndexedAttestation<_>);
|
2021-07-09 06:15:32 +00:00
|
|
|
// NOTE: LightClient* intentionally omitted
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(pending_attestation, PendingAttestation<_>);
|
|
|
|
ssz_static_test!(proposer_slashing, ProposerSlashing);
|
2020-10-28 22:19:38 +00:00
|
|
|
ssz_static_test!(signed_aggregate_and_proof, SignedAggregateAndProof<_>);
|
2021-07-09 06:15:32 +00:00
|
|
|
ssz_static_test!(
|
|
|
|
signed_beacon_block,
|
|
|
|
SszStaticWithSpecHandler,
|
|
|
|
SignedBeaconBlock<_>
|
|
|
|
);
|
2020-10-28 22:19:38 +00:00
|
|
|
ssz_static_test!(signed_beacon_block_header, SignedBeaconBlockHeader);
|
|
|
|
ssz_static_test!(signed_voluntary_exit, SignedVoluntaryExit);
|
|
|
|
ssz_static_test!(signing_data, SigningData);
|
2019-09-05 00:19:52 +00:00
|
|
|
ssz_static_test!(validator, Validator);
|
2020-02-10 23:19:36 +00:00
|
|
|
ssz_static_test!(voluntary_exit, VoluntaryExit);
|
2021-07-09 06:15:32 +00:00
|
|
|
|
|
|
|
// BeaconBlockBody has no internal indicator of which fork it is for, so we test it separately.
|
|
|
|
#[test]
|
|
|
|
fn beacon_block_body() {
|
|
|
|
SszStaticHandler::<BeaconBlockBodyBase<MinimalEthSpec>, MinimalEthSpec>::base_only().run();
|
|
|
|
SszStaticHandler::<BeaconBlockBodyBase<MainnetEthSpec>, MainnetEthSpec>::base_only().run();
|
|
|
|
SszStaticHandler::<BeaconBlockBodyAltair<MinimalEthSpec>, MinimalEthSpec>::altair_only()
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<BeaconBlockBodyAltair<MainnetEthSpec>, MainnetEthSpec>::altair_only()
|
|
|
|
.run();
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<BeaconBlockBodyMerge<MinimalEthSpec>, MinimalEthSpec>::merge_only()
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<BeaconBlockBodyMerge<MainnetEthSpec>, MainnetEthSpec>::merge_only()
|
|
|
|
.run();
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<BeaconBlockBodyCapella<MinimalEthSpec>, MinimalEthSpec>::capella_only()
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<BeaconBlockBodyCapella<MainnetEthSpec>, MainnetEthSpec>::capella_only()
|
|
|
|
.run();
|
2023-03-26 15:49:16 +00:00
|
|
|
SszStaticHandler::<BeaconBlockBodyDeneb<MinimalEthSpec>, MinimalEthSpec>::deneb_only()
|
2022-11-23 23:30:45 +00:00
|
|
|
.run();
|
2023-03-26 15:49:16 +00:00
|
|
|
SszStaticHandler::<BeaconBlockBodyDeneb<MainnetEthSpec>, MainnetEthSpec>::deneb_only()
|
2022-11-23 23:30:45 +00:00
|
|
|
.run();
|
2021-07-09 06:15:32 +00:00
|
|
|
}
|
|
|
|
|
2021-09-24 04:55:21 +00:00
|
|
|
// Altair and later
|
2021-07-15 00:52:02 +00:00
|
|
|
#[test]
|
|
|
|
fn contribution_and_proof() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<ContributionAndProof<MinimalEthSpec>, MinimalEthSpec>::altair_and_later(
|
|
|
|
)
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<ContributionAndProof<MainnetEthSpec>, MainnetEthSpec>::altair_and_later(
|
|
|
|
)
|
|
|
|
.run();
|
2021-07-15 00:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn signed_contribution_and_proof() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SignedContributionAndProof<MinimalEthSpec>, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SignedContributionAndProof<MainnetEthSpec>, MainnetEthSpec>::altair_and_later().run();
|
2021-07-15 00:52:02 +00:00
|
|
|
}
|
|
|
|
|
2021-07-09 06:15:32 +00:00
|
|
|
#[test]
|
|
|
|
fn sync_aggregate() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SyncAggregate<MinimalEthSpec>, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SyncAggregate<MainnetEthSpec>, MainnetEthSpec>::altair_and_later().run();
|
2021-07-09 06:15:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sync_committee() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SyncCommittee<MinimalEthSpec>, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SyncCommittee<MainnetEthSpec>, MainnetEthSpec>::altair_and_later().run();
|
2021-07-09 06:15:32 +00:00
|
|
|
}
|
2021-07-15 00:52:02 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sync_committee_contribution() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SyncCommitteeContribution<MinimalEthSpec>, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SyncCommitteeContribution<MainnetEthSpec>, MainnetEthSpec>::altair_and_later().run();
|
2021-07-15 00:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sync_committee_message() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SyncCommitteeMessage, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SyncCommitteeMessage, MainnetEthSpec>::altair_and_later().run();
|
2021-07-15 00:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sync_aggregator_selection_data() {
|
2021-09-24 04:55:21 +00:00
|
|
|
SszStaticHandler::<SyncAggregatorSelectionData, MinimalEthSpec>::altair_and_later().run();
|
|
|
|
SszStaticHandler::<SyncAggregatorSelectionData, MainnetEthSpec>::altair_and_later().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Merge and later
|
|
|
|
#[test]
|
|
|
|
fn execution_payload() {
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadMerge<MinimalEthSpec>, MinimalEthSpec>::merge_only()
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<ExecutionPayloadMerge<MainnetEthSpec>, MainnetEthSpec>::merge_only()
|
|
|
|
.run();
|
|
|
|
SszStaticHandler::<ExecutionPayloadCapella<MinimalEthSpec>, MinimalEthSpec>::capella_only()
|
2021-09-24 04:55:21 +00:00
|
|
|
.run();
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadCapella<MainnetEthSpec>, MainnetEthSpec>::capella_only()
|
2021-09-24 04:55:21 +00:00
|
|
|
.run();
|
2023-03-26 15:49:16 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadDeneb<MinimalEthSpec>, MinimalEthSpec>::deneb_only()
|
2022-11-23 23:30:45 +00:00
|
|
|
.run();
|
2023-03-26 15:49:16 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadDeneb<MainnetEthSpec>, MainnetEthSpec>::deneb_only()
|
2022-11-23 23:30:45 +00:00
|
|
|
.run();
|
2021-09-24 04:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn execution_payload_header() {
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderMerge<MinimalEthSpec>, MinimalEthSpec>::merge_only()
|
2021-09-24 04:55:21 +00:00
|
|
|
.run();
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderMerge<MainnetEthSpec>, MainnetEthSpec>::merge_only()
|
2021-09-24 04:55:21 +00:00
|
|
|
.run();
|
2022-11-14 19:14:31 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderCapella<MinimalEthSpec>, MinimalEthSpec>
|
|
|
|
::capella_only().run();
|
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderCapella<MainnetEthSpec>, MainnetEthSpec>
|
|
|
|
::capella_only().run();
|
2023-03-26 15:49:16 +00:00
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderDeneb<MinimalEthSpec>, MinimalEthSpec>
|
|
|
|
::deneb_only().run();
|
|
|
|
SszStaticHandler::<ExecutionPayloadHeaderDeneb<MainnetEthSpec>, MainnetEthSpec>
|
|
|
|
::deneb_only().run();
|
2022-11-14 19:14:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn withdrawal() {
|
2022-11-23 23:30:45 +00:00
|
|
|
SszStaticHandler::<Withdrawal, MinimalEthSpec>::capella_and_later().run();
|
|
|
|
SszStaticHandler::<Withdrawal, MainnetEthSpec>::capella_and_later().run();
|
2022-11-14 19:14:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn bls_to_execution_change() {
|
2022-11-23 23:30:45 +00:00
|
|
|
SszStaticHandler::<BlsToExecutionChange, MinimalEthSpec>::capella_and_later().run();
|
|
|
|
SszStaticHandler::<BlsToExecutionChange, MainnetEthSpec>::capella_and_later().run();
|
2022-11-14 19:14:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn signed_bls_to_execution_change() {
|
2022-11-23 23:30:45 +00:00
|
|
|
SszStaticHandler::<SignedBlsToExecutionChange, MinimalEthSpec>::capella_and_later().run();
|
|
|
|
SszStaticHandler::<SignedBlsToExecutionChange, MainnetEthSpec>::capella_and_later().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2023-03-26 15:49:16 +00:00
|
|
|
fn blob_sidecar() {
|
|
|
|
SszStaticHandler::<BlobSidecar<MinimalEthSpec>, MinimalEthSpec>::deneb_only().run();
|
|
|
|
SszStaticHandler::<BlobSidecar<MainnetEthSpec>, MainnetEthSpec>::deneb_only().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn blob_identifier() {
|
|
|
|
SszStaticHandler::<BlobIdentifier, MinimalEthSpec>::deneb_only().run();
|
|
|
|
SszStaticHandler::<BlobIdentifier, MainnetEthSpec>::deneb_only().run();
|
2022-11-23 23:30:45 +00:00
|
|
|
}
|
|
|
|
|
2023-01-11 01:40:21 +00:00
|
|
|
#[test]
|
|
|
|
fn historical_summary() {
|
2023-01-12 16:15:33 +00:00
|
|
|
SszStaticHandler::<HistoricalSummary, MinimalEthSpec>::capella_and_later().run();
|
|
|
|
SszStaticHandler::<HistoricalSummary, MainnetEthSpec>::capella_and_later().run();
|
2023-01-11 01:40:21 +00:00
|
|
|
}
|
2019-09-05 00:19:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn ssz_generic() {
|
2021-07-09 06:15:32 +00:00
|
|
|
SszGenericHandler::<BasicVector>::default().run();
|
|
|
|
SszGenericHandler::<Bitlist>::default().run();
|
|
|
|
SszGenericHandler::<Bitvector>::default().run();
|
|
|
|
SszGenericHandler::<Boolean>::default().run();
|
|
|
|
SszGenericHandler::<Uints>::default().run();
|
|
|
|
SszGenericHandler::<Containers>::default().run();
|
2019-09-05 00:19:52 +00:00
|
|
|
}
|
2019-08-28 08:46:16 +00:00
|
|
|
|
Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8
* state_processing: epoch processing v0.8.0
* state_processing: block processing v0.8.0
* tree_hash_derive: support generics in SignedRoot
* types v0.8: update to use ssz_types
* state_processing v0.8: use ssz_types
* ssz_types: add bitwise methods and from_elem
* types: fix v0.8 FIXMEs
* ssz_types: add bitfield shift_up
* ssz_types: iterators and DerefMut for VariableList
* types,state_processing: use VariableList
* ssz_types: fix BitVector Decode impl
Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!
* types: fix test modules for v0.8 update
* types: remove slow type-level arithmetic
* state_processing: fix tests for v0.8
* op_pool: update for v0.8
* ssz_types: Bitfield difference length-independent
Allow computing the difference of two bitfields of different lengths.
* Implement compact committee support
* epoch_processing: committee & active index roots
* state_processing: genesis state builder v0.8
* state_processing: implement v0.8.1
* Further improve tree_hash
* Strip examples, tests from cached_tree_hash
* Update TreeHash, un-impl CachedTreeHash
* Update bitfield TreeHash, un-impl CachedTreeHash
* Update FixedLenVec TreeHash, unimpl CachedTreeHash
* Update update tree_hash_derive for new TreeHash
* Fix TreeHash, un-impl CachedTreeHash for ssz_types
* Remove fixed_len_vec, ssz benches
SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)
* Remove boolean_bitfield crate
* Fix fake_crypto BLS compile errors
* Update ef_tests for new v.8 type params
* Update ef_tests submodule to v0.8.1 tag
* Make fixes to support parsing ssz ef_tests
* `compact_committee...` to `compact_committees...`
* Derive more traits for `CompactCommittee`
* Flip bitfield byte-endianness
* Fix tree_hash for bitfields
* Modify CLI output for ef_tests
* Bump ssz crate version
* Update ssz_types doc comment
* Del cached tree hash tests from ssz_static tests
* Tidy SSZ dependencies
* Rename ssz_types crate to eth2_ssz_types
* validator_client: update for v0.8
* ssz_types: update union/difference for bit order swap
* beacon_node: update for v0.8, EthSpec
* types: disable cached tree hash, update min spec
* state_processing: fix slot bug in committee update
* tests: temporarily disable fork choice harness test
See #447
* committee cache: prevent out-of-bounds access
In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.
* fix bug in get_indexed_attestation and simplify
There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.
* state_proc: workaround for compact committees bug
https://github.com/ethereum/eth2.0-specs/issues/1315
* v0.8: updates to make the EF tests pass
* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
the spec.
* rustfmt
* ef_tests: add new epoch processing tests
* Integrate v0.8 into master (compiles)
* Remove unused crates, fix clippy lints
* Replace v0.6.3 tags w/ v0.8.1
* Remove old comment
* Ensure lmd ghost tests only run in release
* Update readme
2019-07-30 02:44:51 +00:00
|
|
|
#[test]
|
|
|
|
fn epoch_processing_justification_and_finalization() {
|
2021-07-09 06:15:32 +00:00
|
|
|
EpochProcessingHandler::<MinimalEthSpec, JustificationAndFinalization>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, JustificationAndFinalization>::default().run();
|
Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8
* state_processing: epoch processing v0.8.0
* state_processing: block processing v0.8.0
* tree_hash_derive: support generics in SignedRoot
* types v0.8: update to use ssz_types
* state_processing v0.8: use ssz_types
* ssz_types: add bitwise methods and from_elem
* types: fix v0.8 FIXMEs
* ssz_types: add bitfield shift_up
* ssz_types: iterators and DerefMut for VariableList
* types,state_processing: use VariableList
* ssz_types: fix BitVector Decode impl
Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!
* types: fix test modules for v0.8 update
* types: remove slow type-level arithmetic
* state_processing: fix tests for v0.8
* op_pool: update for v0.8
* ssz_types: Bitfield difference length-independent
Allow computing the difference of two bitfields of different lengths.
* Implement compact committee support
* epoch_processing: committee & active index roots
* state_processing: genesis state builder v0.8
* state_processing: implement v0.8.1
* Further improve tree_hash
* Strip examples, tests from cached_tree_hash
* Update TreeHash, un-impl CachedTreeHash
* Update bitfield TreeHash, un-impl CachedTreeHash
* Update FixedLenVec TreeHash, unimpl CachedTreeHash
* Update update tree_hash_derive for new TreeHash
* Fix TreeHash, un-impl CachedTreeHash for ssz_types
* Remove fixed_len_vec, ssz benches
SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)
* Remove boolean_bitfield crate
* Fix fake_crypto BLS compile errors
* Update ef_tests for new v.8 type params
* Update ef_tests submodule to v0.8.1 tag
* Make fixes to support parsing ssz ef_tests
* `compact_committee...` to `compact_committees...`
* Derive more traits for `CompactCommittee`
* Flip bitfield byte-endianness
* Fix tree_hash for bitfields
* Modify CLI output for ef_tests
* Bump ssz crate version
* Update ssz_types doc comment
* Del cached tree hash tests from ssz_static tests
* Tidy SSZ dependencies
* Rename ssz_types crate to eth2_ssz_types
* validator_client: update for v0.8
* ssz_types: update union/difference for bit order swap
* beacon_node: update for v0.8, EthSpec
* types: disable cached tree hash, update min spec
* state_processing: fix slot bug in committee update
* tests: temporarily disable fork choice harness test
See #447
* committee cache: prevent out-of-bounds access
In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.
* fix bug in get_indexed_attestation and simplify
There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.
* state_proc: workaround for compact committees bug
https://github.com/ethereum/eth2.0-specs/issues/1315
* v0.8: updates to make the EF tests pass
* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
the spec.
* rustfmt
* ef_tests: add new epoch processing tests
* Integrate v0.8 into master (compiles)
* Remove unused crates, fix clippy lints
* Replace v0.6.3 tags w/ v0.8.1
* Remove old comment
* Ensure lmd ghost tests only run in release
* Update readme
2019-07-30 02:44:51 +00:00
|
|
|
}
|
|
|
|
|
2019-05-28 06:03:26 +00:00
|
|
|
#[test]
|
2019-11-21 00:47:30 +00:00
|
|
|
fn epoch_processing_rewards_and_penalties() {
|
2021-07-09 06:15:32 +00:00
|
|
|
EpochProcessingHandler::<MinimalEthSpec, RewardsAndPenalties>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, RewardsAndPenalties>::default().run();
|
2019-05-28 06:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_registry_updates() {
|
2021-07-09 06:15:32 +00:00
|
|
|
EpochProcessingHandler::<MinimalEthSpec, RegistryUpdates>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, RegistryUpdates>::default().run();
|
2019-05-28 06:03:26 +00:00
|
|
|
}
|
Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8
* state_processing: epoch processing v0.8.0
* state_processing: block processing v0.8.0
* tree_hash_derive: support generics in SignedRoot
* types v0.8: update to use ssz_types
* state_processing v0.8: use ssz_types
* ssz_types: add bitwise methods and from_elem
* types: fix v0.8 FIXMEs
* ssz_types: add bitfield shift_up
* ssz_types: iterators and DerefMut for VariableList
* types,state_processing: use VariableList
* ssz_types: fix BitVector Decode impl
Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!
* types: fix test modules for v0.8 update
* types: remove slow type-level arithmetic
* state_processing: fix tests for v0.8
* op_pool: update for v0.8
* ssz_types: Bitfield difference length-independent
Allow computing the difference of two bitfields of different lengths.
* Implement compact committee support
* epoch_processing: committee & active index roots
* state_processing: genesis state builder v0.8
* state_processing: implement v0.8.1
* Further improve tree_hash
* Strip examples, tests from cached_tree_hash
* Update TreeHash, un-impl CachedTreeHash
* Update bitfield TreeHash, un-impl CachedTreeHash
* Update FixedLenVec TreeHash, unimpl CachedTreeHash
* Update update tree_hash_derive for new TreeHash
* Fix TreeHash, un-impl CachedTreeHash for ssz_types
* Remove fixed_len_vec, ssz benches
SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)
* Remove boolean_bitfield crate
* Fix fake_crypto BLS compile errors
* Update ef_tests for new v.8 type params
* Update ef_tests submodule to v0.8.1 tag
* Make fixes to support parsing ssz ef_tests
* `compact_committee...` to `compact_committees...`
* Derive more traits for `CompactCommittee`
* Flip bitfield byte-endianness
* Fix tree_hash for bitfields
* Modify CLI output for ef_tests
* Bump ssz crate version
* Update ssz_types doc comment
* Del cached tree hash tests from ssz_static tests
* Tidy SSZ dependencies
* Rename ssz_types crate to eth2_ssz_types
* validator_client: update for v0.8
* ssz_types: update union/difference for bit order swap
* beacon_node: update for v0.8, EthSpec
* types: disable cached tree hash, update min spec
* state_processing: fix slot bug in committee update
* tests: temporarily disable fork choice harness test
See #447
* committee cache: prevent out-of-bounds access
In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.
* fix bug in get_indexed_attestation and simplify
There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.
* state_proc: workaround for compact committees bug
https://github.com/ethereum/eth2.0-specs/issues/1315
* v0.8: updates to make the EF tests pass
* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
the spec.
* rustfmt
* ef_tests: add new epoch processing tests
* Integrate v0.8 into master (compiles)
* Remove unused crates, fix clippy lints
* Replace v0.6.3 tags w/ v0.8.1
* Remove old comment
* Ensure lmd ghost tests only run in release
* Update readme
2019-07-30 02:44:51 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_slashings() {
|
2021-07-09 06:15:32 +00:00
|
|
|
EpochProcessingHandler::<MinimalEthSpec, Slashings>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, Slashings>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_eth1_data_reset() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, Eth1DataReset>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, Eth1DataReset>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_effective_balance_updates() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, EffectiveBalanceUpdates>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, EffectiveBalanceUpdates>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_slashings_reset() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, SlashingsReset>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, SlashingsReset>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_randao_mixes_reset() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, RandaoMixesReset>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, RandaoMixesReset>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_historical_roots_update() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, HistoricalRootsUpdate>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, HistoricalRootsUpdate>::default().run();
|
|
|
|
}
|
|
|
|
|
2023-01-11 01:40:21 +00:00
|
|
|
#[test]
|
|
|
|
fn epoch_processing_historical_summaries_update() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, HistoricalSummariesUpdate>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, HistoricalSummariesUpdate>::default().run();
|
|
|
|
}
|
|
|
|
|
2021-07-09 06:15:32 +00:00
|
|
|
#[test]
|
|
|
|
fn epoch_processing_participation_record_updates() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, ParticipationRecordUpdates>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, ParticipationRecordUpdates>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_sync_committee_updates() {
|
2022-07-28 09:43:41 +00:00
|
|
|
// There are presently no mainnet tests, see:
|
|
|
|
// https://github.com/ethereum/consensus-spec-tests/issues/29
|
2021-07-09 06:15:32 +00:00
|
|
|
EpochProcessingHandler::<MinimalEthSpec, SyncCommitteeUpdates>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_inactivity_updates() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, InactivityUpdates>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, InactivityUpdates>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn epoch_processing_participation_flag_updates() {
|
|
|
|
EpochProcessingHandler::<MinimalEthSpec, ParticipationFlagUpdates>::default().run();
|
|
|
|
EpochProcessingHandler::<MainnetEthSpec, ParticipationFlagUpdates>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fork_upgrade() {
|
|
|
|
ForkHandler::<MinimalEthSpec>::default().run();
|
|
|
|
ForkHandler::<MainnetEthSpec>::default().run();
|
Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8
* state_processing: epoch processing v0.8.0
* state_processing: block processing v0.8.0
* tree_hash_derive: support generics in SignedRoot
* types v0.8: update to use ssz_types
* state_processing v0.8: use ssz_types
* ssz_types: add bitwise methods and from_elem
* types: fix v0.8 FIXMEs
* ssz_types: add bitfield shift_up
* ssz_types: iterators and DerefMut for VariableList
* types,state_processing: use VariableList
* ssz_types: fix BitVector Decode impl
Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!
* types: fix test modules for v0.8 update
* types: remove slow type-level arithmetic
* state_processing: fix tests for v0.8
* op_pool: update for v0.8
* ssz_types: Bitfield difference length-independent
Allow computing the difference of two bitfields of different lengths.
* Implement compact committee support
* epoch_processing: committee & active index roots
* state_processing: genesis state builder v0.8
* state_processing: implement v0.8.1
* Further improve tree_hash
* Strip examples, tests from cached_tree_hash
* Update TreeHash, un-impl CachedTreeHash
* Update bitfield TreeHash, un-impl CachedTreeHash
* Update FixedLenVec TreeHash, unimpl CachedTreeHash
* Update update tree_hash_derive for new TreeHash
* Fix TreeHash, un-impl CachedTreeHash for ssz_types
* Remove fixed_len_vec, ssz benches
SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)
* Remove boolean_bitfield crate
* Fix fake_crypto BLS compile errors
* Update ef_tests for new v.8 type params
* Update ef_tests submodule to v0.8.1 tag
* Make fixes to support parsing ssz ef_tests
* `compact_committee...` to `compact_committees...`
* Derive more traits for `CompactCommittee`
* Flip bitfield byte-endianness
* Fix tree_hash for bitfields
* Modify CLI output for ef_tests
* Bump ssz crate version
* Update ssz_types doc comment
* Del cached tree hash tests from ssz_static tests
* Tidy SSZ dependencies
* Rename ssz_types crate to eth2_ssz_types
* validator_client: update for v0.8
* ssz_types: update union/difference for bit order swap
* beacon_node: update for v0.8, EthSpec
* types: disable cached tree hash, update min spec
* state_processing: fix slot bug in committee update
* tests: temporarily disable fork choice harness test
See #447
* committee cache: prevent out-of-bounds access
In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.
* fix bug in get_indexed_attestation and simplify
There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.
* state_proc: workaround for compact committees bug
https://github.com/ethereum/eth2.0-specs/issues/1315
* v0.8: updates to make the EF tests pass
* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
the spec.
* rustfmt
* ef_tests: add new epoch processing tests
* Integrate v0.8 into master (compiles)
* Remove unused crates, fix clippy lints
* Replace v0.6.3 tags w/ v0.8.1
* Remove old comment
* Ensure lmd ghost tests only run in release
* Update readme
2019-07-30 02:44:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2021-07-09 06:15:32 +00:00
|
|
|
fn transition() {
|
|
|
|
TransitionHandler::<MinimalEthSpec>::default().run();
|
|
|
|
TransitionHandler::<MainnetEthSpec>::default().run();
|
2020-07-26 23:19:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn finality() {
|
2021-07-09 06:15:32 +00:00
|
|
|
FinalityHandler::<MinimalEthSpec>::default().run();
|
|
|
|
FinalityHandler::<MainnetEthSpec>::default().run();
|
Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8
* state_processing: epoch processing v0.8.0
* state_processing: block processing v0.8.0
* tree_hash_derive: support generics in SignedRoot
* types v0.8: update to use ssz_types
* state_processing v0.8: use ssz_types
* ssz_types: add bitwise methods and from_elem
* types: fix v0.8 FIXMEs
* ssz_types: add bitfield shift_up
* ssz_types: iterators and DerefMut for VariableList
* types,state_processing: use VariableList
* ssz_types: fix BitVector Decode impl
Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!
* types: fix test modules for v0.8 update
* types: remove slow type-level arithmetic
* state_processing: fix tests for v0.8
* op_pool: update for v0.8
* ssz_types: Bitfield difference length-independent
Allow computing the difference of two bitfields of different lengths.
* Implement compact committee support
* epoch_processing: committee & active index roots
* state_processing: genesis state builder v0.8
* state_processing: implement v0.8.1
* Further improve tree_hash
* Strip examples, tests from cached_tree_hash
* Update TreeHash, un-impl CachedTreeHash
* Update bitfield TreeHash, un-impl CachedTreeHash
* Update FixedLenVec TreeHash, unimpl CachedTreeHash
* Update update tree_hash_derive for new TreeHash
* Fix TreeHash, un-impl CachedTreeHash for ssz_types
* Remove fixed_len_vec, ssz benches
SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)
* Remove boolean_bitfield crate
* Fix fake_crypto BLS compile errors
* Update ef_tests for new v.8 type params
* Update ef_tests submodule to v0.8.1 tag
* Make fixes to support parsing ssz ef_tests
* `compact_committee...` to `compact_committees...`
* Derive more traits for `CompactCommittee`
* Flip bitfield byte-endianness
* Fix tree_hash for bitfields
* Modify CLI output for ef_tests
* Bump ssz crate version
* Update ssz_types doc comment
* Del cached tree hash tests from ssz_static tests
* Tidy SSZ dependencies
* Rename ssz_types crate to eth2_ssz_types
* validator_client: update for v0.8
* ssz_types: update union/difference for bit order swap
* beacon_node: update for v0.8, EthSpec
* types: disable cached tree hash, update min spec
* state_processing: fix slot bug in committee update
* tests: temporarily disable fork choice harness test
See #447
* committee cache: prevent out-of-bounds access
In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.
* fix bug in get_indexed_attestation and simplify
There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.
* state_proc: workaround for compact committees bug
https://github.com/ethereum/eth2.0-specs/issues/1315
* v0.8: updates to make the EF tests pass
* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
the spec.
* rustfmt
* ef_tests: add new epoch processing tests
* Integrate v0.8 into master (compiles)
* Remove unused crates, fix clippy lints
* Replace v0.6.3 tags w/ v0.8.1
* Remove old comment
* Ensure lmd ghost tests only run in release
* Update readme
2019-07-30 02:44:51 +00:00
|
|
|
}
|
2019-07-30 07:02:38 +00:00
|
|
|
|
2021-11-08 07:29:04 +00:00
|
|
|
#[test]
|
|
|
|
fn fork_choice_get_head() {
|
2022-01-19 00:24:19 +00:00
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("get_head").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("get_head").run();
|
2021-11-08 07:29:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fork_choice_on_block() {
|
2022-01-19 00:24:19 +00:00
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("on_block").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("on_block").run();
|
2021-11-08 07:29:04 +00:00
|
|
|
}
|
|
|
|
|
2021-11-17 00:45:30 +00:00
|
|
|
#[test]
|
|
|
|
fn fork_choice_on_merge_block() {
|
2022-01-19 00:24:19 +00:00
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("on_merge_block").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("on_merge_block").run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fork_choice_ex_ante() {
|
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("ex_ante").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("ex_ante").run();
|
2021-11-17 00:45:30 +00:00
|
|
|
}
|
|
|
|
|
2023-03-21 07:34:41 +00:00
|
|
|
#[test]
|
|
|
|
fn fork_choice_reorg() {
|
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("reorg").run();
|
|
|
|
// There is no mainnet variant for this test.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fork_choice_withholding() {
|
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("withholding").run();
|
|
|
|
// There is no mainnet variant for this test.
|
|
|
|
}
|
|
|
|
|
2023-12-05 16:19:59 +00:00
|
|
|
#[test]
|
|
|
|
fn fork_choice_should_override_forkchoice_update() {
|
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("should_override_forkchoice_update").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("should_override_forkchoice_update").run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn fork_choice_get_proposer_head() {
|
|
|
|
ForkChoiceHandler::<MinimalEthSpec>::new("get_proposer_head").run();
|
|
|
|
ForkChoiceHandler::<MainnetEthSpec>::new("get_proposer_head").run();
|
|
|
|
}
|
|
|
|
|
2022-10-15 22:25:52 +00:00
|
|
|
#[test]
|
|
|
|
fn optimistic_sync() {
|
|
|
|
OptimisticSyncHandler::<MinimalEthSpec>::default().run();
|
|
|
|
OptimisticSyncHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
2019-07-30 07:02:38 +00:00
|
|
|
#[test]
|
|
|
|
fn genesis_initialization() {
|
2021-07-09 06:15:32 +00:00
|
|
|
GenesisInitializationHandler::<MinimalEthSpec>::default().run();
|
2019-07-30 07:02:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn genesis_validity() {
|
2021-07-09 06:15:32 +00:00
|
|
|
GenesisValidityHandler::<MinimalEthSpec>::default().run();
|
2019-08-30 06:16:38 +00:00
|
|
|
// Note: there are no genesis validity tests for mainnet
|
2019-07-30 07:02:38 +00:00
|
|
|
}
|
2021-07-09 06:15:32 +00:00
|
|
|
|
2023-05-08 19:58:23 +00:00
|
|
|
#[test]
|
|
|
|
fn kzg_blob_to_kzg_commitment() {
|
|
|
|
KZGBlobToKZGCommitmentHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn kzg_compute_blob_kzg_proof() {
|
|
|
|
KZGComputeBlobKZGProofHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn kzg_compute_kzg_proof() {
|
|
|
|
KZGComputeKZGProofHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn kzg_verify_blob_kzg_proof() {
|
|
|
|
KZGVerifyBlobKZGProofHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn kzg_verify_blob_kzg_proof_batch() {
|
|
|
|
KZGVerifyBlobKZGProofBatchHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn kzg_verify_kzg_proof() {
|
|
|
|
KZGVerifyKZGProofHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
2022-11-08 01:58:18 +00:00
|
|
|
#[test]
|
|
|
|
fn merkle_proof_validity() {
|
|
|
|
MerkleProofValidityHandler::<MainnetEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
2023-12-05 16:19:59 +00:00
|
|
|
#[test]
|
|
|
|
fn kzg_inclusion_merkle_proof_validity() {
|
|
|
|
KzgInclusionMerkleProofValidityHandler::<MainnetEthSpec>::default().run();
|
|
|
|
KzgInclusionMerkleProofValidityHandler::<MinimalEthSpec>::default().run();
|
|
|
|
}
|
|
|
|
|
2021-07-09 06:15:32 +00:00
|
|
|
#[test]
|
|
|
|
fn rewards() {
|
|
|
|
for handler in &["basic", "leak", "random"] {
|
|
|
|
RewardsHandler::<MinimalEthSpec>::new(handler).run();
|
|
|
|
RewardsHandler::<MainnetEthSpec>::new(handler).run();
|
|
|
|
}
|
|
|
|
}
|