Skip to content

Commit

Permalink
Update to v1.5.0-alpha.3 spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Jun 28, 2024
1 parent 78cf75a commit afb763d
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 49 deletions.
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ filegroup(
url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz",
)

consensus_spec_version = "v1.5.0-alpha.2"
consensus_spec_version = "v1.5.0-alpha.3"

bls_test_version = "v0.1.1"

Expand All @@ -243,7 +243,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-NNXBa7SZ2sFb68HPNahgu1p0yDBpjuKJuLfRCl7vvoQ=",
integrity = "sha256-+byv+GUOQytex5GgtjBGVoNDseJZbiBdAjEtlgCbjEo=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version,
)

Expand All @@ -259,7 +259,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-7BnlBvGWU92iAB100cMaAXVQhRrqpMQbavgrI+/paCw=",
integrity = "sha256-JJUy/jT1h3kGQkinTuzL7gMOA1+qgmPgJXVrYuH63Cg=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version,
)

Expand All @@ -275,7 +275,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-VCHhcNt+fynf/sHK11qbRBAy608u9T1qAafvAGfxQhA=",
integrity = "sha256-T2VM4Qd0SwgGnTjWxjOX297DqEsovO9Ueij1UEJy48Y=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version,
)

Expand All @@ -290,7 +290,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-a2aCNFyFkYLtf6QSwGOHdx7xXHjA2NNT8x8ZuxB0aes=",
integrity = "sha256-OP9BCBcQ7i+93bwj7ktY8pZ5uWsGjgTe4XTp7BDhX+I=",
strip_prefix = "consensus-specs-" + consensus_spec_version[1:],
url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version,
)
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/eth/config/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestGetSpec(t *testing.T) {
config.PendingConsolidationsLimit = 84
config.MaxPartialWithdrawalsPerPayload = 85
config.FullExitRequestAmount = 86
config.MaxConsolidations = 87
config.MaxConsolidationsRequestsPerPayload = 87
config.MaxAttesterSlashingsElectra = 88
config.MaxAttestationsElectra = 89
config.MaxWithdrawalRequestsPerPayload = 90
Expand Down Expand Up @@ -514,7 +514,7 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "85", v)
case "FULL_EXIT_REQUEST_AMOUNT":
assert.Equal(t, "86", v)
case "MAX_CONSOLIDATIONS":
case "MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD":
assert.Equal(t, "87", v)
case "DOMAIN_CONSOLIDATION":
assert.Equal(t, "0x31313030", v)
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/state/state-native/getters_withdrawal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func TestExpectedWithdrawals(t *testing.T) {
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
// Load a serialized Electra state from disk.
// This spectest has a fully hydrated beacon state with partial pending withdrawals.
serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/execution_layer_withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy")
serializedBytes, err := util.BazelFileBytes("tests/mainnet/electra/operations/withdrawal_request/pyspec_tests/pending_withdrawals_consume_all_excess_balance/pre.ssz_snappy")
require.NoError(t, err)
serializedSSZ, err := snappy.Decode(nil /* dst */, serializedBytes)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion config/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ type BeaconChainConfig struct {
PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state.
PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state.
PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state.
MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block.
MaxConsolidationsRequestsPerPayload uint64 `yaml:"MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxConsolidationsRequestsPerPayload is the maximum number of consolidations in a block.
MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalsSweep is the maximum number of pending partial withdrawals to process per payload.
FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit.
MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload.
Expand Down
3 changes: 3 additions & 0 deletions config/params/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// IMPORTANT: Use one field per line and sort these alphabetically to reduce conflicts.
var placeholderFields = []string{
"BYTES_PER_LOGS_BLOOM", // Compile time constant on ExecutionPayload.logs_bloom.
"CUSTODY_REQUIREMENT",
"EIP6110_FORK_EPOCH",
"EIP6110_FORK_VERSION",
"EIP7002_FORK_EPOCH",
Expand All @@ -40,6 +41,8 @@ var placeholderFields = []string{
"MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data.
"MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions.
"REORG_HEAD_WEIGHT_THRESHOLD",
"SAMPLES_PER_SLOT",
"TARGET_NUMBER_OF_PEERS",
"UPDATE_TIMEOUT",
"WHISK_EPOCHS_PER_SHUFFLING_PHASE",
"WHISK_FORK_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion config/params/mainnet_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
PendingPartialWithdrawalsLimit: 134_217_728,
PendingConsolidationsLimit: 262_144,
MinActivationBalance: 32_000_000_000,
MaxConsolidations: 1,
MaxConsolidationsRequestsPerPayload: 1,
MaxPendingPartialsPerWithdrawalsSweep: 8,
FullExitRequestAmount: 0,
MaxWithdrawalRequestsPerPayload: 16,
Expand Down
34 changes: 17 additions & 17 deletions proto/prysm/v1alpha1/attestation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions proto/prysm/v1alpha1/attestation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ message AttestationElectra {

AttestationData data = 2;

// TODO: doc
bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"];

// 96 byte BLS aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];

// Represents the committee which aggregated attestation belong.
bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"];
}

message AggregateAttestationAndProof {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import (

func RunWithdrawalRequestTest(t *testing.T, config string) {
require.NoError(t, utils.SetConfig(t, config))
testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests")
testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/withdrawal_request/pyspec_tests")
if len(testFolders) == 0 {
t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests")
t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/withdrawal_request/pyspec_tests")
}
for _, folder := range testFolders {
t.Run(folder.Name(), func(t *testing.T) {
folderPath := path.Join(testsFolderPath, folder.Name())
withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy")
withdrawalRequestFile, err := util.BazelFileBytes(folderPath, "withdrawal_request.ssz_snappy")
require.NoError(t, err)
withdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, withdrawalRequestFile)
require.NoError(t, err, "Failed to decompress")
Expand Down
18 changes: 2 additions & 16 deletions testing/spectest/shared/electra/ssz_static/ssz_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
var obj interface{}
switch folderName {
case "ExecutionPayload":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &enginev1.ExecutionPayloadElectra{}
case "ExecutionPayloadHeader":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &enginev1.ExecutionPayloadHeaderElectra{}
case "Attestation":
obj = &ethpb.AttestationElectra{}
Expand All @@ -51,15 +49,12 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
case "AggregateAndProof":
obj = &ethpb.AggregateAttestationAndProofElectra{}
case "BeaconBlock":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &ethpb.BeaconBlockElectra{}
case "BeaconBlockBody":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &ethpb.BeaconBlockBodyElectra{}
case "BeaconBlockHeader":
obj = &ethpb.BeaconBlockHeader{}
case "BeaconState":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &ethpb.BeaconStateElectra{}
case "Checkpoint":
obj = &ethpb.Checkpoint{}
Expand Down Expand Up @@ -89,7 +84,6 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
case "SignedAggregateAndProof":
obj = &ethpb.SignedAggregateAttestationAndProofElectra{}
case "SignedBeaconBlock":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
obj = &ethpb.SignedBeaconBlockElectra{}
case "SignedBeaconBlockHeader":
obj = &ethpb.SignedBeaconBlockHeader{}
Expand Down Expand Up @@ -151,19 +145,11 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
obj = &ethpb.PendingBalanceDeposit{}
case "PendingPartialWithdrawal":
obj = &ethpb.PendingPartialWithdrawal{}
case "Consolidation":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
// TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3
return nil, nil
case "SignedConsolidation":
t.Skip("Failing until spectests are updated to v1.5.0-alpha.3")
// TODO: Remove this case when the spectests are updated to v1.5.0-alpha.3
return nil, nil
case "PendingConsolidation":
obj = &ethpb.PendingConsolidation{}
case "ExecutionLayerWithdrawalRequest": // TODO: update in spectest update
case "WithdrawalRequest":
obj = &enginev1.WithdrawalRequest{}
case "DepositReceipt": // TODO: update in spectest update
case "DepositRequest":
obj = &enginev1.DepositRequest{}
case "ConsolidationRequest":
obj = &enginev1.ConsolidationRequest{}
Expand Down

0 comments on commit afb763d

Please sign in to comment.