Add beta4 spec test (#9565)

* Add beta4 spec tests

* Fix test setup for Altair registry update

* Update WORKSPACE

* Update churn limit calculation for e2e

* Hard set churn limit

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
terence tsao
2021-09-10 18:33:31 -07:00
committed by GitHub
parent 1374b6dd4f
commit 416840036a
7 changed files with 14 additions and 12 deletions

View File

@@ -197,7 +197,7 @@ filegroup(
url = "https://github.com/eth2-clients/slashing-protection-interchange-tests/archive/b8413ca42dc92308019d0d4db52c87e9e125c4e9.tar.gz",
)
consensus_spec_version = "v1.1.0-beta.3"
consensus_spec_version = "v1.1.0-beta.4"
http_archive(
name = "consensus_spec_tests_general",
@@ -211,7 +211,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "9a60392cbf06e2a6e17e46d8bdca3d56b9db7e261fad6085db6851f9b5b35008",
sha256 = "d2d501453cf29777896a5f9ae52e93921f34330e57fcc5b55e4982d4795236b9",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version,
)
@@ -227,7 +227,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "4df4d4c56c95853d423ac48e886c3d5fa258c39c47267c0c6afdc8566fa8c323",
sha256 = "b152f1f03a4fdacd1882fe867bdfbd5067e74ed3c532bd01d81e7adf6cc3737a",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version,
)
@@ -243,7 +243,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "bc8a081beeeef5bf49aa903c431a86409acd6876f02bf23f44d92f7e70c1d9e9",
sha256 = "6046f89c679a9ffda217dee6f021eb7c4fe91aad6ff940fae4d2cf894cc61cbb",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version,
)
@@ -258,7 +258,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "cea2a6c91d565660f54735f6be2bdea2ef91fe8ac71bff8f37866ae3a0f3af8a",
sha256 = "26a0a2c3022a3c5354f3204c7e441580df2e585dbde22a43a1d43f885b3a221c",
strip_prefix = "consensus-specs-" + consensus_spec_version[1:],
url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version,
)

View File

@@ -31,8 +31,8 @@ var exitedIndex types.ValidatorIndex
// valExited is used to know if exitedIndex is set, since default value is 0.
var valExited bool
// churnLimit is normally 4 unless the validator set is extremely large.
var churnLimit = uint64(4)
// churnLimit is 8 given ChurnLimitQuotient is 32 for minimal config.
var churnLimit = uint64(8)
var depositValCount = e2e.DepositCount
// Deposits should be processed in twice the length of the epochs per eth1 voting period.

View File

@@ -20,7 +20,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
minimalConfig.TargetCommitteeSize = 4
minimalConfig.MaxValidatorsPerCommittee = 2048
minimalConfig.MinPerEpochChurnLimit = 4
minimalConfig.ChurnLimitQuotient = 65536
minimalConfig.ChurnLimitQuotient = 32
minimalConfig.ShuffleRoundCount = 10
minimalConfig.MinGenesisActiveValidatorCount = 64
minimalConfig.MinGenesisTime = 1578009600

View File

@@ -5,6 +5,7 @@ import (
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/epoch"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/beacon-chain/state"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
"github.com/prysmaticlabs/prysm/spectest/utils"
@@ -17,6 +18,8 @@ func RunRegistryUpdatesTests(t *testing.T, config string) {
testFolders, testsFolderPath := utils.TestFolders(t, config, "altair", "epoch_processing/registry_updates/pyspec_tests")
for _, folder := range testFolders {
t.Run(folder.Name(), func(t *testing.T) {
// Important to clear cache for every test or else the old value of active validator count gets reused.
helpers.ClearCache()
folderPath := path.Join(testsFolderPath, folder.Name())
RunEpochOperationTest(t, folderPath, processRegistryUpdatesWrapper)
})

View File

@@ -30,7 +30,6 @@ go_library(
"//shared/testutil/require:go_default_library",
"//spectest/utils:go_default_library",
"@com_github_golang_snappy//:go_default_library",
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],

View File

@@ -14,7 +14,6 @@ import (
"github.com/prysmaticlabs/prysm/shared/testutil"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
"google.golang.org/protobuf/proto"
"gopkg.in/d4l3k/messagediff.v1"
)
type epochOperation func(*testing.T, state.BeaconState) (state.BeaconState, error)
@@ -62,8 +61,6 @@ func RunEpochOperationTest(
pbState, err := v1.ProtobufBeaconState(beaconState.InnerStateUnsafe())
require.NoError(t, err)
if !proto.Equal(pbState, postBeaconState) {
diff, _ := messagediff.PrettyDiff(beaconState.InnerStateUnsafe(), postBeaconState)
t.Log(diff)
t.Fatal("Post state does not match expected")
}
} else {

View File

@@ -5,6 +5,7 @@ import (
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/epoch"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/beacon-chain/state"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
"github.com/prysmaticlabs/prysm/spectest/utils"
@@ -18,6 +19,8 @@ func RunRegistryUpdatesTests(t *testing.T, config string) {
for _, folder := range testFolders {
t.Run(folder.Name(), func(t *testing.T) {
folderPath := path.Join(testsFolderPath, folder.Name())
// Important to clear cache for every test or else the old value of active validator count gets reused.
helpers.ClearCache()
RunEpochOperationTest(t, folderPath, processRegistryUpdatesWrapper)
})
}