Repository navigation
fix(typewriter): skip settlement when every enqueued mutation is rejected - #81
Merged
Merged
Conversation
…cted submit returned early only when the accepted-batch and enqueued queues were both empty. When there was no batch and every enqueued force-inclusion mutation was rejected by acceptMutation, it still sent an empty execute transaction and emitted a block event with no mutations. Nothing waits on that block, so it could go unfinalized before shutdown, and it wasted gas and a nonce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Problem
submitreturned early only when both the accepted-batch queue and the enqueued queue were empty. If there was no batch andacceptMutationrejected every enqueued force-inclusion mutation,submitstill sentexecute([], []). That spent a nonce and gas, and emitted a block event with no mutations in it. Nothing waits on that block, so a run could shut down before it was finalized.Fix
After the enqueued mutations are accepted or rejected, return early when there are no batches and no accepted force-included mutations. Nothing is lost by returning early here: rejected mutations have already emitted their rejected events, nothing has been persisted, and
commitsis empty.Testing
mainand passes on this branch:0x7aa621c50ac8152e4120bfb4c74d7a218f75fe7f9b7e00686363f4edfc3816a20x99cb123856ae62ade96e3a7d115a83792a1e1bcb738074182e16feab5c0d22e60xe7894e413081a714af99107bcdbc1723aa7b0a41a11f7c71c2d4a3ce618ea62ftsc --noEmitandbun testinpackages/typewriterpass (27/27).🤖 Generated with Claude Code