-
Notifications
You must be signed in to change notification settings - Fork 106
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
Filter transaction #377
base: master
Are you sure you want to change the base?
Filter transaction #377
Conversation
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.
Can you also update the PR comment to explain what's going on and why? The link to the Linear ticket is not sufficient for people who want to contribute to the project but don't have access to Linear.
core/state/statedb.go
Outdated
@@ -86,6 +90,7 @@ func (m *mutation) isDelete() bool { | |||
// commit states. | |||
type StateDB struct { | |||
arbExtraData *ArbitrumExtraData // must be a pointer - can't be a part of StateDB allocation, otherwise its finalizer might not get called | |||
arbTxFilter bool |
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.
I believe statedb also has a Copy or Clone method that also needs modified to copy this field. Also, perhaps it should be in arbExtraData for clarity?
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.
moved it to arbExtraData for clarity, this also avoids merge conflicts in the future
Also, I think this flag might need to survive reverts |
This is handled by persisting the flag in revisions |
I'm not sure, wouldn't that mean the flag could get reset to false if a contract reverts? |
if a contract reverts such that it leads to a tx failure, then we dont have to worry about the boolean as statedb would be reset to previous snapshot in the block_processor anyway. and if the contract revert doesn't cause the tx failure then geth would've taken a statedb snapshot before such an execution right? so that it can revert back to it? in which case revisions would persist the boolean's value |
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.
LGMT
This PR enables filtering of malicious transactions and blocks via a
stateDB
objectCorresponding Nitro PR- OffchainLabs/nitro#2807
Part of NIT-2848