Skip to content

EIP-8369 Profile 2 on current master, with a claim replay payer fix - #16470

Open
AnkushinDaniil wants to merge 4 commits into
masterfrom
feature/eip-8369-profile-2-on-master
Open

AnkushinDaniil wants to merge 4 commits into
masterfrom
feature/eip-8369-profile-2-on-master

Conversation

@AnkushinDaniil

Copy link
Copy Markdown
Contributor

#13590 merged with current master, plus fixes so it builds and passes tests there. Opened separately so #13590 stays as is.

On top of the merge:

  • Claim replay now bounds the payer by the escrow at the block's base fee. Master's fee budget escrows max_gas * base_fee plus the capped tip, but the replay still needed the full max_fee, so a payer balance in between let a tx land in a block while a claim that it wasn't includable at that index was also accepted. Test: Payer_is_bounded_by_the_escrow_at_the_blocks_base_fee.
  • InclusionCheckId ported to the RlpWriter.
  • EngineModuleTests.Eip8369: empty NonceKeys select the account nonce, 8 tests were failing.

Merge.Plugin.Test passes. Tried it on a local devnet with Lodestar.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AnkushinDaniil's task in 2m 2s —— View job


Review complete

  • Gather context (diff, prior comments)
  • Review Profile 2 replayer / validator / fee-budget fix
  • Post findings

No Critical, High or Medium findings, so I'd call this mergeable. I did not build the PR or run its tests. The full review is in this comment.

  • Claim replay payer fix (b988cfc24): correct. With FramePrefixAtBlockBaseFee, the replay now prices the payer's escrow with the same PriceFeeBudget inputs execution uses. That closes the case where a tx execution would include was still accepted as non-includable in an omission claim. The regression tests cover both sides of the boundary.
  • Merge onto master: the removed master code (in-block IL satisfaction checker, InclusionListUnsatisfied, prewarmer TransactionAt, the BlockRef guard) all belongs to the old IL design. The deleted tests only cover that design.
  • Low:
    • InclusionChecks.Start reads _checks.Count outside the lock. A stale value is harmless here.
    • The two test cases in Payer_is_bounded_by_the_escrow_at_the_blocks_base_fee would read better as a single bool parameter.

@claude

