Add Back Eth1 Block Delay (#4458)

* add delay
* Merge refs/heads/master into addBackDelay
* Merge refs/heads/master into addBackDelay
* Merge refs/heads/master into addBackDelay
* Merge refs/heads/master into addBackDelay
* Merge refs/heads/master into addBackDelay
This commit is contained in:
Nishant Das 2020-01-09 03:36:20 +08:00 committed by prylabs-bulldozer[bot]
parent 5ee79dc4a8
commit e110f038bc
3 changed files with 6 additions and 2 deletions

View File

@ -299,7 +299,7 @@ func (s *Service) requestBatchedLogs(ctx context.Context) error {
// We request for the nth block behind the current head, in order to have
// stabilized logs when we retrieve it from the 1.0 chain.
requestedBlock := s.latestEth1Data.BlockHeight
requestedBlock := s.latestEth1Data.BlockHeight - uint64(params.BeaconConfig().LogBlockDelay)
for i := s.latestEth1Data.LastRequestedBlock + 1; i <= requestedBlock; i++ {
err := s.ProcessETH1Block(ctx, big.NewInt(int64(i)))
if err != nil {

View File

@ -665,6 +665,10 @@ func TestConsistentGenesisState(t *testing.T) {
testAcc.Backend.Commit()
}
for i := 0; i < int(params.BeaconConfig().LogBlockDelay); i++ {
testAcc.Backend.Commit()
}
time.Sleep(2 * time.Second)
if !web3Service.chainStartData.Chainstarted {
t.Fatalf("Service hasn't chainstarted yet with a block height of %d", web3Service.latestEth1Data.BlockHeight)

View File

@ -174,7 +174,7 @@ var defaultBeaconConfig = &BeaconChainConfig{
// Prysm constants.
GweiPerEth: 1000000000,
LogBlockDelay: 2,
LogBlockDelay: 4,
BLSSecretKeyLength: 32,
BLSPubkeyLength: 48,
BLSSignatureLength: 96,