Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Fix partial state revert logic #184

Merged
merged 7 commits into from
Nov 6, 2022

Conversation

magicalne
Copy link
Contributor

@magicalne magicalne commented Nov 2, 2022

Now the revert issue is fixed with two new syscalls, sys_snapshot and sys_revert.
Snapshot of the state is taken before call/create and revert back if polyjuice gets an error from EVM.
If it's a create tx, we need to reset g_created_id as well.

The revert tests are also refactored because the old tests kept hitting a revert error when accessing the global variable(e.g. CallRevertWithTryCatch.state).

- Some assertions are removed those have little to do with polyjuice
  functionalities.
- Revert tests are refactored. Because the original tests hit the "revert" error when access public global var.
- Reset g_created_id in `revert`.
@magicalne magicalne changed the title Enable try-catch feature fix revert in try-catch Nov 3, 2022
@magicalne magicalne marked this pull request as ready for review November 4, 2022 02:14
@magicalne magicalne requested review from Flouse and jjyr November 4, 2022 02:33
@jjyr jjyr requested a review from a team November 4, 2022 05:06
c/polyjuice.h Outdated Show resolved Hide resolved
c/polyjuice.h Show resolved Hide resolved
@magicalne magicalne self-assigned this Nov 4, 2022
@magicalne magicalne requested a review from jjyr November 4, 2022 08:38
c/polyjuice.h Outdated Show resolved Hide resolved
c/polyjuice.h Outdated Show resolved Hide resolved
@magicalne magicalne requested a review from jjyr November 4, 2022 09:45
@jjyr jjyr requested a review from a team November 4, 2022 10:36
@Flouse Flouse changed the title fix revert in try-catch Fix revert logic Nov 6, 2022
@Flouse Flouse changed the title Fix revert logic Fix partial state revert logic Nov 6, 2022
@Flouse Flouse merged commit 8eaf858 into godwokenrises:main Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants