Implement composed operations #4405
Draft
+232
−103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
with
Direct
being the previous mechanism. Since theBlockTracker
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:And so we get a relatively simple
Test Plan
The CI.
One test uses the
Counter
example which was modified to return aCounterOperation
and so to be composed.Release Plan
Links
None.