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

Insure transaction atomicity #3627

Closed
Erigara opened this issue Jun 20, 2023 · 3 comments
Closed

Insure transaction atomicity #3627

Erigara opened this issue Jun 20, 2023 · 3 comments
Assignees
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix question Further information is requested

Comments

@Erigara
Copy link
Contributor

Erigara commented Jun 20, 2023

As part of implementing runtime validator RFC (#3615) we need to make sure that if isi returns error no changes was made to wsv.

Some guardrails could be added to ensure that hash(wsv_before) == hash(wsv_after_error).

@Erigara Erigara added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Jun 20, 2023
@Erigara Erigara self-assigned this Jun 20, 2023
@Erigara Erigara changed the title Insure that isi doesn't change wsv in case of rejection. Insure that isi doesn't change wsv in case of error Jun 20, 2023
@Erigara
Copy link
Contributor Author

Erigara commented Jun 21, 2023

Currently isi like Pair, Sequence might cause problem because if one of their innerinstructions will fail changes from previous instructions won't be roll-backed (so they lack atomicity).

@Erigara
Copy link
Contributor Author

Erigara commented Jun 21, 2023

Also Transaction in general lack atomicity.

Erigara added a commit to Erigara/iroha that referenced this issue Jun 21, 2023
@Erigara Erigara added the question Further information is requested label Jun 21, 2023
@Erigara
Copy link
Contributor Author

Erigara commented Jun 21, 2023

There is two ways to achieve atomic transactions:

  1. Cheep wsv clone where transaction will be executed on cloned wsv and either clone will replace original wsv or clone will be discarded;
  2. Introduce rollback for transaction when in case of failure any previously executed instructions will be reverted.

@Erigara Erigara changed the title Insure that isi doesn't change wsv in case of error Insure transaction atomicity Jun 21, 2023
Erigara added a commit to Erigara/iroha that referenced this issue Jun 22, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Jun 22, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Jun 23, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Jun 26, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Jun 26, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Jun 26, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit that referenced this issue Jun 26, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
@timofeevmd timofeevmd added the QA-confirmed This bug is reproduced and needs a fix label Jun 29, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants