-
Notifications
You must be signed in to change notification settings - Fork 454
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
EIP-6780: SELFDESTRUCT only in same transaction #719
Conversation
00f3946
to
8e1344b
Compare
Didn't forget about this, checking things related to Verkle tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good direction, left comments
// touch target account | ||
|
||
let acc = if address != target { | ||
let [acc, target_account] = self.state.get_many_mut([&address, &target]).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_many_mut is still nightly
feature: https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_many_mut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh forget this, Hashbrown
has it
crates/revm/src/journaled_state.rs
Outdated
}); | ||
} | ||
} else { | ||
Self::touch_account(self.journal.last_mut().unwrap(), &address, acc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not needed, address
is considered touched
as this is the account that we are currently executing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to request changes
96b3565
to
4e08ba6
Compare
I should have resolved all your comments, thanks for the support. I'm happy to see that tests are passing, even if in local they were failing for some reason.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Left nit comments to add doc
Tests were failing for some other reason, found the problem and merged in on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the current comments, this looks good to me, will test this with hive once merged!
Closes #524. Reading the EIP, when the contract is not created in the same tx,
SELFDESTRUCT
simply becomes a transfer, while keeping the gas cost of the opcode. As such, I tried to modify only theJournaledState
to reflect that.