-
Notifications
You must be signed in to change notification settings - Fork 373
fix(specs): EIP-7928 larger refactoring moving the state tracker and introduce check gas and charge gas sequence #1759
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
base: eips/amsterdam/eip-7928
Are you sure you want to change the base?
Conversation
|
Two things before I dive into this comment. First, as far an interim implementation goes for generating tests, go wild and do whatever unblocks you. Second, I've only just started looking at this, so my suggestions are going to be rapid fire and poorly thought out. But basically: can we express the state tracker as a stack of "frames" that have defined merging rules? Something like:
Anyway, structurally, I think we want something like this: In
|
| sender_address: Address, | ||
| recipient_address: Address, | ||
| amount: U256, | ||
| block_env: "BlockEnvironment" = None, |
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 isn't optional post-Amsterdam right? Should this be an arg and not a kwarg set to None here? We are missing passing the block_env in many places at the moment and 99% of BAL tests fail. I think this is indicative that we require this arg and we would've caught this even in the lint checks because it would be missing something that is required and not optional.
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 made this change and updated passing block_env where we need to in a PR to this branch here. This is not taking into account the larger changes @SamWilsn suggested at the moment. I can confirm all BAL tests fill with this PR and my updates.
edit: I linked to a separate PR for the refactoring mentioned in this review as well. Both approaches pass all BAL tests.
@SamWilsn I took today to iterate on a first pass of this and just finished a rough initial implementation. I'm sure it will need some iteration but it passes all EIP-7928 tests at the moment. I am OOO from tomorrow until 11/11, so @nerolation feel free to amend my branch (if we decide to go this route) and push any changes requested there. I made the PR to this branch since this was already headed in the right direction. PR here: nerolation#4. |
🗒️ Description
Related to #1722, we should charge for account access costs before actually marking the account accessed.
If there is not enough gas for the access, we should never expend the resources to access the account.
Also, this addresses re-architecting things incl the state tracker that moved into the block env (cc @SamWilsn ).
Test cases for all of these boundaries should be added as well.
These changes should likely be introduced into all forks if we decide this is the correct approach.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e staticAll: PR title adheres to the repo standard — it will be used as the squash commit message and should start with
type(scope):.All: Considered updating the online docs in the
./docs/directory.All: Set appropriate labels for the changes (only maintainers can apply labels).
Cute Animal Picture