Skip to content

feat: Support BatchV1_1#3371

Open
pdp2121 wants to merge 8 commits into
mainfrom
batch_v1_1
Open

feat: Support BatchV1_1#3371
pdp2121 wants to merge 8 commits into
mainfrom
batch_v1_1

Conversation

@pdp2121

@pdp2121 pdp2121 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

High Level Overview of Change

ripppled PR: XRPLF/rippled#6446
Related issues:
#3370
#3324

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users

Test Plan

Unit tests passed. Integration tests passed on standalone with BatchV1_1 enabled

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Extends the XLS-56 Batch signing protocol to V1_1 by adding account, sequence, batchAccount, and signerAccount fields to BatchObject in ripple-binary-codec and rewriting signingBatchData to serialize them in the new order. Updates signMultiBatch and combineBatchSigners in xrpl to bind and deduplicate these fields, with corresponding test fixtures, changelogs, and version bumps.

Changes

XLS-56 Batch V1_1 Signing Payload

Layer / File(s) Summary
BatchObject interface and signingBatchData serialization
packages/ripple-binary-codec/src/binary.ts, packages/ripple-binary-codec/HISTORY.md, packages/ripple-binary-codec/package.json
BatchObject expands from { flags, txIDs } to { account, sequence, flags, txIDs, batchAccount?, signerAccount? }. signingBatchData validates required fields and serializes the new V1_1 byte order: `HashPrefix.batch
encodeForSigningBatch single-sign and multi-sign tests
packages/ripple-binary-codec/test/signing-data-encoding.test.ts
Old generic batch blob test is replaced with two dedicated tests: one for single-signed BatchSigner (account/sequence/flags/txIDs/batchAccount) and one for multi-signed BatchSigner that additionally includes signerAccount, each asserting the exact encoded hex output.
signMultiBatch payload expansion and combineBatchSigners deduplication
packages/xrpl/src/Wallet/batchSigner.ts, packages/xrpl/HISTORY.md
Adds getBatchSeqValue helper to resolve Sequence vs TicketSequence for batch signing. signMultiBatch builds involved-account set from inner transactions' Account and Counterparty, validates batchAccount membership, and adds account, sequence, batchAccount, and conditional signerAccount to the signing payload. combineBatchSigners deduplicates sorted signers by BatchSigner.Account to ensure uniqueness.
Updated signMultiBatch test fixtures
packages/xrpl/test/wallet/batchSigner.test.ts
All five TxnSignature expected values are updated across secp256k1, ed25519, different account, multisign, and multisign + regular key test cases to match the expanded signing payload.
Cross-package dependency alignment
packages/xrpl/package.json
ripple-binary-codec dependency updated from ^2.8.0 to ^2.9.0-batch.1 to use the new V1_1 serialization implementation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • XRPLF/xrpl.js#3157: encodeForSigningBatch exported in the retrieved PR delegates to ripple-binary-codec's batch signing encoder, whose payload layout and required fields were changed in the main PR (via signingBatchData/BatchObject for XLS-56 Batch V1_1).

Suggested reviewers

  • mvadari
  • ckeshava

Poem

🐇 Hop, hop, the batch is signed anew,
With account and sequence baked right through!
V1_1 bytes in careful order laid,
No replay attack shall invade.
Deduplicated signers, sorted clean —
The fluffiest batch the ledger's seen! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Support BatchV1_1' directly and clearly describes the main feature being added, which is support for BatchV1_1 protocol in the codebase.
Description check ✅ Passed The description includes the overview with relevant links, specifies type of change, confirms HISTORY.md was updated, and describes testing performed. However, it lacks the detailed Context of Change section explaining design rationale.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch batch_v1_1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/xrpl/test/wallet/batchSigner.test.ts (1)

50-82: 💤 Low value

Consider adding a test case for TicketSequence.

The test transaction in beforeEach has no Sequence field, which results in getBatchSeqValue returning 0. While combineBatchSigners tests use Sequence: 215, there's no test coverage for the TicketSequence fallback path where Sequence is explicitly 0 and TicketSequence provides the value.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/xrpl/test/wallet/batchSigner.test.ts` around lines 50 - 82, The test
transaction in the beforeEach hook lacks coverage for the TicketSequence
fallback scenario in getBatchSeqValue. Currently, the RawTransaction objects
have Sequence values set (215 and 470) but no TicketSequence field, so the
fallback path where Sequence is 0 and TicketSequence should be used is not being
tested. Add a new test case or modify one of the existing RawTransaction objects
to set Sequence to 0 and include a TicketSequence field to ensure the
getBatchSeqValue function correctly returns the TicketSequence value when
Sequence is explicitly 0.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ripple-binary-codec/src/binary.ts`:
- Around line 216-218: The error message in the batch.flags null check uses
inconsistent quote styling with a backtick before flags and a single quote after
it. Fix this by updating the error message to use consistent backticks on both
sides of the field name, changing "No field `flags'" to "No field `flags`" to
match the quote style used in other error messages throughout the file.

