Skip to content

Backport release/v6.4: giga: report EIP-1559 effective gas price on receipt (CON-256)#3390

Merged
masih merged 1 commit intorelease/v6.4from
backport-3384-to-release/v6.4
May 5, 2026
Merged

Backport release/v6.4: giga: report EIP-1559 effective gas price on receipt (CON-256)#3390
masih merged 1 commit intorelease/v6.4from
backport-3384-to-release/v6.4

Conversation

@seidroid
Copy link
Copy Markdown

@seidroid seidroid Bot commented May 5, 2026

Backport of #3384 to release/v6.4.

GIGA's `executeEVMTxWithGigaExecutor` was passing `ethTx.GasPrice()`
into the `core.Message` used to construct the receipt. For dynamic-fee
(EIP-1559) txs `Transaction.GasPrice()` returns `GasFeeCap`, so the
receipt wrongly reported `maxFee` for any tx that actually paid `baseFee
+ tip < maxFee`.

This breaks EIP-1559 RPC semantics for clients (ethers, hardhat-ethers,
etc.) that read `receipt.effectiveGasPrice` to compute spend / display
per-tx cost.

## What's actually wrong

V2's `x/evm/keeper/msg_server.go` constructs the message via
`server.GetEVMMessage(ctx, tx, sender)`, which has the EIP-1559
adjustment built in:

```go
baseFee := k.GetBaseFee(ctx)
if baseFee != nil {
    msg.GasPrice = msg.GasPrice.Add(msg.GasTipCap, baseFee)
    if msg.GasPrice.Cmp(msg.GasFeeCap) > 0 {
        msg.GasPrice = msg.GasFeeCap
    }
}
```

GIGA's path hand-rolls a `core.Message` literal in
`executeEVMTxWithGigaExecutor` and missed this step.

## The fix

Use the already-computed `effectiveGasPrice` (line 1866 of `app/app.go`,
which already does `min(baseFee + tipCap, feeCap)` and is what the chain
actually charges via `stateDB.SubBalance` at line 1871) when
constructing the receipt's `core.Message`.

The chain's actual fee charge has always been correct — only the value
reported on the receipt was wrong.

## Things done

- [x] Single-line code change in `app/app.go
executeEVMTxWithGigaExecutor`: `GasPrice: ethTx.GasPrice()` → `GasPrice:
effectiveGasPrice`
- [x] Unit test in `giga/deps/xevm/keeper/receipt_test.go` documents the
`WriteReceipt` contract: `receipt.EffectiveGasPrice == msg.GasPrice`
(caller is responsible for passing the EIP-1559 effective price)
- [x] `gofmt -s` clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Masih H. Derkani <m@derkani.org>
(cherry picked from commit 7004ef1)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 5, 2026, 2:36 PM

@masih masih enabled auto-merge (squash) May 5, 2026 14:35
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.40%. Comparing base (5e40756) to head (357c2f4).

Files with missing lines Patch % Lines
app/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release/v6.4    #3390      +/-   ##
================================================
- Coverage         58.40%   58.40%   -0.01%     
================================================
  Files              2091     2091              
  Lines            173016   173016              
================================================
- Hits             101052   101051       -1     
- Misses            62959    62960       +1     
  Partials           9005     9005              
Flag Coverage Δ
sei-chain-pr 49.93% <0.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/app.go 68.55% <0.00%> (-0.07%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih merged commit d7db02a into release/v6.4 May 5, 2026
41 of 43 checks passed
@masih masih deleted the backport-3384-to-release/v6.4 branch May 5, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants