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

EIP-6110: Supply validator deposits on chain #13944

Merged
merged 92 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5ad0a86
wip changes
james-prysm May 1, 2024
3572a53
wip changes refactoring deposit functions
james-prysm May 1, 2024
be6e19c
Merge branch 'develop' into eip6110
james-prysm May 2, 2024
bd3a92e
wip on deposit functions
james-prysm May 2, 2024
7666f65
wip changes to fix deposit processing
james-prysm May 2, 2024
51a2282
more wip function logic
james-prysm May 3, 2024
db031bd
gaz
james-prysm May 3, 2024
393e1a8
Merge branch 'develop' into eip6110
james-prysm May 6, 2024
9ccbaca
Merge branch 'develop' into eip6110
james-prysm May 6, 2024
ee0ad99
Merge branch 'develop' into eip6110
james-prysm May 7, 2024
550d366
Merge branch 'develop' into eip6110
james-prysm May 7, 2024
7f2bdf5
Merge branch 'develop' into eip6110
james-prysm May 7, 2024
c24e80c
wip refactoring deposit changes
james-prysm May 7, 2024
6287e3c
Merge branch 'develop' into eip6110
james-prysm May 7, 2024
be66a2d
Merge branch 'develop' into eip6110
james-prysm May 7, 2024
e3f50e9
removing circlular dependency and other small fix
james-prysm May 7, 2024
560ef11
Merge branch 'develop' into eip6110
james-prysm May 8, 2024
822cf02
fixing circular dependencies
james-prysm May 8, 2024
91eadef
fixing validators file
james-prysm May 8, 2024
8ffcb16
fixing more tests
james-prysm May 8, 2024
e4efcab
fixing unit tests
james-prysm May 8, 2024
babebea
Merge branch 'develop' into eip6110
james-prysm May 8, 2024
3469f6b
wip deposit packing
james-prysm May 9, 2024
d000211
refactoring packing
james-prysm May 9, 2024
4ba45f0
changing packing code some more
james-prysm May 9, 2024
c5189a7
fixing packing change
james-prysm May 9, 2024
935baca
updating more tests
james-prysm May 9, 2024
210a129
Merge branch 'develop' into eip6110
james-prysm May 9, 2024
d884737
removing comment
james-prysm May 9, 2024
b659925
fixing transition code for eip6110
james-prysm May 9, 2024
db5743f
Merge branch 'develop' into eip6110
james-prysm May 9, 2024
358ae04
including inserts for validator index cache
james-prysm May 9, 2024
1843ee5
Merge branch 'develop' into eip6110
james-prysm May 10, 2024
ade6c30
Merge branch 'develop' into eip6110
james-prysm May 12, 2024
32bc6b4
adding tests and placeholder test
james-prysm May 12, 2024
dd24d42
Merge branch 'develop' into eip6110
james-prysm May 13, 2024
ee52e22
moving deposit related unit tests over
james-prysm May 13, 2024
d8608d1
adding in test for electra proposer packing
james-prysm May 13, 2024
ef10964
Merge branch 'develop' into eip6110
james-prysm May 13, 2024
918ca0e
spec test wip
james-prysm May 14, 2024
e2af855
moving cache saving to the correct spot
james-prysm May 14, 2024
b6c1c37
eip-6110: deposit spectests
prestonvanloon May 14, 2024
8f554db
adding deposit receipt spec tests
james-prysm May 15, 2024
d08900f
Merge branch 'develop' into eip6110
james-prysm May 15, 2024
2c02712
reverting altair operations in this pr and will be handled separately
james-prysm May 15, 2024
ae4d911
Merge branch 'develop' into eip6110
james-prysm May 16, 2024
edc7198
Merge branch 'develop' into eip6110
james-prysm May 21, 2024
99a0aff
Merge branch 'develop' into eip6110
james-prysm May 24, 2024
f9b56d1
Merge branch 'develop' into eip6110
james-prysm Jun 5, 2024
261809b
Merge branch 'develop' into eip6110
james-prysm Jun 10, 2024
7a0a7a4
Merge branch 'develop' into eip6110
james-prysm Jun 12, 2024
c322c09
Merge branch 'develop' into eip6110
james-prysm Jun 12, 2024
3200781
fixing renames but need to refactor process deposits
james-prysm Jun 12, 2024
e0ae765
gaz
james-prysm Jun 12, 2024
fa3a689
fixing names
james-prysm Jun 13, 2024
278d80c
fixing linting
james-prysm Jun 13, 2024
69f77e7
Merge branch 'develop' into eip6110
james-prysm Jun 13, 2024
a39e014
fixing unit test
james-prysm Jun 13, 2024
56f0728
fixing a test and updating test util
james-prysm Jun 13, 2024
ffe5260
bal never used
james-prysm Jun 13, 2024
12fe34c
fixing more tests
james-prysm Jun 13, 2024
212ef50
fixing one more test
james-prysm Jun 14, 2024
644f938
Merge branch 'develop' into eip6110
james-prysm Jun 14, 2024
afc037b
Merge branch 'develop' into eip6110
james-prysm Jun 14, 2024
575ae4c
addressing feedback
james-prysm Jun 17, 2024
940d8e3
refactoring process deposits to be part of their own fork instead of …
james-prysm Jun 20, 2024
e34cd2f
adding new tests to cover functions and removing redundancies
james-prysm Jun 20, 2024
83eacc0
Merge branch 'develop' into eip6110
james-prysm Jun 20, 2024
a45c7e7
removing comment based on feedback
james-prysm Jun 20, 2024
f919a8d
Merge branch 'develop' into eip6110
james-prysm Jun 20, 2024
c819897
resolving easy deepsource issue
james-prysm Jun 20, 2024
d7bd167
Merge branch 'develop' into eip6110
james-prysm Jun 21, 2024
3cb4c5f
refactoring for appropriate aliasing and readability
james-prysm Jun 21, 2024
1582be9
Merge branch 'develop' into eip6110
james-prysm Jun 24, 2024
c09cd25
reverting some changes to simplify diff
james-prysm Jun 24, 2024
dc38405
Merge branch 'develop' into eip6110
james-prysm Jun 24, 2024
9b5a925
Merge branch 'develop' into eip6110
james-prysm Jun 25, 2024
bccfa0b
small edit to comment
james-prysm Jun 25, 2024
aff2231
fixing linting
james-prysm Jun 25, 2024
04372f5
Merge branch 'develop' into eip6110
james-prysm Jun 26, 2024
a9a7aed
Merge branch 'develop' into eip6110
james-prysm Jun 26, 2024
f2be21f
Merge branch 'develop' into eip6110
james-prysm Jun 26, 2024
502a721
Merge branch 'develop' into eip6110
james-prysm Jun 27, 2024
43912e9
Merge branch 'develop' into eip6110
james-prysm Jun 27, 2024
7fa467a
fixing merge changes and review comments
james-prysm Jun 27, 2024
3e5f08b
Merge branch 'develop' into eip6110
james-prysm Jun 28, 2024
2bb28d3
Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go
james-prysm Jun 28, 2024
7fa48d1
Merge branch 'develop' into eip6110
james-prysm Jun 28, 2024
45e9eb2
partial review comments
james-prysm Jun 28, 2024
0dc3473
addressing slack feedback
james-prysm Jun 28, 2024
649e94b
moving function from deposits to validator.go
james-prysm Jun 28, 2024
f2da526
adding in batch verification and improving logs
james-prysm Jun 28, 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
10 changes: 10 additions & 0 deletions beacon-chain/core/electra/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
"effective_balance_updates.go",
"registry_updates.go",
"transition.go",
"transition_no_verify.sig.go",
Copy link
Member

