Skip to content

SIP-19: Soft Bundle API#19

Merged
wriches merged 9 commits intosui-foundation:mainfrom
shio-coder:main
May 13, 2024
Merged

SIP-19: Soft Bundle API#19
wriches merged 9 commits intosui-foundation:mainfrom
shio-coder:main

Conversation

@shio-coder
Copy link
Copy Markdown
Contributor

Hi team,

We have made a SIP regarding Soft Bundle API.

The Soft Bundle API allows clients to submit a sequence of transaction blocks in a 'soft bundle', where despite not having strong semantics, provides a practical way to 'bundle' together transactions in order to maintain its execution order.

The proposal is called 'soft bundle' because:

  • No strong guarantee of atomic inclusion: It is possible that transactions in a soft bundle get included in ways other than specified in the bundle. It is particularly possible for transactions to appear in a non-deterministic order when multiple clients are submitting conflicting soft bundles.
  • Non-atomic side effects: The effect from a soft bundle is not exactly atomic - one or more transactions in the bundle may fail, while the bundle still continues to execute.

This will enable new applications that we see on other networks and bring more possibilities to SUI ecosystem.

Copy link
Copy Markdown
Contributor

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

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

Some minor edits

@wriches wriches changed the title Add Soft Bundle API SIP for review Soft Bundle API Apr 24, 2024
@wriches wriches added the active Active SIPs that are either in Draft, Review, Fast Track or Last Call status. label May 1, 2024
@wriches wriches changed the title Soft Bundle API SIP-19: Soft Bundle API May 1, 2024
@wriches wriches merged commit 0961e99 into sui-foundation:main May 13, 2024
@wriches wriches added final SIPs that have been finalised and accepted. and removed active Active SIPs that are either in Draft, Review, Fast Track or Last Call status. labels May 13, 2024
mwtian added a commit to MystenLabs/sui that referenced this pull request May 16, 2024
## Description 

Please refer to this SIP draft: 
sui-foundation/sips#19

The PR focuses only on consensus related changes, covering both Narwhal
and Mysticeti.
We will proceed to work on the remaining parts once this gets merged.

The PR includes a commit from @mwtian that changes `TransactionConsumer`
for ack handling in a bundle context.
Special thanks to @mwtian for taking time to discussions and authoring
the change above!


## Test Plan 

The feature is not exactly user-facing and do not break anything.

### Type of Change (Check all that apply)

- [x] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

---------

Co-authored-by: Mingwei Tian <mingwei@mystenlabs.com>
@0xd34th
Copy link
Copy Markdown

0xd34th commented May 20, 2024

@shio-coder I'm going to ask a stupid question. Why would we need soft bundle when we have PTBs that guarantees the order of txs vs soft bundle which may or may not, and might result in a failed tx?

@shio-coder
Copy link
Copy Markdown
Contributor Author

@shio-coder I'm going to ask a stupid question. Why would we need soft bundle when we have PTBs that guarantees the order of txs vs soft bundle which may or may not, and might result in a failed tx?

Hi @FudDeath ,

There are mainly two reasons:

  • A PTB is signed as a whole, by one or more signers. If one tries to add Transaction into an existing signed PTB, its signature will be voided. Soft Bundle would provide a way to bundle together PTBs, signed by different parties, while respecting individual signature(s) of each PTB.

  • A PTB is treated as an atomic operation - either succeeds when all Transactions are successfully executed (effectively in a sequential manner), or fails with no side effects at all. Soft Bundle would provide a way to allow 'partial failure', in which case each PTB is executed sequentially and individually. For example, one could submit a bundle containing PTBs [A, B, C], where in the event A/B fails, C may remain unaffected (should its success do not depend on the side effects from A/B).

@0xd34th
Copy link
Copy Markdown

0xd34th commented May 20, 2024

@shio-coder I'm going to ask a stupid question. Why would we need soft bundle when we have PTBs that guarantees the order of txs vs soft bundle which may or may not, and might result in a failed tx?

Hi @FudDeath ,

There are mainly two reasons:

  • A PTB is signed as a whole, by one or more signers. If one tries to add Transaction into an existing signed PTB, its signature will be voided. Soft Bundle would provide a way to bundle together PTBs, signed by different parties, while respecting individual signature(s) of each PTB.
  • A PTB is treated as an atomic operation - either succeeds when all Transactions are successfully executed (effectively in a sequential manner), or fails with no side effects at all. Soft Bundle would provide a way to allow 'partial failure', in which case each PTB is executed sequentially and individually. For example, one could submit a bundle containing PTBs [A, B, C], where in the event A/B fails, C may remain unaffected (should its success do not depend on the side effects from A/B).

I understand now, that's huge. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

final SIPs that have been finalised and accepted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants