feat(vara.eth/ethexe): cap task processing - #5583
Draft
grishasobol wants to merge 6 commits into
Draft
Conversation
take_actual_tasks_capped drains at most MAX_SCHEDULE_TASKS_PER_MB (64) due tasks oldest-first; the excess stays in the schedule under original heights and runs in following blocks, keeping per-announce commitment size and gas bounded (#5204, #5203). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Schedule task handlers now pre-check the target (program known, entry present in mailbox/waitlist/stash) and skip with a warning when it is gone — an outdated task must not crash the validator or register a spurious state modification. Kind mismatches and storage corruption stay loud (#5204). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Integration: over-cap backlog defers exactly the tail at its original height and drains next block; a dangling task is skipped without aborting sibling program execution. Proptest: iterated capped drain equals the uncapped due-task sequence, each chunk within the cap. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Task processing shares PROGRAM_MODIFICATIONS_SOFT_LIMIT with queue processing; a 64-task block exhausted the whole budget and skipped queues entirely. Cap at half the budget (32) so queues always retain headroom (audit finding). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
many_waits and cross_height_wake_drain schedule more wakes than MAX_SCHEDULE_TASKS_PER_MB allows per announce — drive process_tasks the way consecutive blocks would until the backlog is empty. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5204 (part of the #5203 umbrella)
Summary
An announce commits to Ethereum as a single transaction, so unbounded scheduled-task bursts (e.g. many mailbox expiries landing on one block) could make an announce permanently uncommittable.
process_tasksnow drains at mostMAX_SCHEDULE_TASKS_PER_MB = 64due tasks per announce (InBlockTransitions::take_actual_tasks_capped), oldest height first, deterministic order. The excess stays in the schedule at its original heights — it remains due on following blocks (natural re-scheduling) andremove_task(expiry, ...)from claim/reply paths keeps working for deferred entries.RemoveFromMailbox,SendDispatch,SendUserMessage,WakeMessage) pre-check their target via read-only state lookups and skip with a warning when the program is unknown or the mailbox/waitlist/stash entry is gone — instead of panicking the validator. Skipped tasks register no state modification, so they add nothing to the commitment. Kind mismatches and storage corruption stay loud.Test plan
ethexe-processor): cap+7 backlog → exactly 7 deferred at original height, fully drained next block; dangling tasks at same/past heights don't abort sibling PING/PONG executiontake_actual_tasks_cappedyields exactly the uncapped due-task sequence (nothing lost or reordered), each chunk within the capcargo nextest run -p "ethexe-*": 530/535 (5 failures = known Anvil flaky set, all pass in isolation)Notes
gas_allowanceis left to theethexe: set limits for one announce programs processing #5203 umbrella (task gas is currently always 0 and tasks run before queue processing).🤖 Generated with Claude Code