claude Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Review summary: EIP-8369 Profile 2 on master (#16470)

Scope: Most of this diff is #13590 merged onto master, and that content was reviewed there. Here I looked hardest at what is new in this PR: the claim replay payer fix, InclusionCheckId, the Eip8369 engine test fixes, and how the merge sits on master's processing pipeline (BranchProcessor, BlockchainProcessor, BlockCachePreWarmer, NewPayloadHandler, InclusionListValidator, InclusionChecks).

Payer bound fix (b988cfc24): correct

  • Execution prices the escrow with PriceFeeBudget(tx, opts, header, maxGas, blobFee, …) at the block's base fees. PricePrefixAtBlockBaseFee now gives the replay the same inputs: TryCalculateGasBudget for max_gas and the same TryCalculateBlobFees path. So the replay and execution compare the payer against the same max_cost and use the same GASPRICE.
  • The builder only writes a claim when execution reports invalidHere (BlockProductionTransactionsExecutor). Before this fix, the validator's replay required the full max_fee. A payer with a balance between the escrow and max_fee was included by execution but judged ineligible by the replay. That let a dishonest builder omit the tx, claim it, and have the omission excused. The fix closes that gap. The max_fee < required_max_fee rejection also matches execution.
  • FramePrefixAtBlockBaseFee = 512 doesn't collide with any other flag. Only Profile2EligibilityReplayer sets it. The mempool/admission FrameTxPrefixSimulator and LightClient paths still bound by max_fee, which is intended because inclusion base fees are unknown there.
  • The regression tests cover both sides of the boundary (exactly the escrow is eligible, 1 wei short is not) and the required_max_fee rejection.

Merge onto master

  • The removed master code is all for the old IL design: IInclusionListSatisfactionChecker, ProcessingResult.InclusionListUnsatisfied, the BAL-boundary reconstruction in BranchProcessor, TransactionAt in the prewarmer, and the InclusionListTransactions is null guard on BlockRef. The ~850 deleted test lines (NewPayloadHandlerRaceConditionTests, FinalizedBlockAccessListTests, BranchProcessorVerdictTests) all test that removed design. I found no master coverage unrelated to inclusion lists being dropped.
  • BlockchainProcessor can again enqueue a hash-only BlockRef under recovery pressure. Then GasUsedBeforeTransactions is set on the re-resolved instance, not the one NewPayloadHandler holds. I checked whether that loses the record. It doesn't: the handler reads it from _latestBlocks, and when the record is missing IsInclusionListSatisfied judges at both gas bounds and answers only when they agree. No issue.

Low

  • InclusionChecks.Start reads _checks.Count outside _lock. The value is only used to decide whether to look up the finalized number before evicting, so a stale read is harmless. It comes from EIP-8369: enforce Profile 2 omissions with claimed-index replay and per-IL VERIFY budget #13590 and needs no change.
  • Payer_is_bounded_by_the_escrow_at_the_blocks_base_fee(int offset, bool eligible): offset only ever selects escrow or escrow - 1, so a single [Values] bool oneWeiShort parameter would express the two cases more directly. Nit.

No Critical, High or Medium findings. I did not build the PR or run its tests (Merge.Plugin.Test passes according to the PR description).

🤖 AI agent (Claude Code / Opus 5.5) review

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AnkushinDaniil's task in 1m 25s —— View job


Review of PR #16470

  • Gather context (diff, prior comments, repo rules)
  • Review Profile 2 replayer / claim payer fix (b988cfc24)
  • Review InclusionCheckId FluentRlp port and Eip8369 engine test fixes
  • Post findings

Scope: #13590 was already reviewed, so I didn't re-review the merged diff (121 files, +4978/−3135). This review covers the three changes this PR adds on top of it. There were no earlier inline comments on this PR.

Claim replay payer bound (FramePrefixAtBlockBaseFee)

The fix is correct. With the flag set, PrepareValidationPrefixSimulation (TransactionProcessorBase.FrameTx.cs:810) now prices the payer bound the same way execution does (ExecuteFrameTx, :180-196):

  • It uses TryCalculateGasBudget, then the blob fee at the header's blob base fee, then PriceFeeBudget.
  • So the replay checks the same max_cost escrow and the same max_fee >= required_max_fee condition that would decide whether the tx can be included at that index. This closes the gap described in the PR body.
  • effectiveGasPrice now comes from FrameTxFeeBudget.GasPrice rather than CalculateEffectiveGasPrice. That means GASPRICE inside VERIFY frames during the replay returns the same value as in execution.

Two smaller points:

  • Signature estimation. The prefix path calls TryCalculateGasBudget without estimateSignatureBytes. That's safe here because the prefix path already rejects empty signatures (allowEmptySignatures: false), so the result matches execution.
  • Other callers. Mempool admission (FrameTxPrefixSimulator) and LightClient/EvmExecutor don't pass the new flag. They keep the base-fee-free max_fee bound, as they should, because the inclusion base fee isn't known yet.

The regression tests check the right things. Payer_is_bounded_by_the_escrow_at_the_blocks_base_fee sets the balance to exactly the escrow and to one wei short. Assume.That(escrow < tx.MaxFee) ensures the test would have failed before the fix. Max_fee_below_the_required_max_fee_at_the_blocks_base_fee_is_ineligible covers the new required_max_fee rejection, which the old path didn't have.

InclusionCheckId → RlpWriter

The encoding matches the documented RLP([blockHash, [[tx...]...], [[hash, index]...]]): the outer sequence, then one sequence per inclusion list, then one per claim. InclusionCheckIdTests pins the output.

Findings

No Critical, High or Medium findings in the changes added on top of #13590.

Low:

  • Profile2EligibilityReplayerTests.cs:79-81: the int offset parameter is only used for its sign (offset < 0 ? escrow - 1 : escrow). A bool such as oneWeiShort would make the two cases easier to read.

I didn't build the code or run tests in this job. The PR description says Merge.Plugin.Test passes.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Stateless guest cost

block steps Δ steps prover cost Δ cost
11957686 251,689,596 -0.005% 26,847,652,451 -0.004%
11962410 149,157,335 -0.006% 15,829,014,955 -0.006%
11962415 180,210,084 -0.004% 19,290,319,585 -0.004%
11962427 153,151,763 -0.006% 16,139,224,453 -0.005%
11962485 157,259,414 -0.006% 16,790,021,645 -0.005%
25526356 85,494,880 -0.009% 14,363,288,036 -0.005%
25532382 91,363,789 -0.010% 16,317,762,862 -0.005%
25532442 102,120,066 -0.010% 16,609,334,776 -0.006%
25532454 109,141,639 -0.008% 18,243,081,146 -0.005%
25532553 96,012,549 -0.005% 15,889,694,529 -0.003%
25532642 99,756,971 -0.009% 16,614,876,387 -0.005%
all 11 blocks 1,475,358,086 -0.006% 192,934,270,825 -0.005%
Variable cost by bucket, summed over shared blocks (excludes BASE)
bucket before after Δ
MAIN 91,478,142,234 91,472,201,332 -0.006%
OPCODES 19,323,280,223 19,320,565,316 -0.014%
PRECOMPILES 58,259,599,129 58,259,256,787 -0.001%
MEMORY 20,745,441,411 20,744,907,998 -0.003%

9e7d0bc4542e (merge commit) · 11 pinned blocks · ziskemu is deterministic, so these figures are exact and any non-zero delta is real.

Compared against 6a75f6443f5a.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

EVM Opcode Benchmark Diff

Aggregated runs: base=3, pr=3
Noisy rerun opcodes: BYTE, PUSH32, SWAP5

Regressions (1)

Opcode Base Median (ns) PR Median (ns) Delta Abs Δ (ns) Base CV PR CV Threshold Uncertainty Effective
MOD 113.416 124.501 +9.77% 11.085 1.0% 1.7% ±5.0% ±2.1% ±5.0%

@AnkushinDaniil

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AnkushinDaniil's task in 1m 8s —— View job


Review of PR #16470: the three new commits

  • Gather context (prior reviews, new commits since the last review)
  • Review 7b24bf890 (EIP-8037 two-dimension full-block shortcut)
  • Review 97938c040 (undecided replay propagation)
  • Review 56c481f10 (fork MAX_VERIFY_GAS_PER_TX for classification and replay)
  • Post findings

Scope: the earlier reviews covered the merged diff and b988cfc24. This one covers only the three commits that answer benaadams' review comments.

Result: one Medium finding, so not mergeable yet. Most of the work is in place: the three commits correctly address benaadams' points for newPayload validation. The remaining gap is that block production still uses the local cap.

7b24bf890: full-block shortcut under EIP-8037: correct

  • Under EIP-8037, block.GasUsed + minIntrinsicGas > block.GasLimit no longer excuses every omission. The check now falls through to the per-tx fit, which compares both gas dimensions.
  • The cost is one IL pass on blocks that are full by execution gas. That is bounded by the IL size, so it's fine.

97938c040: undecided replay: correct

  • AreEligible now returns null where it previously returned true. AnyUnjustified still returns early on a proved true, so an omission that is provably censorship still condemns the block even when other candidates are undecided.
  • RequestReplayer caches only decided verdicts, so a later call retries the undecided ones.
  • null reaches EvaluateAsync through Answer(...), which already used null to mean "state unavailable". So no undecided result is cached as final.
  • EvaluateWithUnknownGasDimensions: the maximum-gas pass returns its result as is (false or null), and the other two bounds require is true. That agrees with "answer only when every bound agrees".
  • IsSatisfied stays as a wrapper that treats undecided as unsatisfied. That's the conservative choice.

56c481f10: fork cap for validation: incomplete (Medium)

NewPayloadHandler and Profile2EligibilityReplayer now use Eip8369Constants.MaxVerifyGasPerTx, as requested. Block production still uses the local FocilProfile2MaxVerifyGas in two places:

  • PostMergeBlockProducer.cs:58, for the claimable candidate set.
  • InclusionListTxSource.cs:48/:60, which filters which frame txs are offered at all.

So with any non-default config value, this node builds blocks that validators judge as not satisfying the inclusion lists:

  • Local cap below the fork's: a frame tx whose VERIFY cost falls between the two caps is dropped from the offered txs and never claimed. Validators count it as a candidate, so the unclaimed omission condemns the block.
  • Local cap above the fork's, or 0: the budget fill admits costlier entries first. A later entry that the fork's fill would admit can be pushed out, and it is then dropped without a claim.

The new IBlocksConfig description says the setting doesn't affect block validity, but that's only true for GetInclusionListTransactionsHandler. The Eip8369Constants remark calling the config "the operator-facing mirror" is also stale now.

The default value (262144) equals the fork constant, so default setups are unaffected. Details are in the inline comment. Fix this →

Summary

Severity Count
Critical 0
High 0
Medium 1
Low 0

I did not build the PR or run its tests in this job.

🤖 AI agent (Claude Code / Opus 5.5) review

blockToProduce.Transactions = inclusionList;
}
}
blockToProduce.InclusionListCandidates = inclusionListTxSource?.GetProfile2Candidates(payloadAttributes, _blocksConfig.FocilProfile2MaxVerifyGas);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Medium: after 56c481f, newPayload judges with Eip8369Constants.MaxVerifyGasPerTx, but block production still uses the local FocilProfile2MaxVerifyGas. It is used here for the claimable set, and in InclusionListTxSource.GetTransactions (_maxVerifyGasPerTx, line 48) to filter which frame txs are offered at all.

