fix(GPO): failed to get block receipt during calculating suggest priority fee

This commit is contained in:
Morty 2025-08-07 22:17:46 +08:00
parent 49a914fc2a
commit 49c830f621

View file

@ -43,7 +43,12 @@ func (oracle *Oracle) calculateSuggestPriorityFee(ctx context.Context, header *t
// capacity margin
receipts, err := oracle.backend.GetReceipts(ctx, header.Hash())
if receipts == nil || err != nil {
log.Error("failed to get block receipts", "block number", header.Number, "err", err)
log.Error("failed to get block receipts during calculating suggest priority fee", "block number", header.Number, "err", err)
// If the lastIsCongested is true on the cache, return the lastPrice.
// We believe it's better to err on the side of returning a higher-than-needed suggestion than a lower-than-needed one.
if lastIsCongested {
return lastPrice, lastIsCongested
}
return suggestion, isCongested
}
var maxTxGasUsed uint64