good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 7f596e16 authored by Giulio Rebuffo's avatar Giulio Rebuffo Committed by GitHub
Browse files

added sleep (#3561)

parent 78974d78
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ import (
"sort"
"sync"
"sync/atomic"
"time"
"github.com/holiman/uint256"
"github.com/ledgerwatch/erigon-lib/gointerfaces"
......@@ -35,6 +36,7 @@ type assemblePayloadPOSFunc func(random common.Hash, suggestedFeeRecipient commo
var EthBackendAPIVersion = &types2.VersionReply{Major: 3, Minor: 0, Patch: 0}
const MaxPendingPayloads = 128
const payloadWaitTime = time.Millisecond
type EthBackendServer struct {
remote.UnimplementedETHBACKENDServer // must be embedded to have forward compatible implementations.
......@@ -269,7 +271,7 @@ func (s *EthBackendServer) EngineNewPayloadV1(ctx context.Context, req *types2.E
if header.Hash() != blockHash {
return &remote.EnginePayloadStatus{Status: remote.EngineStatus_INVALID_BLOCK_HASH}, nil
}
time.Sleep(payloadWaitTime)
// If another payload is already commissioned then we just reply with syncing
if atomic.LoadUint32(s.waitingForBeaconChain) == 0 {
// We are still syncing a commissioned payload
......@@ -340,7 +342,7 @@ func (s *EthBackendServer) EngineForkChoiceUpdatedV1(ctx context.Context, req *r
// MUST NOT begin a payload build process if forkchoiceState.headBlockHash doesn't reference a leaf of the block tree
// (i.e. it references an old block).
// https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#specification-1
time.Sleep(payloadWaitTime)
if atomic.LoadUint32(s.waitingForBeaconChain) == 0 {
return &remote.EngineForkChoiceUpdatedReply{
PayloadStatus: &remote.EnginePayloadStatus{Status: remote.EngineStatus_SYNCING},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment