Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Atomic Transaction and Batch Transaction #1791

@xlc

Description

@xlc

Currently transactions are not applied atomically that if it failed halfway through, the previously applied storage updates are kept and not reverted. Therefore we have to perform all the checks before first storage write and cannot return error after first storage write happened.

That means if a runtime module wants make multiple fallible calls, it have to first check all of them won't fail upfront. This can be hard to implement. Image I want to implement a runtime call to transfer token to 3 different accounts, which may or may not be already created (hence different transaction fee will be deduced). It is hard to calculate the exact total balances required to make this action without failure.

Another feature I would like to implement in future is atomic batch transaction (Thanks to Schnorr, only one signature will be needed). It needs to ensure either all or none of the transactions success. That means it needs ability to revert previously applied transaction if the last one failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J1-metaA specific issue for grouping tasks or bugs of a specific category.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions