-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add account balance overrides #137
base: main
Are you sure you want to change the base?
Conversation
fbe8aa6
to
8017af2
Compare
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.
Looks neat! Just one question about a TODO
8017af2
to
de04d29
Compare
I noticed a lot of missing/not updated docs, would be nice to double check that we keep everything up to date before merging |
@@ -48,23 +48,42 @@ impl TryFromWithBlock<ComponentWithState> for EVMPoolState<PreCachedDB> { | |||
async fn try_from_with_block( | |||
snapshot: ComponentWithState, | |||
block: Header, | |||
account_balances: &HashMap<Bytes, HashMap<Bytes, Bytes>>, |
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.
Idea: We could refactor our try_from_with_block to decode whole Snapshot
s instead of ComponentWithState
(like the python version). Then we'd have the account balances inside the snapshot and don't need to collect and pass it extra like this.
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.
Yes, that'd be the cleaner way. Can we do this in a separate PR?
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.
But it means we pass a lot more data in the interface: The full snapshot has the full vm_storage with it which include storage slots, contract code etc.
23d5fc9
to
5f28bff
Compare
a551ec5
to
33284ad
Compare
For protocols with specified balance owners with tracked account balances, we should use those balances instead of component balances.
And update overwrites logic to handle both component balances and contract balances.
289fd31
to
6eb24d5
Compare
regardless of if there is an associated contract/attribute change.
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.
🔥
For some protocols the balances used by a component is stored on a separate contract. To best cater for such components we now support using account_balances where the balance for relevant contracts is monitored and overwritten during simulation.
Decisions: