Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chain/transaction] Introduce Multi-Action Support #698

Closed
wants to merge 16 commits into from

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Jan 21, 2024

Resolves: #335

TODO

  • Add Rule to limit number of Actions per Transaction
  • Introduce ActionID (33 bytes) for unique interactions rather than TxID (may need more than 1 unique key per tx)

Future Work (post-merge)

  • Add support for outputting multiple warp messages
  • Consider attaching Warp.Message to an Action instead of a Transaction (then consider each Action an InnerTx)

}
}

// We create a temp state checkpoint to ensure we don't commit failed actions to state.
actionStart := ts.OpIndex()
handleRevert := func(rerr error) (*Result, error) {
handleRevert := func(rerr error) ([]*Result, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we revert, return all results up to the failure (with success true)

Copy link

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will exempt this PR from future lifecycle events..

chain/transaction.go Fixed Show fixed Hide fixed
@@ -41,7 +41,7 @@ func (b *StatelessBlock) Execute(
f = fetcher.New(im, numTxs, b.vm.GetStateFetchConcurrency())
e = executor.New(numTxs, b.vm.GetTransactionExecutionCores(), MaxKeyDependencies, b.vm.GetExecutorVerifyRecorder())
ts = tstate.New(numTxs * 2) // TODO: tune this heuristic
results = make([]*Result, numTxs)
results = make([]*Result, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want a 2d array with a length of numTxs instead? or flatten all the results into one array? not sure of the consequences of doing the flatten approach right now

@wlawt wlawt changed the title [chain/transaction] Multi-Action Support [chain/transaction] Introduce Multi-Action Support Apr 22, 2024
// all storage use in the background. KeyOperations is unique to a view.
allocates, writes := ts.KeyOperations()
results := make([]*Result, 0)
for _, action := range t.Actions {

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of action is never used.
@wlawt
Copy link
Contributor

wlawt commented Apr 24, 2024

Going to use #858 going forward (had too many issues with merge conflicts and made it difficult to reason). Was easier to start fresh

@wlawt wlawt closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[chain/tx] Make transaction.Action an array (Support Batch Transactions)
2 participants