Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eip6110 queue deposit requests #14430

Merged
merged 64 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2cc1ff3
wip
james-prysm Aug 8, 2024
b008a3b
updating types and wip on functions
james-prysm Aug 9, 2024
8d0d444
fixing conficts and merging develop
james-prysm Sep 6, 2024
4a87609
Merge branch 'develop' into eip6110-queue
james-prysm Sep 6, 2024
a0bef32
renaming to MAX_PENDING_DEPOSITS_PER_EPOCH
james-prysm Sep 6, 2024
46e88f0
fixing linting and conversions
james-prysm Sep 6, 2024
6cf54bc
adding queue deposit changes
james-prysm Sep 6, 2024
5334144
Merge branch 'develop' into eip6110-queue
james-prysm Sep 6, 2024
3c25797
fixing test and cloning
james-prysm Sep 6, 2024
330cfa3
removing unneeded test based on update
james-prysm Sep 6, 2024
3566543
gaz
james-prysm Sep 6, 2024
41ba44b
Merge branch 'develop' into eip6110-queue
james-prysm Sep 9, 2024
0690e44
Merge branch 'develop' into eip6110-queue
james-prysm Sep 10, 2024
f697f65
wip apply pending deposit
james-prysm Sep 10, 2024
792a4f7
fixing replay test and adding apply pending deposit
james-prysm Sep 10, 2024
af3f8d0
Merge branch 'develop' into eip6110-queue
james-prysm Sep 12, 2024
8bb1fcc
fixing setters test
james-prysm Sep 11, 2024
5dda6df
updating transition test
james-prysm Sep 11, 2024
1e4e826
changelog
james-prysm Sep 12, 2024
29cf448
Merge branch 'develop' into eip6110-queue
james-prysm Sep 16, 2024
f1a2dca
updating pending deposits
james-prysm Sep 12, 2024
944afd1
fixing ProcessPendingDeposit unit tests
james-prysm Sep 16, 2024
5fb1e10
gaz
james-prysm Sep 16, 2024
1a55937
fixing cyclic dependencies
james-prysm Sep 16, 2024
fe2598d
fix visiblity
james-prysm Sep 17, 2024
26216ef
missed adding the right signature verification
james-prysm Sep 17, 2024
582444c
adding point to infinity topup test
james-prysm Sep 18, 2024
8776421
adding apply pending deposit test
james-prysm Sep 18, 2024
f6e06d7
making changes based on eip6110 changes
james-prysm Sep 19, 2024
9110135
fixing ineffassign
james-prysm Sep 19, 2024
9abebd7
gaz
james-prysm Sep 19, 2024
41f1406
Merge branch 'develop' into eip6110-queue
james-prysm Sep 20, 2024
f95f87c
adding batched verifications sigs
james-prysm Sep 23, 2024
377f5a6
Merge branch 'develop' into eip6110-queue
james-prysm Sep 23, 2024
134fe8c
Merge branch 'develop' into eip6110-queue
james-prysm Sep 24, 2024
fe5c942
Merge branch 'develop' into eip6110-queue
james-prysm Sep 26, 2024
b5d2d90
fixing broken type
james-prysm Sep 26, 2024
446cba2
fixing proto
james-prysm Sep 27, 2024
c3fb312
Merge branch 'develop' into eip6110-queue
james-prysm Sep 27, 2024
7a5ff1a
Merge branch 'develop' into eip6110-queue
james-prysm Oct 7, 2024
f976c26
updated consensus spec tests and fixed consensus bug tests
james-prysm Oct 8, 2024
c2e6686
Merge branch 'develop' into eip6110-queue
james-prysm Oct 8, 2024
abd0e1e
testing readability improvement by avoiding ApplyPendingDeposit
james-prysm Oct 8, 2024
5b40a23
removing the boolean from apply pending deposit
james-prysm Oct 8, 2024
64545de
improve naming
james-prysm Oct 8, 2024
c37cd17
review comments and fixing a small bug using wrong variable
james-prysm Oct 8, 2024
de43591
fixing tests and skipping a test
james-prysm Oct 8, 2024
dc38cf9
Merge branch 'develop' into eip6110-queue
james-prysm Oct 8, 2024
7abdd5d
adding some test skips
james-prysm Oct 8, 2024
6677634
fixing bugs terence found
james-prysm Oct 8, 2024
4e310e7
Merge branch 'develop' into eip6110-queue
james-prysm Oct 8, 2024
d52d819
adding test for batchProcessNewPendingDeposits
james-prysm Oct 8, 2024
c66c2e9
gaz
james-prysm Oct 8, 2024
44a41c4
adding churn test
james-prysm Oct 9, 2024
197163b
updating spec tests to alpha.8
james-prysm Oct 9, 2024
1c0d70e
Merge branch 'develop' into eip6110-queue
james-prysm Oct 9, 2024
0eb8e79
adding pr to changelog
james-prysm Oct 9, 2024
c48a58b
addressing terence's comments
james-prysm Oct 10, 2024
cc3e941
Update beacon-chain/core/electra/validator.go
james-prysm Oct 10, 2024
a637027
adding tests for batch verify and rename some variables
james-prysm Oct 10, 2024
fa23924
Merge branch 'develop' into eip6110-queue
james-prysm Oct 10, 2024
cd39461
skipping tests , add them back in later
james-prysm Oct 10, 2024
9b96fa6
skipping one more test
james-prysm Oct 10, 2024
d786dc5
Merge branch 'develop' into eip6110-queue
james-prysm Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Light client support: Implement `ComputeFieldRootsForBlockBody`.
- Light client support: Add light client database changes.
- Light client support: Implement capella and deneb changes.
- Electra EIP6110: Queue deposit
- Light client support: Implement `BlockToLightClientHeader` function.
- Light client support: Consensus types.
- GetBeaconStateV2: add Electra case.
Expand Down Expand Up @@ -40,6 +41,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias.
- `api-timeout` is changed from int flag to duration flag, default value updated.
- Light client support: abstracted out the light client headers with different versions.
- Electra EIP6110: Queue deposit requests changes from consensus spec pr #3818
- `ApplyToEveryValidator` has been changed to prevent misuse bugs, it takes a closure that takes a `ReadOnlyValidator` and returns a raw pointer to a `Validator`.
- Removed gorilla mux library and replaced it with net/http updates in go 1.22.
- Clean up `ProposeBlock` for validator client to reduce cognitive scoring and enable further changes.
Expand Down
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.6"
consensus_spec_version = "v1.5.0-alpha.7"

