Skip to content

Conversation

MathieuDutSik
Copy link
Contributor

Motivation

Due to the control of the order of the operations by the signer of the blocks, the signer can choose the return of one operation to be the input of the next one.

Fixes #2037

Proposal

The idea is simply to introduce a

enum OperationInput {
  Composed,
  Direct(Vec<u8>),
}

with Direct being the previous mechanism. Since the BlockTracker has all the needed data, this works fine.

Where some problems occur is with the typed operations of Wasm smart contracts. We could introduce an OperationInput taking a typed input. But this introduces a number of type complications, and the method instead is to have two functions:

schedule_operation(A::Oeration)
schedule_composed_operation()

And so we get a relatively simple

Test Plan

The CI.
One test uses the Counter example which was modified to return a CounterOperation and so to be composed.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

None.

@MathieuDutSik MathieuDutSik marked this pull request as ready for review August 26, 2025 08:41
@ma2bd ma2bd marked this pull request as draft September 25, 2025 07:14
Copy link
Contributor

@ma2bd ma2bd left a comment

Choose a reason for hiding this comment

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

This is related to "scripts" or Sui's PTB. Great direction but we're going to need some solid design first.

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.

Support composed operations (aka scripts)

2 participants