Choose a reason for hiding this comment

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

This filename doesn't make sense for what you've added. It should be called operations.go, in my opinion.

If you want to keep it with this pattern please use underscores for the name and avoid a .sig.go suffix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

another good catch was definitely not intentional...

"upgrade.go",
"validator.go",
"withdrawals.go",
Expand All @@ -18,15 +19,19 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//beacon-chain/core/altair:go_default_library",
"//beacon-chain/core/blocks:go_default_library",
"//beacon-chain/core/epoch:go_default_library",
"//beacon-chain/core/epoch/precompute:go_default_library",
"//beacon-chain/core/helpers:go_default_library",
"//beacon-chain/core/signing:go_default_library",
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/core/validators:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",
"//config/params:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
"//contracts/deposit:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//proto/engine/v1:go_default_library",
Expand All @@ -44,6 +49,7 @@ go_test(
srcs = [
"churn_test.go",
"consolidations_test.go",
"deposit_fuzz_test.go",
"deposits_test.go",
"effective_balance_updates_test.go",
"upgrade_test.go",
Expand All @@ -53,11 +59,14 @@ go_test(
deps = [
":go_default_library",
"//beacon-chain/core/helpers:go_default_library",
"//beacon-chain/core/signing:go_default_library",
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/primitives:go_default_library",
"//crypto/bls:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
Expand All @@ -66,6 +75,7 @@ go_test(
"//testing/util:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_google_gofuzz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
],
Expand Down
48 changes: 48 additions & 0 deletions beacon-chain/core/electra/deposit_fuzz_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package electra_test

import (
"context"
"testing"

fuzz "github.com/google/gofuzz"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/require"
)

func TestFuzzProcessDeposits_10000(t *testing.T) {
fuzzer := fuzz.NewWithSeed(0)
state := &ethpb.BeaconStateElectra{}
deposits := make([]*ethpb.Deposit, 100)
ctx := context.Background()
for i := 0; i < 10000; i++ {
fuzzer.Fuzz(state)
for i := range deposits {
fuzzer.Fuzz(deposits[i])
}
s, err := state_native.InitializeFromProtoUnsafeElectra(state)
require.NoError(t, err)
r, err := electra.ProcessDeposits(ctx, s, deposits)
if err != nil && r != nil {
t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposits)
}
}
}

func TestFuzzProcessDeposit_10000(t *testing.T) {
fuzzer := fuzz.NewWithSeed(0)
state := &ethpb.BeaconStateElectra{}
deposit := &ethpb.Deposit{}

for i := 0; i < 10000; i++ {
fuzzer.Fuzz(state)
fuzzer.Fuzz(deposit)
s, err := state_native.InitializeFromProtoUnsafeElectra(state)
require.NoError(t, err)
r, err := electra.ProcessDeposit(s, deposit, true)
if err != nil && r != nil {
t.Fatalf("return value should be nil on err. found: %v on error: %v for state: %v and block: %v", r, err, state, deposit)
}
}
}
Loading
Loading