bls_test_version = "v0.1.1"

Expand All @@ -243,7 +243,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-M7u/Ot/Vzorww+dFbHp0cxLyM2mezJjijCzq+LY3uvs=",
integrity = "sha256-Vo4+1bsRNYMGXjlpIYKEqt2WPjeGSbjeFQFKVUhf1Yc=",
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-deOSeLRsmHXvkRp8n2bs3HXdkGUJWWqu8KFM/QABbZg=",
integrity = "sha256-TsQtQVPyQA6htrTjL1cd/oWEkM83aK4Y0pT9W6ssKYU=",
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-Zz7YCf6XVf57nzSEGq9ToflJFHM0lAGwhd18l9Rf3hA=",
integrity = "sha256-4g7EijlsIJVKGADlVL6ka9ikcwow8WuKHaABONA0Cxg=",
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-BoXckDxXnDcEmAjg/dQgf/tLiJsb6CT0aZvmWHFijrY=",
integrity = "sha256-i5+48P/BqxA+q39OufAiotW2llUq97+4j1++ViI96dM=",
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
13 changes: 8 additions & 5 deletions api/server/structs/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1476,12 +1476,15 @@ func DepositSnapshotFromConsensus(ds *eth.DepositSnapshot) *DepositSnapshot {
}
}