If an operator sets a different cap, this node builds blocks that its own and other validators judge as not satisfying the inclusion lists:

  • Local cap < fork cap: a frame tx whose VERIFY cost falls between the two caps is filtered out of the offered txs and never claimed. Validators count it as a candidate, so the unclaimed omission condemns the block.
  • Local cap > fork cap, or 0: the per-IL budget fill admits costlier entries first, which can use up budget the fork's fill gives to a later entry. That entry is then filtered out and omitted without a claim.

The new config description ("It does not affect block validity … this node lists when building an inclusion list") only holds for GetInclusionListTransactionsHandler. Pass Eip8369Constants.MaxVerifyGasPerTx here and in InclusionListTxSource, and keep the config only for IL building. The remark on Eip8369Constants calling the config "the operator-facing mirror" is now stale too. A regression test could build a block with FocilProfile2MaxVerifyGas below a candidate's VERIFY cost and assert that newPayload still reports the lists as satisfied.

🤖 AI agent (Claude Code / Opus 5.5) review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Co-authored-by: Marc Harvey-Hill <10379486+Marchhill@users.noreply.github.com>
Co-authored-by: Stavros Vlachakis <89769224+svlachakis@users.noreply.github.com>
Co-authored-by: Manuel Arto <43347768+manusw7@users.noreply.github.com>
Co-authored-by: Alexey Osipov <me@flcl.me>
Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
@AnkushinDaniil
AnkushinDaniil force-pushed the feature/eip-8369-profile-2-on-master branch from e151a2e to d2c4569 Compare November 28, 2026 15:42

