mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
core/txpool/blobpool: skip conversion if tx is already converted
This commit is contained in:
parent
e675f80e5d
commit
542595e0dc
1 changed files with 11 additions and 5 deletions
|
|
@ -986,16 +986,22 @@ func (p *BlobPool) convertLegacySidecar(sender common.Address, hash common.Hash,
|
||||||
log.Error("Blob transaction is corrupted", "hash", hash, "id", id, "err", err)
|
log.Error("Blob transaction is corrupted", "hash", hash, "id", id, "err", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// Skip conversion if the transaction does not match the expected hash.
|
|
||||||
// This can occur if the original transaction was evicted from the pool
|
// Skip conversion if the transaction does not match the expected hash, or if it was
|
||||||
// and the slot was reused by a new one.
|
// already converted. This can occur if the original transaction was evicted from the
|
||||||
|
// pool and the slot was reused by a new one.
|
||||||
if tx.Hash() != hash {
|
if tx.Hash() != hash {
|
||||||
log.Warn("Blob transaction was replaced", "hash", hash, "id", id, "stored", tx.Hash())
|
log.Warn("Blob transaction was replaced", "hash", hash, "id", id, "stored", tx.Hash())
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
sc := tx.BlobTxSidecar()
|
||||||
|
if sc.Version >= types.BlobSidecarVersion1 {
|
||||||
|
log.Debug("Skipping conversion of blob tx", "hash", hash, "id", id)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Perform the sidecar conversion, the failure is not expected and report
|
// Perform the sidecar conversion, the failure is not expected and report the error
|
||||||
// the error loudly if possible.
|
// loudly if possible.
|
||||||
if err := tx.BlobTxSidecar().ToV1(); err != nil {
|
if err := tx.BlobTxSidecar().ToV1(); err != nil {
|
||||||
log.Error("Failed to convert blob transaction", "hash", hash, "err", err)
|
log.Error("Failed to convert blob transaction", "hash", hash, "err", err)
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue