Skip to content

Record journal-driven fees around the root call (Base 0x79) - #74

Merged
sduchesneau merged 10 commits into
release/base-2.xfrom
feature/aa-transaction-type
Oct 21, 2026
Merged

sduchesneau merged 10 commits into
release/base-2.xfrom
feature/aa-transaction-type

Conversation

@sduchesneau

@sduchesneau sduchesneau commented Oct 20, 2026 •

Copy link
Copy Markdown

Base's account abstraction transactions (type 0x79) charge a payer, apply account changes, increment nonces and emit protocol logs on the journal before the root call, then refund the payer and credit the fee recipients after the last call. The inspector skipped the pre-root journal and derived gas purchase, refund and tip from the caller, so all of that was lost or misattributed.

  • RootJournalReasons, set per transaction through FirehoseInspectorApi::set_root_journal_reasons (from the chain's PreTxAdjust). For that transaction the inspector replays the pre-root journal (balances, nonces, code, storage, logs) inside the root call, labels balance changes read outside the calls below the root with the configured reasons, and synthesizes no gas purchase, refund or reward.
  • In that mode the inspector keeps the journal entries it processed and rewinds to the longest prefix still in the journal, since Base rolls back a failed phase after its calls returned and then appends the settlement entries outside any call. It also starts the transaction from position 0, as the block's system calls leave the positions behind.
  • PreTxAdjust::adjust_tx_event receives the transaction env: the EVM context does not hold it yet when the hook runs.
  • The mapper passes account_abstraction_trx_input: None; the chain fills it.
  • firehose-tracer points at Trace account abstraction transactions (type 0x79) evm-firehose-tracer-rs#38 (5.7.0, TxType::AccountAbstraction).

Before merge: merge #75 first; it switches firehose-tracer to the crates.io release 5.7.0. This branch alone still points at a tracer branch that was deleted after its merge.

Consumed by the matching streamingfast/base PR. Plan: streamingfast/base#24.

Base's account abstraction transactions charge a payer, write protocol
state before the root call and settle fees after it, all on the journal.
A per-transaction RootJournalReasons records those writes with the right
reasons instead of the gas accounting derived from the caller.
The EVM context does not hold the transaction yet when the hook runs, so
a chain could not read fields the envelope-derived event does not carry.
Base rolls back a failed account abstraction phase after its calls
returned, then settles fees outside any call, so the journal can grow back
past the processed position over entries never processed.
The block's system calls leave the journal positions behind.
@sduchesneau
sduchesneau added this pull request to stack #76 October 20, 2026 20:09
@sduchesneau
sduchesneau marked this pull request as ready for review October 20, 2026 20:14
@dfuse-bot
dfuse-bot requested a review from billettc October 20, 2026 20:15
@sduchesneau
sduchesneau merged commit 19657a6 into release/base-2.x Oct 21, 2026
2 checks passed
@sduchesneau
sduchesneau deleted the feature/aa-transaction-type branch October 21, 2026 15:36
sduchesneau added a commit to streamingfast/base that referenced this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants