Skip to content

fix: route the impersonated fork signer through the nonce queue - #2976

Open
apexearth wants to merge 1 commit into
masterfrom
fix/impersonated-signer-nonce-queue
Open

fix: route the impersonated fork signer through the nonce queue#2976
apexearth wants to merge 1 commit into
masterfrom
fix/impersonated-signer-nonce-queue

Conversation

@apexearth

Copy link
Copy Markdown
Contributor

getSigner() wraps the KMS and private-key branches in maybeWrap(), but branch 3 does not:

Branch Wrapped
1. AWS KMS return maybeWrap(new DirectKmsTransactionSigner(...))
2. DEPLOYER_PK / GOVERNOR_PK return maybeWrap(new ethers.Wallet(pk, provider))
3. FORK=true + IMPERSONATE return provider.getSigner(address)

Without the wrapper, sendTransaction never routes through wrapSignerWithNonceQueueV5, so Talos does not record the transaction. The visible symptom is a run that completes successfully with an empty transaction list.

-    return provider.getSigner(address);
+    return maybeWrap(provider.getSigner(address));

No awaitgetSigner() is synchronous on ethers v5 (5.7.2 here), unlike v6.

DATABASE_URL is present in the runner container, so maybeWrap() does attach the queue — nothing else was missing.

Why now

oplabs/talos#30 makes an anvil mainnet fork with an impersonated relayer the default dev environment, so branch 3 goes from rarely-exercised to the everyday path. Companion fix in arm-oeth: OriginProtocol/arm-oeth#339.

Worth a reviewer's judgement

The nonce queue does real work — rebroadcasts, fee bumps, replacements, driven by the NONCE_QUEUE_* settings. On a fork that is arguably the point (you exercise the production path), but dev transactions become managed rather than fire-and-forget. If you would rather impersonated runs stay lightweight, the alternative is recording them without the queue.

Not verified

I could not typecheck — the worktree has no node_modules. The change is a one-line call into maybeWrap(), already used twice in the same function, so it should be safe, but CI is the check.

getSigner() wraps the AWS KMS and private-key branches in maybeWrap(), but
branch 3 (FORK=true + IMPERSONATE) returns provider.getSigner(address)
directly. sendTransaction then bypasses wrapSignerWithNonceQueueV5 and Talos
never records the transaction — a run against a fork completes with an empty
transaction list.

DATABASE_URL is present in the runner container, so maybeWrap() does attach
the queue; nothing else was missing.

getSigner() is synchronous on ethers v5 (5.7.2 here), so no await is added.

Surfaced by talos making an anvil fork with an impersonated relayer the
default dev environment.
@apexearth

Copy link
Copy Markdown
Contributor Author

merge if you approve

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