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

Multi suicide #1169

Merged
merged 7 commits into from
Mar 3, 2023
Merged

Multi suicide #1169

merged 7 commits into from
Mar 3, 2023

Conversation

qbzzt
Copy link
Collaborator

@qbzzt qbzzt commented Feb 26, 2023

call happens within one transaction to contractA, that has different scenarios around suicide
contractA has balance=3

SUC000 - contractA is called to perform suicide to dest1 (3 must immidiately(check that it is immidiately and not by the end of tx) go to dest1)
contractA is called again in the same tx, but this time

SUC001 - does not suicide, just receive more funds via call. check the balance of contractA (must be 0, the second transfer funds erased)
SUC002 - does another suicide to dest1 (so dest1 now have 3 + x)
SUC003 - does another suicide to dest2 (so both dest1 and dest2 has some balance)
SUC004 - tries to make value transfer but fails because initial suicide 0ed the balance (answering this (check that it is immidiately and not by the end of tx))
SUC005 - receives more funds and try to transder it (same as SUC004, but this time work because it received funds via 2nd call)

Copy link
Collaborator

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

Each vector assumes a transaction finalization happens. 1 tx - one vector.

Suc000 is the base. It happens in the beginning of each following vector.

So 1. Call regular suicide. 2. Call again selfdesteuct contract in the same tx. But different call. 3. Tx finishes. 4 . Check the post state.

Then go to the next vector that do the same. But different scenario in step 2.

@qbzzt qbzzt requested a review from winsvega February 28, 2023 20:14
# SUC002
- indexes:
data: !!int 1
gas: !!int -1
Copy link
Collaborator

Choose a reason for hiding this comment

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

gas and value can be omited if it is -1

Copy link
Collaborator

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

looks very good now. @marioevz any more ideas for suicide double call ?
maybe more scenarios with revert

@qbzzt qbzzt requested a review from winsvega March 1, 2023 02:23
This is for test cases in PR #1162, but it scares me to modify the same file in two PRs at the same time.
@winsvega winsvega merged commit d7734a1 into develop Mar 3, 2023
@winsvega winsvega deleted the 20230225-multi-suicide branch March 3, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants