Skip to content

fix(typewriter): copy mutations from callers and listeners, and emit inclusion after it commits - #125

Merged
kyscott18 merged 2 commits into
mainfrom
fix/mutation-copies-await-inclusion
Nov 2, 2026
Merged

kyscott18 merged 2 commits into
mainfrom
fix/mutation-copies-await-inclusion

Conversation

@kyscott18

@kyscott18 kyscott18 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • execute deep-copies its input, and each on() listener gets its own deep copy of the event. Before this, a caller reusing its params or authorization, or a listener editing its event, changed what revm executed, the rows a queued persist inserts, and the settlement calldata.
  • Settlement waits for the inclusion write to commit before emitting included and tracking the block. Before this, a failed commit left listeners holding an inclusion the database never stored.
  • The simulation changes every value it passed to execute (after execute takes it) and every emitted event. On main, seed 0x02 fails with MutationExpiresTooSoonError. Removing only the listener copy fails the same way.

🤖 Generated with Claude Code

kyscott18 and others added 2 commits November 2, 2026 22:58
…inclusion after it commits

`execute` kept the caller's `params` and `authorization` by reference, and
every listener got the runtime's own objects. A caller or listener that
changed them changed what revm executed, the rows a queued persist inserts,
and the settlement calldata. `execute` now copies its input and each
listener gets its own copy.

Settlement emitted `included` before the inclusion write committed, so a
failed commit left listeners with an inclusion the database never stored.

The simulation now changes every input after `execute` takes it and every
event after it is emitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyscott18
kyscott18 merged commit 030d102 into main Nov 2, 2026
7 checks passed
@kyscott18
kyscott18 deleted the fix/mutation-copies-await-inclusion branch November 2, 2026 23:58
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.

1 participant