func PendingBalanceDepositsFromConsensus(ds []*eth.PendingBalanceDeposit) []*PendingBalanceDeposit {
deposits := make([]*PendingBalanceDeposit, len(ds))
func PendingDepositsFromConsensus(ds []*eth.PendingDeposit) []*PendingDeposit {
deposits := make([]*PendingDeposit, len(ds))
for i, d := range ds {
deposits[i] = &PendingBalanceDeposit{
Index: fmt.Sprintf("%d", d.Index),
Amount: fmt.Sprintf("%d", d.Amount),
deposits[i] = &PendingDeposit{
Pubkey: hexutil.Encode(d.PublicKey),
WithdrawalCredentials: hexutil.Encode(d.WithdrawalCredentials),
Amount: fmt.Sprintf("%d", d.Amount),
Signature: hexutil.Encode(d.Signature),
Slot: fmt.Sprintf("%d", d.Slot),
}
}
return deposits
Expand Down
4 changes: 2 additions & 2 deletions api/server/structs/conversions_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ func BeaconStateElectraFromConsensus(st beaconState.BeaconState) (*BeaconStateEl
if err != nil {
return nil, err
}
pbd, err := st.PendingBalanceDeposits()
pbd, err := st.PendingDeposits()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -770,7 +770,7 @@ func BeaconStateElectraFromConsensus(st beaconState.BeaconState) (*BeaconStateEl
EarliestExitEpoch: fmt.Sprintf("%d", eee),
ConsolidationBalanceToConsume: fmt.Sprintf("%d", cbtc),
EarliestConsolidationEpoch: fmt.Sprintf("%d", ece),
PendingBalanceDeposits: PendingBalanceDepositsFromConsensus(pbd),
PendingDeposits: PendingDepositsFromConsensus(pbd),
PendingPartialWithdrawals: PendingPartialWithdrawalsFromConsensus(ppw),
PendingConsolidations: PendingConsolidationsFromConsensus(pc),
}, nil
Expand Down
9 changes: 6 additions & 3 deletions api/server/structs/other.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,12 @@ type ConsolidationRequest struct {
TargetPubkey string `json:"target_pubkey"`
}

type PendingBalanceDeposit struct {
Index string `json:"index"`
Amount string `json:"amount"`
type PendingDeposit struct {
Pubkey string `json:"pubkey"`
WithdrawalCredentials string `json:"withdrawal_credentials"`
Amount string `json:"amount"`
Signature string `json:"signature"`
Slot string `json:"slot"`
}

type PendingPartialWithdrawal struct {
Expand Down
2 changes: 1 addition & 1 deletion api/server/structs/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ type BeaconStateElectra struct {
EarliestExitEpoch string `json:"earliest_exit_epoch"`
ConsolidationBalanceToConsume string `json:"consolidation_balance_to_consume"`
EarliestConsolidationEpoch string `json:"earliest_consolidation_epoch"`
PendingBalanceDeposits []*PendingBalanceDeposit `json:"pending_balance_deposits"`
PendingDeposits []*PendingDeposit `json:"pending_deposits"`
PendingPartialWithdrawals []*PendingPartialWithdrawal `json:"pending_partial_withdrawals"`
PendingConsolidations []*PendingConsolidation `json:"pending_consolidations"`
}
8 changes: 4 additions & 4 deletions beacon-chain/core/altair/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func ProcessDeposits(
// amount=deposit.data.amount,
// signature=deposit.data.signature,
// )
func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, error) {
func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verified bool) (state.BeaconState, error) {
if err := blocks.VerifyDeposit(beaconState, deposit); err != nil {
if deposit == nil || deposit.Data == nil {
return nil, err
Expand All @@ -92,7 +92,7 @@ func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verif
return nil, err
}

return ApplyDeposit(beaconState, deposit.Data, verifySignature)
return ApplyDeposit(beaconState, deposit.Data, verified)
}

// ApplyDeposit
Expand All @@ -115,13 +115,13 @@ func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verif
// # Increase balance by deposit amount
// index = ValidatorIndex(validator_pubkeys.index(pubkey))
// increase_balance(state, index, amount)
func ApplyDeposit(beaconState state.BeaconState, data *ethpb.Deposit_Data, verifySignature bool) (state.BeaconState, error) {
func ApplyDeposit(beaconState state.BeaconState, data *ethpb.Deposit_Data, verified bool) (state.BeaconState, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to change verifySignature to verified in the same PR? It seems to me it would be better to do it in another PR, and maybe open it beforehand to eliminate potential sources of errors and avoid doing too much in one PR. It's up to you.

pubKey := data.PublicKey
amount := data.Amount
withdrawalCredentials := data.WithdrawalCredentials
index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey))
if !ok {
if verifySignature {
if !verified {
valid, err := blocks.IsValidDepositSignature(data)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/altair/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TestProcessDeposit_SkipsInvalidDeposit(t *testing.T) {
},
})
require.NoError(t, err)
newState, err := altair.ProcessDeposit(beaconState, dep[0], true)
newState, err := altair.ProcessDeposit(beaconState, dep[0], false)
require.NoError(t, err, "Expected invalid block deposit to be ignored without error")

if newState.Eth1DepositIndex() != 1 {
Expand Down
61 changes: 58 additions & 3 deletions beacon-chain/core/blocks/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,26 @@ func BatchVerifyDepositsSignatures(ctx context.Context, deposits []*ethpb.Deposi
return false, err
}

verified := false
if err := verifyDepositDataWithDomain(ctx, deposits, domain); err != nil {
log.WithError(err).Debug("Failed to batch verify deposits signatures, will try individual verify")
verified = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why this was confusing before, and what you've done here is a welcome improvement. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#14526 now as part of this pr

return false, nil
}
return true, nil
}

// BatchVerifyPendingDepositsSignatures batch verifies pending deposit signatures.
func BatchVerifyPendingDepositsSignatures(ctx context.Context, deposits []*ethpb.PendingDeposit) (bool, error) {
var err error
domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil)
if err != nil {
return false, err
}

if err := verifyPendingDepositDataWithDomain(ctx, deposits, domain); err != nil {
log.WithError(err).Debug("Failed to batch verify deposits signatures, will try individual verify")
return false, nil
}
return verified, nil
return true, nil
}

// IsValidDepositSignature returns whether deposit_data is valid
Expand Down Expand Up @@ -159,3 +173,44 @@ func verifyDepositDataWithDomain(ctx context.Context, deps []*ethpb.Deposit, dom
}
return nil
}

func verifyPendingDepositDataWithDomain(ctx context.Context, deps []*ethpb.PendingDeposit, domain []byte) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, all of these may benefit from unit tests, but I’ll leave that decision to you:

  • verifyPendingDepositDataWithDomain
  • BatchVerifyPendingDepositsSignatures
  • batchProcessNewPendingDeposits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one for batch ProcessNewPendingDeposits, can add more

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added more tests

if len(deps) == 0 {
return nil
}
pks := make([]bls.PublicKey, len(deps))
sigs := make([][]byte, len(deps))
msgs := make([][32]byte, len(deps))
for i, dep := range deps {
if ctx.Err() != nil {
return ctx.Err()
}
if dep == nil {
return errors.New("nil deposit")
}
dpk, err := bls.PublicKeyFromBytes(dep.PublicKey)
if err != nil {
return err
}
pks[i] = dpk
sigs[i] = dep.Signature
depositMessage := &ethpb.DepositMessage{
PublicKey: dep.PublicKey,
WithdrawalCredentials: dep.WithdrawalCredentials,
Amount: dep.Amount,
}
sr, err := signing.ComputeSigningRoot(depositMessage, domain)
if err != nil {
return err
}
msgs[i] = sr
}
verify, err := bls.VerifyMultipleSignatures(sigs, msgs, pks)
if err != nil {
return errors.Errorf("could not verify multiple signatures: %v", err)
}
if !verify {
return errors.New("one or more deposit signatures did not verify")
}
return nil
}
39 changes: 37 additions & 2 deletions beacon-chain/core/blocks/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,41 @@ import (
)

func TestBatchVerifyDepositsSignatures_Ok(t *testing.T) {
sk, err := bls.RandKey()
require.NoError(t, err)
domain, err := signing.ComputeDomain(params.BeaconConfig().DomainDeposit, nil, nil)
require.NoError(t, err)
deposit := &ethpb.Deposit{
Data: &ethpb.Deposit_Data{
PublicKey: sk.PublicKey().Marshal(),
WithdrawalCredentials: make([]byte, 32),
Amount: 3000,
},
}
sr, err := signing.ComputeSigningRoot(&ethpb.DepositMessage{
PublicKey: deposit.Data.PublicKey,
WithdrawalCredentials: deposit.Data.WithdrawalCredentials,
Amount: 3000,
}, domain)
require.NoError(t, err)
sig := sk.Sign(sr[:])
deposit.Data.Signature = sig.Marshal()
leaf, err := deposit.Data.HashTreeRoot()
require.NoError(t, err)
// We then create a merkle branch for the test.
depositTrie, err := trie.GenerateTrieFromItems([][]byte{leaf[:]}, params.BeaconConfig().DepositContractTreeDepth)
require.NoError(t, err, "Could not generate trie")
proof, err := depositTrie.MerkleProof(0)
require.NoError(t, err, "Could not generate proof")

deposit.Proof = proof
require.NoError(t, err)
verified, err := blocks.BatchVerifyDepositsSignatures(context.Background(), []*ethpb.Deposit{deposit})
require.NoError(t, err)
require.Equal(t, true, verified)
}

func TestBatchVerifyDepositsSignatures_InvalidSignature(t *testing.T) {
deposit := &ethpb.Deposit{
Data: &ethpb.Deposit_Data{
PublicKey: bytesutil.PadTo([]byte{1, 2, 3}, 48),
Expand All @@ -34,9 +69,9 @@ func TestBatchVerifyDepositsSignatures_Ok(t *testing.T) {

deposit.Proof = proof
require.NoError(t, err)
ok, err := blocks.BatchVerifyDepositsSignatures(context.Background(), []*ethpb.Deposit{deposit})
verified, err := blocks.BatchVerifyDepositsSignatures(context.Background(), []*ethpb.Deposit{deposit})
require.NoError(t, err)
require.Equal(t, true, ok)
require.Equal(t, false, verified)
}

func TestVerifyDeposit_MerkleBranchFailsVerification(t *testing.T) {
Expand Down
4 changes: 4 additions & 0 deletions beacon-chain/core/electra/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ go_library(
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
"//contracts/deposit:go_default_library",
"//crypto/bls/common:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//monitoring/tracing/trace:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/version:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
Expand Down Expand Up @@ -65,11 +67,13 @@ go_test(
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",
"//beacon-chain/state/testing:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/primitives:go_default_library",
"//crypto/bls:go_default_library",
"//crypto/bls/common:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
Expand Down
32 changes: 0 additions & 32 deletions beacon-chain/core/electra/consolidations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,38 +201,6 @@ func TestProcessPendingConsolidations(t *testing.T) {
}
}

func stateWithActiveBalanceETH(t *testing.T, balETH uint64) state.BeaconState {
gwei := balETH * 1_000_000_000
balPerVal := params.BeaconConfig().MinActivationBalance
numVals := gwei / balPerVal

vals := make([]*eth.Validator, numVals)
bals := make([]uint64, numVals)
for i := uint64(0); i < numVals; i++ {
wc := make([]byte, 32)
wc[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
wc[31] = byte(i)
vals[i] = &eth.Validator{
ActivationEpoch: 0,
ExitEpoch: params.BeaconConfig().FarFutureEpoch,
EffectiveBalance: balPerVal,
WithdrawalCredentials: wc,
}
bals[i] = balPerVal
}
st, err := state_native.InitializeFromProtoUnsafeElectra(&eth.BeaconStateElectra{
Slot: 10 * params.BeaconConfig().SlotsPerEpoch,
Validators: vals,
Balances: bals,
Fork: &eth.Fork{
CurrentVersion: params.BeaconConfig().ElectraForkVersion,
},
})
require.NoError(t, err)

return st
}

func TestProcessConsolidationRequests(t *testing.T) {
tests := []struct {
name string
Expand Down
Loading
Loading