mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 13:17:09 +00:00
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-data-availability-checker
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::{Address, Epoch};
|
use crate::{Address, Epoch, ForkName};
|
||||||
use bls::PublicKeyBytes;
|
use bls::PublicKeyBytes;
|
||||||
|
use context_deserialize::context_deserialize;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use test_random_derive::TestRandom;
|
use test_random_derive::TestRandom;
|
||||||
@@ -12,6 +13,7 @@ pub type BuilderIndex = u64;
|
|||||||
#[derive(
|
#[derive(
|
||||||
Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TestRandom, TreeHash,
|
Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TestRandom, TreeHash,
|
||||||
)]
|
)]
|
||||||
|
#[context_deserialize(ForkName)]
|
||||||
pub struct Builder {
|
pub struct Builder {
|
||||||
pub pubkey: PublicKeyBytes,
|
pub pubkey: PublicKeyBytes,
|
||||||
#[serde(with = "serde_utils::quoted_u8")]
|
#[serde(with = "serde_utils::quoted_u8")]
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::{
|
use crate::{
|
||||||
ChainSpec, Domain, Epoch, EthSpec, ExecutionBlockHash, ExecutionPayloadEnvelope, Fork, Hash256,
|
ChainSpec, Domain, Epoch, EthSpec, ExecutionBlockHash, ExecutionPayloadEnvelope, Fork,
|
||||||
SignedRoot, Slot,
|
ForkName, Hash256, SignedRoot, Slot,
|
||||||
};
|
};
|
||||||
use bls::{PublicKey, Signature};
|
use bls::{PublicKey, Signature};
|
||||||
|
use context_deserialize::context_deserialize;
|
||||||
use educe::Educe;
|
use educe::Educe;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
@@ -13,6 +14,7 @@ use tree_hash_derive::TreeHash;
|
|||||||
#[derive(Debug, Clone, Serialize, Encode, Decode, Deserialize, TestRandom, TreeHash, Educe)]
|
#[derive(Debug, Clone, Serialize, Encode, Decode, Deserialize, TestRandom, TreeHash, Educe)]
|
||||||
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
|
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
|
||||||
#[serde(bound = "E: EthSpec")]
|
#[serde(bound = "E: EthSpec")]
|
||||||
|
#[context_deserialize(ForkName)]
|
||||||
pub struct SignedExecutionPayloadEnvelope<E: EthSpec> {
|
pub struct SignedExecutionPayloadEnvelope<E: EthSpec> {
|
||||||
pub message: ExecutionPayloadEnvelope<E>,
|
pub message: ExecutionPayloadEnvelope<E>,
|
||||||
pub signature: Signature,
|
pub signature: Signature,
|
||||||
|
|||||||
@@ -47,8 +47,38 @@ excluded_paths = [
|
|||||||
"bls12-381-tests/hash_to_G2",
|
"bls12-381-tests/hash_to_G2",
|
||||||
"tests/.*/eip7732",
|
"tests/.*/eip7732",
|
||||||
"tests/.*/eip7805",
|
"tests/.*/eip7805",
|
||||||
|
# TODO(gloas): remove these ignores as more Gloas operations are implemented
|
||||||
|
"tests/.*/gloas/operations/attestation/.*",
|
||||||
|
"tests/.*/gloas/operations/attester_slashing/.*",
|
||||||
|
"tests/.*/gloas/operations/block_header/.*",
|
||||||
|
"tests/.*/gloas/operations/bls_to_execution_change/.*",
|
||||||
|
"tests/.*/gloas/operations/consolidation_request/.*",
|
||||||
|
"tests/.*/gloas/operations/deposit/.*",
|
||||||
|
"tests/.*/gloas/operations/deposit_request/.*",
|
||||||
|
"tests/.*/gloas/operations/execution_payload/.*",
|
||||||
|
"tests/.*/gloas/operations/execution_payload_bid/.*",
|
||||||
|
"tests/.*/gloas/operations/payload_attestation/.*",
|
||||||
|
"tests/.*/gloas/operations/proposer_slashing/.*",
|
||||||
|
"tests/.*/gloas/operations/sync_aggregate/.*",
|
||||||
|
"tests/.*/gloas/operations/voluntary_exit/.*",
|
||||||
|
"tests/.*/gloas/operations/withdrawal_request/.*",
|
||||||
|
# TODO(EIP-7732): remove these ignores as Gloas consensus is implemented
|
||||||
|
"tests/.*/gloas/epoch_processing/.*",
|
||||||
|
"tests/.*/gloas/finality/.*",
|
||||||
|
"tests/.*/gloas/fork/.*",
|
||||||
|
"tests/.*/gloas/fork_choice/.*",
|
||||||
|
"tests/.*/gloas/networking/.*",
|
||||||
|
"tests/.*/gloas/rewards/.*",
|
||||||
|
"tests/.*/gloas/sanity/.*",
|
||||||
|
"tests/.*/gloas/transition/.*",
|
||||||
# Ignore MatrixEntry SSZ tests for now.
|
# Ignore MatrixEntry SSZ tests for now.
|
||||||
"tests/.*/fulu/ssz_static/MatrixEntry/.*",
|
"tests/.*/.*/ssz_static/MatrixEntry/.*",
|
||||||
|
# TODO(gloas): Ignore Gloas light client stuff for now
|
||||||
|
"tests/.*/gloas/ssz_static/LightClient.*/.*",
|
||||||
|
# Execution payload header is irrelevant after Gloas, this type will probably be deleted.
|
||||||
|
"tests/.*/gloas/ssz_static/ExecutionPayloadHeader/.*",
|
||||||
|
# ForkChoiceNode is internal to fork choice and probably doesn't need SSZ tests.
|
||||||
|
"tests/.*/gloas/ssz_static/ForkChoiceNode/.*",
|
||||||
# EIP-7916 is still in draft and hasn't been implemented yet https://eips.ethereum.org/EIPS/eip-7916
|
# 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/progressive_bitlist",
|
||||||
"tests/general/phase0/ssz_generic/basic_progressive_list",
|
"tests/general/phase0/ssz_generic/basic_progressive_list",
|
||||||
@@ -61,8 +91,6 @@ excluded_paths = [
|
|||||||
"tests/.*/.*/epoch_processing/.*/post_epoch.ssz_snappy",
|
"tests/.*/.*/epoch_processing/.*/post_epoch.ssz_snappy",
|
||||||
# Ignore inactivity_scores tests for now (should implement soon).
|
# Ignore inactivity_scores tests for now (should implement soon).
|
||||||
"tests/.*/.*/rewards/inactivity_scores/.*",
|
"tests/.*/.*/rewards/inactivity_scores/.*",
|
||||||
# Ignore gloas tests for now
|
|
||||||
"tests/.*/gloas/.*",
|
|
||||||
# Ignore KZG tests that target internal kzg library functions
|
# Ignore KZG tests that target internal kzg library functions
|
||||||
"tests/.*/compute_verify_cell_kzg_proof_batch_challenge/.*",
|
"tests/.*/compute_verify_cell_kzg_proof_batch_challenge/.*",
|
||||||
"tests/.*/compute_challenge/.*",
|
"tests/.*/compute_challenge/.*",
|
||||||
|
|||||||
@@ -422,6 +422,11 @@ where
|
|||||||
fn handler_name(&self) -> String {
|
fn handler_name(&self) -> String {
|
||||||
BeaconState::<E>::name().into()
|
BeaconState::<E>::name().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||||
|
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> Handler for SszStaticWithSpecHandler<T, E>
|
impl<T, E> Handler for SszStaticWithSpecHandler<T, E>
|
||||||
@@ -444,6 +449,11 @@ where
|
|||||||
T::name().into()
|
T::name().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn disabled_forks(&self) -> Vec<ForkName> {
|
||||||
|
// TODO(gloas): Can be removed once we enable Gloas on all tests
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
|
|
||||||
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {
|
||||||
self.supported_forks.contains(&fork_name)
|
self.supported_forks.contains(&fork_name)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ type_name!(DepositData);
|
|||||||
type_name!(DepositMessage);
|
type_name!(DepositMessage);
|
||||||
type_name!(DepositRequest);
|
type_name!(DepositRequest);
|
||||||
type_name!(Eth1Data);
|
type_name!(Eth1Data);
|
||||||
|
type_name!(Builder);
|
||||||
|
type_name!(BuilderPendingPayment);
|
||||||
|
type_name!(BuilderPendingWithdrawal);
|
||||||
type_name!(WithdrawalRequest);
|
type_name!(WithdrawalRequest);
|
||||||
type_name_generic!(ExecutionPayload);
|
type_name_generic!(ExecutionPayload);
|
||||||
type_name_generic!(ExecutionPayloadBellatrix, "ExecutionPayload");
|
type_name_generic!(ExecutionPayloadBellatrix, "ExecutionPayload");
|
||||||
@@ -90,6 +93,8 @@ type_name_generic!(ExecutionPayloadHeaderFulu, "ExecutionPayloadHeader");
|
|||||||
type_name_generic!(ExecutionPayloadBid);
|
type_name_generic!(ExecutionPayloadBid);
|
||||||
type_name_generic!(SignedExecutionPayloadBid);
|
type_name_generic!(SignedExecutionPayloadBid);
|
||||||
type_name_generic!(ExecutionRequests);
|
type_name_generic!(ExecutionRequests);
|
||||||
|
type_name_generic!(ExecutionPayloadEnvelope);
|
||||||
|
type_name_generic!(SignedExecutionPayloadEnvelope);
|
||||||
type_name_generic!(BlindedPayload, "ExecutionPayloadHeader");
|
type_name_generic!(BlindedPayload, "ExecutionPayloadHeader");
|
||||||
type_name!(Fork);
|
type_name!(Fork);
|
||||||
type_name!(ForkData);
|
type_name!(ForkData);
|
||||||
@@ -97,6 +102,7 @@ type_name_generic!(HistoricalBatch);
|
|||||||
type_name_generic!(IndexedAttestation);
|
type_name_generic!(IndexedAttestation);
|
||||||
type_name_generic!(IndexedAttestationBase, "IndexedAttestation");
|
type_name_generic!(IndexedAttestationBase, "IndexedAttestation");
|
||||||
type_name_generic!(IndexedAttestationElectra, "IndexedAttestation");
|
type_name_generic!(IndexedAttestationElectra, "IndexedAttestation");
|
||||||
|
type_name_generic!(IndexedPayloadAttestation);
|
||||||
type_name_generic!(LightClientBootstrap);
|
type_name_generic!(LightClientBootstrap);
|
||||||
type_name_generic!(LightClientBootstrapAltair, "LightClientBootstrap");
|
type_name_generic!(LightClientBootstrapAltair, "LightClientBootstrap");
|
||||||
type_name_generic!(LightClientBootstrapCapella, "LightClientBootstrap");
|
type_name_generic!(LightClientBootstrapCapella, "LightClientBootstrap");
|
||||||
@@ -149,10 +155,15 @@ type_name_generic!(LightClientUpdateDeneb, "LightClientUpdate");
|
|||||||
type_name_generic!(LightClientUpdateElectra, "LightClientUpdate");
|
type_name_generic!(LightClientUpdateElectra, "LightClientUpdate");
|
||||||
type_name_generic!(LightClientUpdateFulu, "LightClientUpdate");
|
type_name_generic!(LightClientUpdateFulu, "LightClientUpdate");
|
||||||
type_name_generic!(PendingAttestation);
|
type_name_generic!(PendingAttestation);
|
||||||
|
type_name_generic!(PayloadAttestation);
|
||||||
|
type_name!(PayloadAttestationData);
|
||||||
|
type_name!(PayloadAttestationMessage);
|
||||||
type_name!(PendingConsolidation);
|
type_name!(PendingConsolidation);
|
||||||
type_name!(PendingPartialWithdrawal);
|
type_name!(PendingPartialWithdrawal);
|
||||||
type_name!(PendingDeposit);
|
type_name!(PendingDeposit);
|
||||||
type_name!(ProposerSlashing);
|
type_name!(ProposerSlashing);
|
||||||
|
type_name!(ProposerPreferences);
|
||||||
|
type_name!(SignedProposerPreferences);
|
||||||
type_name_generic!(SignedAggregateAndProof);
|
type_name_generic!(SignedAggregateAndProof);
|
||||||
type_name_generic!(SignedAggregateAndProofBase, "SignedAggregateAndProof");
|
type_name_generic!(SignedAggregateAndProofBase, "SignedAggregateAndProof");
|
||||||
type_name_generic!(SignedAggregateAndProofElectra, "SignedAggregateAndProof");
|
type_name_generic!(SignedAggregateAndProofElectra, "SignedAggregateAndProof");
|
||||||
|
|||||||
@@ -241,9 +241,12 @@ mod ssz_static {
|
|||||||
use ef_tests::{Handler, SszStaticHandler, SszStaticTHCHandler, SszStaticWithSpecHandler};
|
use ef_tests::{Handler, SszStaticHandler, SszStaticTHCHandler, SszStaticWithSpecHandler};
|
||||||
use types::state::HistoricalSummary;
|
use types::state::HistoricalSummary;
|
||||||
use types::{
|
use types::{
|
||||||
AttesterSlashingBase, AttesterSlashingElectra, ConsolidationRequest, DataColumnSidecarFulu,
|
AttesterSlashingBase, AttesterSlashingElectra, Builder, BuilderPendingPayment,
|
||||||
DataColumnSidecarGloas, DepositRequest, LightClientBootstrapAltair, PendingDeposit,
|
BuilderPendingWithdrawal, ConsolidationRequest, DepositRequest, ExecutionPayloadBid,
|
||||||
PendingPartialWithdrawal, WithdrawalRequest, *,
|
ExecutionPayloadEnvelope, IndexedPayloadAttestation, LightClientBootstrapAltair,
|
||||||
|
PayloadAttestation, PayloadAttestationData, PayloadAttestationMessage, PendingDeposit,
|
||||||
|
PendingPartialWithdrawal, SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope,
|
||||||
|
WithdrawalRequest, *,
|
||||||
};
|
};
|
||||||
|
|
||||||
ssz_static_test!(attestation_data, AttestationData);
|
ssz_static_test!(attestation_data, AttestationData);
|
||||||
@@ -600,7 +603,7 @@ mod ssz_static {
|
|||||||
.run();
|
.run();
|
||||||
SszStaticHandler::<ExecutionPayloadFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
|
SszStaticHandler::<ExecutionPayloadFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
|
||||||
SszStaticHandler::<ExecutionPayloadFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
|
SszStaticHandler::<ExecutionPayloadFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
|
||||||
SszStaticHandler::<ExecutionPayloadGloas<MainnetEthSpec>, MainnetEthSpec>::gloas_only()
|
SszStaticHandler::<ExecutionPayloadGloas<MinimalEthSpec>, MinimalEthSpec>::gloas_only()
|
||||||
.run();
|
.run();
|
||||||
SszStaticHandler::<ExecutionPayloadGloas<MainnetEthSpec>, MainnetEthSpec>::gloas_only()
|
SszStaticHandler::<ExecutionPayloadGloas<MainnetEthSpec>, MainnetEthSpec>::gloas_only()
|
||||||
.run();
|
.run();
|
||||||
@@ -749,6 +752,81 @@ mod ssz_static {
|
|||||||
SszStaticHandler::<ExecutionRequests<MinimalEthSpec>, MinimalEthSpec>::electra_and_later()
|
SszStaticHandler::<ExecutionRequests<MinimalEthSpec>, MinimalEthSpec>::electra_and_later()
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gloas and later
|
||||||
|
#[test]
|
||||||
|
fn builder() {
|
||||||
|
SszStaticHandler::<Builder, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<Builder, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn builder_pending_payment() {
|
||||||
|
SszStaticHandler::<BuilderPendingPayment, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<BuilderPendingPayment, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn builder_pending_withdrawal() {
|
||||||
|
SszStaticHandler::<BuilderPendingWithdrawal, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<BuilderPendingWithdrawal, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn payload_attestation_data() {
|
||||||
|
SszStaticHandler::<PayloadAttestationData, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<PayloadAttestationData, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn payload_attestation() {
|
||||||
|
SszStaticHandler::<PayloadAttestation<MinimalEthSpec>, MinimalEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
SszStaticHandler::<PayloadAttestation<MainnetEthSpec>, MainnetEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn payload_attestation_message() {
|
||||||
|
SszStaticHandler::<PayloadAttestationMessage, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<PayloadAttestationMessage, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn indexed_payload_attestation() {
|
||||||
|
SszStaticHandler::<IndexedPayloadAttestation<MinimalEthSpec>, MinimalEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
SszStaticHandler::<IndexedPayloadAttestation<MainnetEthSpec>, MainnetEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn execution_payload_envelope() {
|
||||||
|
SszStaticHandler::<ExecutionPayloadEnvelope<MinimalEthSpec>, MinimalEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
SszStaticHandler::<ExecutionPayloadEnvelope<MainnetEthSpec>, MainnetEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn signed_execution_payload_envelope() {
|
||||||
|
SszStaticHandler::<SignedExecutionPayloadEnvelope<MinimalEthSpec>, MinimalEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
SszStaticHandler::<SignedExecutionPayloadEnvelope<MainnetEthSpec>, MainnetEthSpec>::gloas_and_later()
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn proposer_preferences() {
|
||||||
|
SszStaticHandler::<ProposerPreferences, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<ProposerPreferences, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn signed_proposer_preferences() {
|
||||||
|
SszStaticHandler::<SignedProposerPreferences, MinimalEthSpec>::gloas_and_later().run();
|
||||||
|
SszStaticHandler::<SignedProposerPreferences, MainnetEthSpec>::gloas_and_later().run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user