@svlachakis svlachakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I checked the new gas-dimension guard and the retry path for missing replay state. The remaining cap mismatch also affects locally built blocks. A lower configured cap can remove a candidate from both transaction selection and the omission-claim set. Use the fork cap for both payload build paths and keep the config for building inclusion lists. Existing thread

@AnkushinDaniil

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AnkushinDaniil's task in 50s —— View job


Review of PR #16470: new commit 82cb885

  • Gather context (prior reviews, the new commit)
  • Review 82cb885 (fork MAX_VERIFY_GAS_PER_TX in block production)
  • Post findings

Scope: the earlier reviews covered the merged diff, b988cfc24, 7b24bf890, 97938c040 and 56c481f10. This review covers only 82cb885, which answers the Medium finding from the last review and @svlachakis's comment about the cap mismatch.

Result: the Medium finding is resolved and there are no new Critical, High or Medium findings, so I consider this mergeable. Two Low notes are below.

82cb885: fork cap in block production: correct

  • PostMergeBlockProducer.cs:58 now builds the claimable candidate set with Eip8369Constants.MaxVerifyGasPerTx. So does InclusionListTxSource.GetTransactions, which decides which frame txs are offered.
  • The IBlocksConfig constructor parameter and _maxVerifyGasPerTx are removed from InclusionListTxSource. Autofac registers it with AddSingleton<InclusionListTxSource>() (MergePlugin.cs:208), so dropping the optional parameter breaks no wiring.
  • Both build paths and newPayload now use the same cap. A non-default local setting can no longer make this node build a block that it or other validators judge as not satisfying the inclusion lists.
  • The only place FocilProfile2MaxVerifyGas is still read is GetInclusionListTransactionsHandler.cs:33, which builds inclusion lists. That matches the config description, and the remark on Eip8369Constants is updated to say the same.
  • The regression test NewPayloadV6_accepts_the_claims_of_a_block_built_under_a_lower_local_cap sets the local cap to 1 and checks two things: the built block claims the frame tx at index 0, and newPayload reports the lists as satisfied. It would have failed before this commit. The InclusionListTxSourceTests case that lifted the cap through config is now a single fixed-cap test, which is correct now that the config no longer reaches the tx source.

