Skip to content

feat(vara.eth/ethexe-consensus): squash transitions before BatchFiller for accurate batch sizing - #5581

Draft
grishasobol wants to merge 5 commits into
masterfrom
gsobol/ethexe/squash-before-filler
Draft

feat(vara.eth/ethexe-consensus): squash transitions before BatchFiller for accurate batch sizing#5581
grishasobol wants to merge 5 commits into
masterfrom
gsobol/ethexe/squash-before-filler

Conversation

@grishasobol

Copy link
Copy Markdown
Member

Closes #5356

Summary

  • Add incremental TransitionsSquasher (refactored from squash_transitions_by_actor internals, which stays as a thin wrapper).
  • Producer path (try_include_chain_commitment) now trial-fits the squashed and sorted payload — the exact bytes that end up in the chain commitment — so repeated-actor transitions are charged against the batch size budget once, not per MB. Previously the budget was charged pre-squash, under-filling batches.
  • BatchFiller::into_parts() becomes a plain accessor; the squash/sort responsibility moves before inclusion. Debug asserts in include_chain_commitment enforce the "squashed + negative-value-first" invariant.
  • Participant path is unchanged: it already re-derives squash→sort over the same MB range, so digests still match byte-for-byte.

Test plan

  • Unit: producer fits all MBs when the budget only covers the squashed payload (pre-squash charge would have stopped early)
  • Unit: into_parts returns the chain commitment unchanged; unsquashed input trips the debug assert
  • Integration: tight-budget coordinator → default-limit participant round-trip accepts with matching digest
  • Proptests: squash idempotence; incremental == one-shot; signed value_to_receive vs i128 reference model; first-seen order; negative-first stable sort
  • cargo nextest run -p "ethexe-*": 532/538 passed locally; 6 failures are the known Anvil flaky-under-load set, all pass in isolation
  • fmt / clippy / shear / hakari / doc tests clean

🤖 Generated with Claude Code

grishasobol and others added 4 commits June 11, 2026 22:09
…atch size

Introduce incremental TransitionsSquasher and make the producer trial-fit
the squashed+sorted payload — the exact bytes that end up in the chain
commitment — so repeated-actor transitions are charged once (#5356).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lain accessor

Squash+sort now happens on the producer path before inclusion, so the
filler only enforces the invariant (debug asserts) instead of mutating.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…izing

Unit: producer fits both MBs when the budget only covers the squashed
payload; into_parts no longer mutates; filler rejects unsquashed input.
Integration: tight-budget coordinator → default participant round-trip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Idempotence, incremental==one-shot, signed value_to_receive vs i128
reference model, first-seen order, negative-first stable sort.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@grishasobol grishasobol added type: feat New functionality or user-visible improvement scope: vara.eth Vara Ethereum application layer (L2) ai-generated Created entirely by an AI agent without direct human authorship labels Jun 11, 2026
… accepted

Capture last_advanced_eth_block from the accepted trial instead of
re-reading mb_meta after the loop — removes the implicit assumption
that MB metadata is stable between probe and include (audit finding).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Created entirely by an AI agent without direct human authorship scope: vara.eth Vara Ethereum application layer (L2) type: feat New functionality or user-visible improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Squash transitions before BatchFiller for accurate batch sizing

1 participant