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

Align to spec v1.0.0 #7469

Merged
merged 27 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c769565
Update eth1data params to double
terencechain Oct 8, 2020
7485db4
Update spec tests tags and state field for fssz gen
terencechain Oct 8, 2020
900ecd5
Update more spec test sha tags
terencechain Oct 8, 2020
0652de1
Update slashing params
terencechain Oct 8, 2020
808d154
Update slashing precompute to use config instead of hardcoded 3
terencechain Oct 8, 2020
ca8c8af
Update slashing test values due to config changes
terencechain Oct 9, 2020
186cee1
Update configs for slashedless test
terencechain Oct 9, 2020
ae95875
Merge branch 'master' into v1.0.0-rc.0
terencechain Oct 12, 2020
b82f0d8
Sync with master
terencechain Nov 5, 2020
59905c2
Merge branch 'v1.0.0-rc.0' of github.com:prysmaticlabs/prysm into v1.…
terencechain Nov 5, 2020
9fc7067
Go mod tidy
terencechain Nov 6, 2020
1d8e756
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 7, 2020
d954e8f
Add toledo config (#7743)
terencechain Nov 7, 2020
acc863a
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 9, 2020
b9571ce
Merge branch 'v1.0.0-rc.0' of github.com:prysmaticlabs/prysm into v1.…
terencechain Nov 9, 2020
3c492df
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 11, 2020
fdb9c29
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 11, 2020
2b238df
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 12, 2020
2fbf573
Update genesis delay to one week (#7782)
terencechain Nov 12, 2020
6b502bc
Merge branch 'master' of github.com:prysmaticlabs/prysm into v1.0.0-rc.0
terencechain Nov 12, 2020
906e049
Merge branch 'v1.0.0-rc.0' of github.com:prysmaticlabs/prysm into v1.…
terencechain Nov 12, 2020
4d7e776
Add Pyrmont config (#7797)
terencechain Nov 12, 2020
faa0145
Remove TestExecuteStateTransition_FullBlock
terencechain Nov 12, 2020
9769298
Add back missing comments
terencechain Nov 12, 2020
9011542
Merge branch 'master' into v1.0.0-rc.0
terencechain Nov 12, 2020
fd5ab81
Merge branch 'master' into v1.0.0-rc.0
rauljordan Nov 12, 2020
a70d61f
Update spectests to v1.0.0
prestonvanloon Nov 13, 2020
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
8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "72c2f561db879ddcdf729fef93d10e0f9162b4cf3a697c513ef8935b93f6165a",
url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v0.12.3/minimal.tar.gz",
sha256 = "5b19b95a96eeba49e20e0732d5b6ede7dae10ae956b517bd3a7a9df2fd863f0d",
url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v1.0.0-rc.0/minimal.tar.gz",
)

http_archive(
Expand All @@ -254,8 +254,8 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "63eca02503692a0b6a2d7b70118e0dd62dff094153a3a542af6dbea721841b0d",
url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v0.12.3/mainnet.tar.gz",
sha256 = "3f31c88a21b86f8f9b5a7f88e49a55e3944e14495be0fcc0c1218c0d1e359e64",
url = "https://github.com/ethereum/eth2.0-spec-tests/releases/download/v1.0.0-rc.0/mainnet.tar.gz",
)

http_archive(
Expand Down
20 changes: 10 additions & 10 deletions beacon-chain/core/epoch/epoch_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ func TestProcessSlashings_SlashedLess(t *testing.T) {
Balances: []uint64{params.BeaconConfig().MaxEffectiveBalance, params.BeaconConfig().MaxEffectiveBalance},
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9) / (1 * 1e9) * (3*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(29000000000), // 32 * 1e9 - 3000000000
// penalty = validator balance / increment * (2*total_penalties) / total_balance * increment
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (1*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
},
{
state: &pb.BeaconState{
Expand All @@ -212,9 +212,9 @@ func TestProcessSlashings_SlashedLess(t *testing.T) {
Balances: []uint64{params.BeaconConfig().MaxEffectiveBalance, params.BeaconConfig().MaxEffectiveBalance},
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (3*1e9) / (64*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
// penalty = validator balance / increment * (2*total_penalties) / total_balance * increment
// 500000000 = (32 * 1e9) / (1 * 1e9) * (1*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(32000000000), // 32 * 1e9 - 500000000
},
{
state: &pb.BeaconState{
Expand All @@ -229,8 +229,8 @@ func TestProcessSlashings_SlashedLess(t *testing.T) {
Slashings: []uint64{0, 2 * 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9) / (1 * 1e9) * (3*2e9) / (64*1e9) * (1 * 1e9)
want: uint64(29000000000), // 32 * 1e9 - 3000000000
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (1*2e9) / (64*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
},
{
state: &pb.BeaconState{
Expand All @@ -243,8 +243,8 @@ func TestProcessSlashings_SlashedLess(t *testing.T) {
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9 - 1*1e9) / (1 * 1e9) * (3*1e9) / (31*1e9) * (1 * 1e9)
want: uint64(28000000000), // 31 * 1e9 - 3000000000
// 2000000000 = (32 * 1e9 - 1*1e9) / (1 * 1e9) * (2*1e9) / (31*1e9) * (1 * 1e9)
want: uint64(30000000000), // 32 * 1e9 - 2000000000
},
}

Expand Down
20 changes: 10 additions & 10 deletions beacon-chain/core/epoch/precompute/slashing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func TestProcessSlashingsPrecompute_SlashedLess(t *testing.T) {
Balances: []uint64{params.BeaconConfig().MaxEffectiveBalance, params.BeaconConfig().MaxEffectiveBalance},
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9) / (1 * 1e9) * (3*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(29000000000), // 32 * 1e9 - 3000000000
// penalty = validator balance / increment * (2*total_penalties) / total_balance * increment
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (1*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
},
{
state: &pb.BeaconState{
Expand All @@ -74,9 +74,9 @@ func TestProcessSlashingsPrecompute_SlashedLess(t *testing.T) {
Balances: []uint64{params.BeaconConfig().MaxEffectiveBalance, params.BeaconConfig().MaxEffectiveBalance, params.BeaconConfig().MaxEffectiveBalance},
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (3*1e9) / (64*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
// penalty = validator balance / increment * (2*total_penalties) / total_balance * increment
// 500000000 = (32 * 1e9) / (1 * 1e9) * (1*1e9) / (32*1e9) * (1 * 1e9)
want: uint64(32000000000), // 32 * 1e9 - 500000000
},
{
state: &pb.BeaconState{
Expand All @@ -91,8 +91,8 @@ func TestProcessSlashingsPrecompute_SlashedLess(t *testing.T) {
Slashings: []uint64{0, 2 * 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9) / (1 * 1e9) * (3*2e9) / (64*1e9) * (1 * 1e9)
want: uint64(29000000000), // 32 * 1e9 - 3000000000
// 1000000000 = (32 * 1e9) / (1 * 1e9) * (1*2e9) / (64*1e9) * (1 * 1e9)
want: uint64(31000000000), // 32 * 1e9 - 1000000000
},
{
state: &pb.BeaconState{
Expand All @@ -105,8 +105,8 @@ func TestProcessSlashingsPrecompute_SlashedLess(t *testing.T) {
Slashings: []uint64{0, 1e9},
},
// penalty = validator balance / increment * (3*total_penalties) / total_balance * increment
// 3000000000 = (32 * 1e9 - 1*1e9) / (1 * 1e9) * (3*1e9) / (31*1e9) * (1 * 1e9)
want: uint64(28000000000), // 31 * 1e9 - 3000000000
// 2000000000 = (32 * 1e9 - 1*1e9) / (1 * 1e9) * (2*1e9) / (31*1e9) * (1 * 1e9)
want: uint64(30000000000), // 32 * 1e9 - 2000000000
},
}

Expand Down
13 changes: 0 additions & 13 deletions beacon-chain/core/state/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@ import (

var runAmount = 25

func TestExecuteStateTransition_FullBlock(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm removing this test. This is actually more housekeeping work than good. Whenever there's a change to a beacon object, this test requires a manual update

benchutil.SetBenchmarkConfig()
beaconState, err := benchutil.PreGenState1Epoch()
require.NoError(t, err)
block, err := benchutil.PreGenFullBlock()
require.NoError(t, err)

oldSlot := beaconState.Slot()
beaconState, err = state.ExecuteStateTransition(context.Background(), beaconState, block)
require.NoError(t, err, "Failed to process block, benchmarks will fail")
require.NotEqual(t, oldSlot, beaconState.Slot(), "Expected slots to be different")
}

func BenchmarkExecuteStateTransition_FullBlock(b *testing.B) {
benchutil.SetBenchmarkConfig()
beaconState, err := benchutil.PreGenState1Epoch()
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20201026171402-d4b8fe4fd877
google.golang.org/grpc v1.33.1
google.golang.org/protobuf v1.25.0
gopkg.in/confluentinc/confluent-kafka-go.v1 v1.4.2
gopkg.in/d4l3k/messagediff.v1 v1.2.1
gopkg.in/yaml.v2 v2.3.0
Expand Down
Loading