mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-01 12:38:40 +00:00
core/txpool/blobpool: silence GetRLP miss-log spam
BlobPool.GetRLP runs encodeForNetwork on whatever getRLP returns. On a miss getRLP returns an empty slice; encodeForNetwork then errors with "invalid blobTxForPool RLP: unexpected EOF" and the error path logs at ERROR level. Because TxPool.GetRLP probes every subpool in order, every legacy-tx hash query hits the blob pool first and triggers this log line. On a busy node this floods the logs. Short-circuit when getRLP returns empty: that is the documented "not in this pool" condition, mirroring what BlobPool.Get already does.
This commit is contained in:
parent
b2aa6987de
commit
6abf72e5bb
1 changed files with 5 additions and 1 deletions
|
|
@ -1575,12 +1575,16 @@ func (p *BlobPool) Get(hash common.Hash) *types.Transaction {
|
||||||
// e.g. type_byte || [..., version, [blobs], [comms], [proofs]]
|
// e.g. type_byte || [..., version, [blobs], [comms], [proofs]]
|
||||||
func (p *BlobPool) GetRLP(hash common.Hash) []byte {
|
func (p *BlobPool) GetRLP(hash common.Hash) []byte {
|
||||||
data := p.getRLP(hash)
|
data := p.getRLP(hash)
|
||||||
|
if len(data) == 0 {
|
||||||
|
// Not in this pool. The TxPool aggregator probes every subpool, so
|
||||||
|
// this is the common case for any non-blob hash; do not log.
|
||||||
|
return nil
|
||||||
|
}
|
||||||
rlp, err := encodeForNetwork(data)
|
rlp, err := encodeForNetwork(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to encode pooled tx into the network type", "hash", hash, "err", err)
|
log.Error("Failed to encode pooled tx into the network type", "hash", hash, "err", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return rlp
|
return rlp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue