Skip to content

Commit 7506c05

Browse files
authored
fix: handle type 4/EIP-7702 txs in statistics.WriteExecutionChartSeriesForDay (#1573)
1 parent b93f480 commit 7506c05

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

backend/pkg/commons/db/statistics.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,7 @@ func WriteExecutionChartSeriesForDay(day int64) error {
17391739
// priority fee is capped because the base fee is filled first
17401740
tipFee = decimal.Min(prioFee, maxFee.Sub(baseFee))
17411741
blobTxCount += 1
1742+
17421743
// totalMinerTips = totalMinerTips.Add(tipFee.Mul(gasUsed))
17431744
txFees = baseFee.Mul(gasUsed).Add(tipFee.Mul(gasUsed))
17441745
totalTxSavings = totalTxSavings.Add(maxFee.Mul(gasUsed).Sub(baseFee.Mul(gasUsed).Add(tipFee.Mul(gasUsed))))
@@ -1748,6 +1749,13 @@ func WriteExecutionChartSeriesForDay(day int64) error {
17481749
totalBurnedBlob = blobGasUsed.Mul(decimal.NewFromBigInt(new(big.Int).SetBytes(tx.BlobGasPrice), 0))
17491750
totalBlobCount = totalBlobCount.Add(decimal.NewFromInt(int64(len(tx.BlobVersionedHashes))))
17501751

1752+
case 4:
1753+
// EIP-7702
1754+
// priority fee is capped because the base fee is filled first
1755+
tipFee = decimal.Min(prioFee, maxFee.Sub(baseFee))
1756+
txFees = baseFee.Mul(gasUsed).Add(tipFee.Mul(gasUsed))
1757+
totalTxSavings = totalTxSavings.Add(maxFee.Mul(gasUsed).Sub(baseFee.Mul(gasUsed).Add(tipFee.Mul(gasUsed))))
1758+
17511759
default:
17521760
log.Fatal(fmt.Errorf("error unknown tx type %v hash: %x", tx.Status, tx.Hash), "", 0)
17531761
}

0 commit comments

Comments
 (0)