---

Nitpick comments:
In `@packages/xrpl/test/wallet/batchSigner.test.ts`:
- Around line 50-82: The test transaction in the beforeEach hook lacks coverage
for the TicketSequence fallback scenario in getBatchSeqValue. Currently, the
RawTransaction objects have Sequence values set (215 and 470) but no
TicketSequence field, so the fallback path where Sequence is 0 and
TicketSequence should be used is not being tested. Add a new test case or modify
one of the existing RawTransaction objects to set Sequence to 0 and include a
TicketSequence field to ensure the getBatchSeqValue function correctly returns
the TicketSequence value when Sequence is explicitly 0.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 606b7a89-73e5-4777-bfdc-0e37c27a9a35

📥 Commits

Reviewing files that changed from the base of the PR and between acdc1a2 and a0a7bb1.

📒 Files selected for processing (6)
  • packages/ripple-binary-codec/HISTORY.md
  • packages/ripple-binary-codec/src/binary.ts
  • packages/ripple-binary-codec/test/signing-data-encoding.test.ts
  • packages/xrpl/HISTORY.md
  • packages/xrpl/src/Wallet/batchSigner.ts
  • packages/xrpl/test/wallet/batchSigner.test.ts

Comment thread packages/ripple-binary-codec/src/binary.ts
Comment thread packages/ripple-binary-codec/src/binary.ts
Comment thread packages/xrpl/src/Wallet/batchSigner.ts
Comment thread packages/xrpl/HISTORY.md
## Unreleased

### Changed
* Add XLS-56 Batch V1_1 support to `signMultiBatch` and `combineBatchSigners` ([XRPLF/rippled#6446](https://github.com/XRPLF/rippled/pull/6446)).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: A WIP tag will be helpful to identify that this PR has not been finalized yet.

{
"name": "ripple-binary-codec",
"version": "2.8.0",
"version": "2.9.0-batch.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was that beta releases have a suffix of the form: 2.9.0-beta-batch-1.

Are we sure this released is not interpreted as a "General Availability" release by the community? @pdp2121

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other feature beta/experimental releases are following the same pattern, for example:
https://github.com/XRPLF/xrpl.js/releases/tag/xrpl%404.7.0-smartcontract.0

@ckeshava ckeshava left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that we add BatchV1_1 feature into the xrpld.cfg file. This ensures that the CI-docker container enables this amendment + runs the tests with complete integrity.

Since this is a beta release anyway, we can refine the changes for GA release in the future. What do you think? @pdp2121

ckeshava
ckeshava previously approved these changes Jun 17, 2026
@pdp2121

pdp2121 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

I suggest that we add BatchV1_1 feature into the xrpld.cfg file. This ensures that the CI-docker container enables this amendment + runs the tests with complete integrity.

Since this is a beta release anyway, we can refine the changes for GA release in the future. What do you think? @pdp2121

Yes this will not work atmm (I had to test using standalone), will do once the rippled PR is merged

@ckeshava ckeshava left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we make a beta release with this PR? I don't expect the integration tests to pass.

(1) Disable the integration tests check for this specific PR
(2) Create a docker image with the custom rippled PR to complete the integ tests.

We will need to pick one of the two options.

// `Counterparty` of one.
const involvedAccounts = new Set<string>()
transaction.RawTransactions.forEach((raw) => {
involvedAccounts.add(raw.RawTransaction.Account)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format does not account for potential Delegate of the inner transaction. Please refer to line 427 in this file: https://github.com/XRPLF/rippled/pull/6446/changes#diff-a9cdff3331a64b75a44d24094b4699fd27c8e4fdc52537eb97f881ce8b28c2db

raw.RawTransaction.Delegate ?? raw.RawTransaction.Account would be more appropriate here.

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.

Update Batch (XLS-56) signing for Batch V1_1 — signature omits outer Account/Sequence, rejected with temBAD_SIGNATURE (rippled#6446)

2 participants