mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 12:10:05 +00:00
Update Eth1FollowDistance to 16 for minimal config (#4566)
* Update Eth1FollowDistance to 16 for minimal config * Merge branch 'master' into fix-minimal-config * Merge branch 'master' into fix-minimal-config * Merge branch 'master' into fix-minimal-config * Merge branch 'master' into fix-minimal-config * Merge branch 'master' into fix-minimal-config * Fix tests after minimal config changes
This commit is contained in:
parent
3e9bf58d81
commit
f6b4637a91
@ -268,7 +268,7 @@ func TestPendingDeposits_OutsideEth1FollowWindow(t *testing.T) {
|
||||
readyDeposits := []*dbpb.DepositContainer{
|
||||
{
|
||||
Index: 0,
|
||||
Eth1BlockHeight: 100,
|
||||
Eth1BlockHeight: 2,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("a"),
|
||||
@ -278,7 +278,7 @@ func TestPendingDeposits_OutsideEth1FollowWindow(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Index: 1,
|
||||
Eth1BlockHeight: 1001,
|
||||
Eth1BlockHeight: 8,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("b"),
|
||||
@ -291,7 +291,7 @@ func TestPendingDeposits_OutsideEth1FollowWindow(t *testing.T) {
|
||||
recentDeposits := []*dbpb.DepositContainer{
|
||||
{
|
||||
Index: 2,
|
||||
Eth1BlockHeight: 4000,
|
||||
Eth1BlockHeight: 400,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("c"),
|
||||
@ -301,7 +301,7 @@ func TestPendingDeposits_OutsideEth1FollowWindow(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Index: 3,
|
||||
Eth1BlockHeight: 5000,
|
||||
Eth1BlockHeight: 600,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("d"),
|
||||
@ -418,7 +418,7 @@ func TestPendingDeposits_FollowsCorrectEth1Block(t *testing.T) {
|
||||
readyDeposits := []*dbpb.DepositContainer{
|
||||
{
|
||||
Index: 0,
|
||||
Eth1BlockHeight: 1000,
|
||||
Eth1BlockHeight: 8,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("a"),
|
||||
@ -428,7 +428,7 @@ func TestPendingDeposits_FollowsCorrectEth1Block(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Index: 1,
|
||||
Eth1BlockHeight: 1010,
|
||||
Eth1BlockHeight: 14,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("b"),
|
||||
@ -692,10 +692,10 @@ func TestPendingDeposits_CantReturnMoreThanMax(t *testing.T) {
|
||||
}
|
||||
|
||||
depositTrie.Insert(depositHash[:], int(dp.Index))
|
||||
depositCache.InsertDeposit(ctx, dp.Deposit, uint64(dp.Index), dp.Index, depositTrie.Root())
|
||||
depositCache.InsertDeposit(ctx, dp.Deposit, height.Uint64(), dp.Index, depositTrie.Root())
|
||||
}
|
||||
for _, dp := range recentDeposits {
|
||||
depositCache.InsertPendingDeposit(ctx, dp.Deposit, uint64(dp.Index), dp.Index, depositTrie.Root())
|
||||
depositCache.InsertPendingDeposit(ctx, dp.Deposit, height.Uint64(), dp.Index, depositTrie.Root())
|
||||
}
|
||||
|
||||
bs := &Server{
|
||||
@ -857,7 +857,7 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
deps := []*dbpb.DepositContainer{
|
||||
{
|
||||
Index: 0,
|
||||
Eth1BlockHeight: 1000,
|
||||
Eth1BlockHeight: 8,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("a"),
|
||||
@ -867,7 +867,7 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Index: 1,
|
||||
Eth1BlockHeight: 1200,
|
||||
Eth1BlockHeight: 14,
|
||||
Deposit: ðpb.Deposit{
|
||||
Data: ðpb.Deposit_Data{
|
||||
PublicKey: []byte("b"),
|
||||
@ -889,7 +889,7 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
LatestBlockNumber: height,
|
||||
HashesByHeight: map[int][]byte{
|
||||
0: []byte("hash0"),
|
||||
476: []byte("hash1024"),
|
||||
12: []byte("hash12"),
|
||||
},
|
||||
}
|
||||
proposerServer := &Server{
|
||||
@ -908,7 +908,7 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
|
||||
p.Eth1Data = defEth1Data
|
||||
|
||||
result, err := proposerServer.defaultEth1DataResponse(ctx, big.NewInt(1500))
|
||||
result, err := proposerServer.defaultEth1DataResponse(ctx, big.NewInt(16))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -920,7 +920,6 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
|
||||
// TODO(2312): Add more tests for edge cases and better coverage.
|
||||
func TestEth1Data(t *testing.T) {
|
||||
|
||||
slot := uint64(10000)
|
||||
|
||||
p := &mockPOW.POWChain{
|
||||
@ -928,7 +927,7 @@ func TestEth1Data(t *testing.T) {
|
||||
slot * params.BeaconConfig().SecondsPerSlot: big.NewInt(4096),
|
||||
},
|
||||
HashesByHeight: map[int][]byte{
|
||||
3072: []byte("3072"),
|
||||
4080: []byte("4080"),
|
||||
},
|
||||
Eth1Data: ðpb.Eth1Data{
|
||||
DepositCount: 55,
|
||||
|
@ -815,7 +815,7 @@ func TestDepositBlockSlotAfterGenesisTime(t *testing.T) {
|
||||
t.Fatalf("Could not get the deposit block slot %v", err)
|
||||
}
|
||||
|
||||
expected := uint64(2405)
|
||||
expected := uint64(53)
|
||||
|
||||
if resp != expected {
|
||||
t.Errorf("Wanted %v, got %v", expected, resp)
|
||||
|
@ -261,6 +261,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
|
||||
minimalConfig.MinValidatorWithdrawabilityDelay = 256
|
||||
minimalConfig.PersistentCommitteePeriod = 2048
|
||||
minimalConfig.MinEpochsToInactivityPenalty = 4
|
||||
minimalConfig.Eth1FollowDistance = 16
|
||||
minimalConfig.SafeSlotsToUpdateJustified = 2
|
||||
|
||||
// State vector lengths
|
||||
|
Loading…
Reference in New Issue
Block a user