Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Jan 22, 2026

Explanation

  • What is the current state of things and why does it need to change?
    The addTransactionBatchWithHook function in the TransactionController was always generating a new batchId, even when a batchId was explicitly provided in the userRequest. This meant that the provided batchId was ignored when processing a batch through the publish batch hook route.
  • What is the solution your changes offer and how does it work?
    This change modifies addTransactionBatchWithHook to check for a batchId in the userRequest (via batchIdOverride) and use it if present. If no batchId is provided, it falls back to generating a new one, aligning its behavior with addTransactionBatchWith7702.
  • Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
    No.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Open in Cursor Open in Web


Note

Fix: batch ID propagation in hook path

  • addTransactionBatch (hook route) now uses request.batchId if provided, falling back to a generated ID (batch.ts)
  • Adds tests verifying returned batchId and propagation to nested addTransaction calls when using publishBatchHook (batch.test.ts)
  • Updates changelog entry under Fixed noting the behavior change

Written by Cursor Bugbot for commit 84c0534. This will update automatically on new commits. Configure here.

…ok route

Update addTransactionBatch to ensure that when a batchId is provided
in the request, it is used when going through the publish batch hook
route. Previously, the batchId was always generated even if one was
provided in the request.

This aligns the behavior with the EIP-7702 path which already uses
the provided batchId when available.

Co-authored-by: matthew.walsh <matthew.walsh@consensys.net>
@cursor
Copy link

cursor bot commented Jan 22, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: matthew.walsh <matthew.walsh@consensys.net>
@matthewwalsh0 matthewwalsh0 changed the title Publish batchId usage fix(transaction-controller): use provided batchId for hook batches Jan 22, 2026
@matthewwalsh0 matthewwalsh0 changed the title fix(transaction-controller): use provided batchId for hook batches fix(transaction-controller): use provided batchId in hook batches Jan 22, 2026
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review January 22, 2026 21:52
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners January 22, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants