From 7cf96692a97014bbc7c7b11b599823fbfb4538d4 Mon Sep 17 00:00:00 2001 From: kyscott18 <43524469+kyscott18@users.noreply.github.com> Date: Mon, 26 Oct 2026 22:58:39 +0000 Subject: [PATCH 1/2] fix(typewriter): skip settlement when every enqueued mutation is rejected 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 --- packages/typewriter/src/typewriter.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/typewriter/src/typewriter.ts b/packages/typewriter/src/typewriter.ts index d1a8904..9be98a2 100644 --- a/packages/typewriter/src/typewriter.ts +++ b/packages/typewriter/src/typewriter.ts @@ -1001,6 +1001,15 @@ export function createTypewriterEffect< ({ mutation }) => mutation, ); + // Every enqueued mutation was rejected and there is no batch, so a + // settlement would carry nothing. + if ( + batches.length === 0 && + acceptedForceIncludedMutations.length === 0 + ) { + return undefined; + } + if (acceptedEnqueuedMutations.length > 0) { commits.push( yield* persist((tx) => From 40b20ff0d5a8149f844acd8fbc6b85f291fdef06 Mon Sep 17 00:00:00 2001 From: kyscott18 <43524469+kyscott18@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:33:09 +0000 Subject: [PATCH 2/2] chore(typewriter): drop comment on empty settlement return Co-Authored-By: Claude Opus 5.5 --- packages/typewriter/src/typewriter.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/typewriter/src/typewriter.ts b/packages/typewriter/src/typewriter.ts index 9be98a2..7cc2c8e 100644 --- a/packages/typewriter/src/typewriter.ts +++ b/packages/typewriter/src/typewriter.ts @@ -1001,8 +1001,6 @@ export function createTypewriterEffect< ({ mutation }) => mutation, ); - // Every enqueued mutation was rejected and there is no batch, so a - // settlement would carry nothing. if ( batches.length === 0 && acceptedForceIncludedMutations.length === 0