Skip to content
Draft
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions zk/txpool/pool_xlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package txpool
import (
"container/heap"
"context"
"fmt"
"math/big"
"slices"
"strings"
Expand All @@ -21,6 +22,7 @@ import (
"github.com/ledgerwatch/erigon/eth/ethconfig"
"github.com/ledgerwatch/erigon/zk/apollo"
"github.com/ledgerwatch/erigon/zkevm/hex"
"github.com/ledgerwatch/log/v3"
)

// free gas tx type
Expand Down Expand Up @@ -101,8 +103,13 @@ func (p *TxPool) bestForXLayer(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, a

// First wait for the corresponding block to arrive
if p.lastSeenBlock.Load() < onTopOf {
//log.Trace("Block not yet arrived, too early to process", "lastSeenBlock", p.lastSeenBlock.Load(), "requiredBlock", onTopOf)
return false, 0, nil
// Allow 1 block delay for normal gRPC notification latency
if onTopOf-p.lastSeenBlock.Load() <= 1 {
log.Warn(fmt.Sprintf("RISK_MONITOR: allowing gRPC notification delay, lastSeenBlock=%v, onTopOf=%v", p.lastSeenBlock.Load(), onTopOf))
} else {
//log.Trace("Block not yet arrived, too early to process", "lastSeenBlock", p.lastSeenBlock.Load(), "requiredBlock", onTopOf)
return false, 0, nil
}
}

p.lock.RLock()
Expand Down