Skip to content

Conversation

@tequdev
Copy link
Member

@tequdev tequdev commented Aug 2, 2025

High Level Overview of Change

Context of Change

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 update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

dangell7 and others added 2 commits August 2, 2025 23:38
- Specification: [XRPLF/XRPL-Standards 56](https://github.com/XRPLF/XRPL-Standards/blob/master/XLS-0056d-batch/README.md)
- Amendment: `Batch`
- Implements execution of multiple transactions within a single batch transaction with four execution modes: `tfAllOrNothing`, `tfOnlyOne`, `tfUntilFailure`, and `tfIndependent`.
- Enables atomic multi-party transactions where multiple accounts can participate in a single batch, with up to 8 inner transactions and 8 batch signers per batch transaction.
- Inner transactions use `tfInnerBatchTxn` flag with zero fees, no signature, and empty signing public key.
- Inner transactions are applied after the outer batch succeeds via the `applyBatchTransactions` function in apply.cpp.
- Network layer prevents relay of transactions with `tfInnerBatchTxn` flag - each peer applies inner transactions locally from the batch.
- Batch transactions are excluded from AccountDelegate permissions but inner transactions retain full delegation support.
- Metadata includes `ParentBatchID` linking inner transactions to their containing batch for traceability and auditing.
- Extended STTx with batch-specific signature verification methods and added protocol structures (`sfRawTransactions`, `sfBatchSigners`).
case ttREMARKS_SET: {
break;
}
case ttBATCH: {
Copy link
Member Author

Choose a reason for hiding this comment

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

To be discussed:

  1. Is Batch allowed as EmittedTxn?
  2. If allowed, how should Callback be handled?

Copy link
Contributor

Choose a reason for hiding this comment

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

I vote yes and singularly at the end of the batch txn execution like any other txn. We might need additional hook apis to support the extra metadata

Copy link
Member Author

@tequdev tequdev Dec 8, 2025

Choose a reason for hiding this comment

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

Should cbak() handle both OuterTxn and InnerTxns individually?

Also, since InnerTxn doesn't have information on whether it was emitted from a Hook itself, we might need to set the EmitDetails field on InnerTxn as well.

@tequdev tequdev force-pushed the sync-2.4.0 branch 2 times, most recently from d7d49ea to 1da0089 Compare October 14, 2025 08:22
@tequdev
Copy link
Member Author

tequdev commented Dec 10, 2025

New Hook API Ideas

  • Get InnerTxn from OuterTxn/other InnerTx (Something like otxn_batch_inner_slot(innerIndex, newSlotno)?)
  • Get OuterTxn from InnerTxn (Something like otxn_batch_outer_slot(newSlotno)?)

@tequdev
Copy link
Member Author

tequdev commented Jan 9, 2026

For now, we'll only allow BatchTx.InnerTransactions.sfAccount = HookAccount (since signatures from other accounts can't be provided), but in the future, we might consider including transactions from other accounts in InnerTxns if there's authorization via OtxnAccount.

@tequdev
Copy link
Member Author

tequdev commented Jan 9, 2026

Points for consideration:
Should we apply the HookCanEmit check to InnerTxns? (We probably should.)

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.

4 participants