Low

  • Unused parameter (IInclusionListTxSource.cs:21): every caller of GetProfile2Candidates now passes the fork constant, so maxVerifyGasPerTx and the cap-keyed candidate cache (InclusionListTxSource.cs:43, :62) no longer do anything. The interface method is new in this PR, so it can be removed at no cost. Removing it also stops a future caller from building with the local cap again. Inline · Fix this →
  • Misplaced doc comment (EngineModuleTests.Eip8369.cs:84): the <summary> "Claims change the verdict…" sits above NewPayloadV6_classifies_candidates_by_the_forks_verify_gas_cap_whatever_the_local_cap, but it describes NewPayloadV6_does_not_reuse_a_verdict_checked_under_other_claims. Inline

Summary

Severity Count
Critical 0
High 0
Medium 0
Low 2

I did not build the PR or run its tests in this job.

🤖 AI agent (Claude Code / Opus 5.5) review


/// <summary>The build's Profile 2 candidates that some committee position's VERIFY budget fill admits, so the
/// build answers each it fails to append with an omission claim; <c>null</c> when there are none.</summary>
IReadOnlySet<Hash256AsKey>? GetProfile2Candidates(PayloadAttributes? payloadAttributes, ulong maxVerifyGasPerTx);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Low: after 82cb885, both production callers (PostMergeBlockProducer.cs:58 and InclusionListTxSource.GetTransactions) pass Eip8369Constants.MaxVerifyGasPerTx, and only the test wrapper in EngineModuleTests.V7.cs:1160 forwards the parameter. So maxVerifyGasPerTx is now always the fork constant. The cap-keyed cache check (cached.MaxVerifyGasPerTx == maxVerifyGasPerTx, InclusionListTxSource.cs:62) and the tuple field exist only to support it.

This interface method is added in this PR, so dropping the parameter costs no compatibility. It would also make it impossible for a future caller to build with the local cap again, which is the bug fixed here. AGENTS.md says: "If a change makes existing code unused, remove it."

🤖 AI agent (Claude Code / Opus 5.5) review

Assert.That(newPayload.Data.Status, Is.EqualTo(PayloadStatus.Valid), newPayload.Result.Error);
}

/// <summary>Claims change the verdict, so the same block and lists under other claims are another check.</summary>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Low (nit): this <summary> belongs to NewPayloadV6_does_not_reuse_a_verdict_checked_under_other_claims, a few tests below. It ended up above ..._classifies_candidates_by_the_forks_verify_gas_cap_... when that test was inserted. Move it down, or drop it.

🤖 AI agent (Claude Code / Opus 5.5) review

if (transaction.SenderAddress is not { } sender) return false;
if (!IsNonceValid(state, transaction, sender)) return false;

FrameTxValidationTracer tracer = new(sender, Eip8141Constants.ExpiryVerifierAddress, state, spec,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Profile 2 replay inherits the public-mempool HasMutableCode check, so EXTCODEHASH on an undelegated contract containing SETCODEFROM can wrongly excuse an omission. Disable the bytecode-presence check for replay while keeping the restriction on executing SETCODEFROM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch, replay now skips the bytecode scan and only bans actually running SETCODEFROM, added a test for EXTCODEHASH on such a contract (520f3c7)

…rget's code holds it

The public-mempool HasMutableCode check refuses any target whose bytecode contains SETCODEFROM, because a mempool must not admit a tx whose validity another tx can flip. EIP-8369 replay judges one fixed state, so that check let EXTCODEHASH on an undelegated contract holding SETCODEFROM wrongly excuse an omission. Replay now skips the bytecode-presence check and still refuses executing SETCODEFROM in the prefix.
…and move a misplaced test summary

Every caller passed the fork cap, so the candidate fill always runs under MAX_VERIFY_GAS_PER_TX.

@svlachakis svlachakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The local block builder now uses the fork cap for transaction selection and omission claims. The new replay tests distinguish code containing SETCODEFROM from a frame that executes it. The CI change guard still needs an independent workflow code-owner approval for this head. CI

This branch has not been deployed

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

Labels

configuration devops eip evm taiko related to the taiko alethia rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants