Skip to content

feat(core)!: optionally credit burnt base fee to coinbase address#299

Open
alarso16 wants to merge 6 commits into
mainfrom
alarso16/after-tx-tracer
Open

feat(core)!: optionally credit burnt base fee to coinbase address#299
alarso16 wants to merge 6 commits into
mainfrom
alarso16/after-tx-tracer

Conversation

@alarso16

@alarso16 alarso16 commented Jul 21, 2026

Copy link
Copy Markdown

Why this should be merged

Coreth and Subnet-EVM both credit the entire base fee and tip to the coinbase, which is enforced at verification time to be a specific blackhole address. Prior to #294, this wasn't possible at all through libevm, and was performed after core.ApplyMessage in SAE.

The previous solution with the AfterExecutingTransaction hook allows modifying the statedb to reflect the blackhole updates, but the tracers did not capture these changes, as CaptureTxEnd had already been called. Additionally, the API surface cannot include arbitrary operations on the StateDB, since the tracers wouldn't know which accounts/storage to look at during GetResult.

How this works

Reverts all prod changes of #294 and provides a different hook which is more targeted to the specific problem SAE faces.

How this was tested

UT including the prestate tracer to ensure that the common tracer workflows are correctly updated.

@alarso16 alarso16 added the Status: 🔴 DO NOT MERGE This PR is not meant to be merged in its current state label Jul 21, 2026
@alarso16
alarso16 marked this pull request as ready for review July 21, 2026 22:27
@alarso16

Copy link
Copy Markdown
Author

DO NOT MERGE until ava-labs/avalanchego#5721 is reviewed

@alarso16 alarso16 changed the title refactor(core): Correctly apply state changes from rules to tracers refactor(core)!: Correctly apply state changes from rules to tracers Jul 22, 2026
Comment thread core/state_transition.libevm.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm.go
Comment thread core/state_transition.libevm_test.go
Comment thread core/state_transition.libevm.go Outdated
Comment thread core/state_transition.libevm.go Outdated
Comment thread core/state_transition.libevm.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
testErr = errors.New("test error")
baseFee = 3
tip = 2
feeCap = baseFee + tip + 1 // not binding, so the effective tip is [tip]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "not binding"?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that the fee cap just must be greater than baseFee and tip, but not the whole thing was applied

Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm_test.go
Comment thread core/state_transition.libevm_test.go Outdated
Comment thread core/state_transition.libevm_test.go Outdated
@ARR4N ARR4N changed the title refactor(core)!: Correctly apply state changes from rules to tracers feat(core)!: optionally credit burnt base fee to coinbase address Jul 23, 2026

@ARR4N ARR4N left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you update the PR description to explain the end goal of the feature, not why the last one didn't work. Otherwise LGTM

@StephenButtolph StephenButtolph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will wait to merge until we are closer to merging the stateful RPCs PR.

Don't need to keep merging PRs into libevm if we need to change them immediately after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Bug 🐛 Something isn't working Status: 🔴 DO NOT MERGE This PR is not meant to be merged in its current state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants