core/state: construct access list from current state#22289
core/state: construct access list from current state#22289MariusVanDerWijden wants to merge 10 commits into
Conversation
06200a2 to
48a207f
Compare
ceb7be3 to
4fcf1cb
Compare
4fcf1cb to
f2ae701
Compare
d38205a to
e46bd5e
Compare
| return nil, fmt.Errorf("failed to apply transaction: %v err: %v", args.ToTransaction().Hash(), err) | ||
| } | ||
| if res.UsedGas == gas { | ||
| vmenv.StateDB.UnprepareAccessList(args.From, args.To, vmenv.ActivePrecompiles()) |
There was a problem hiding this comment.
I don't see why we need this Unprepare, whicih also is journalled.
There was a problem hiding this comment.
Yeah, that was a question I had, whether I should unprepare the access list inside or outside of the statedb.
If I unprepare inside of the statedb (the way it currently is) then this should be journalled. But I guess I should unprepare it outside of the statedb.
We need unprepare to remove sender, recipient and the precompiles from the access list
Note to myself, we should only remove the recipient if it has no other state accesses
There was a problem hiding this comment.
Note to myself, we should only remove the recipient if it has no other state accesses
Yes. only if the slotlist is empty.
There was a problem hiding this comment.
But really, you only need to 'clean it' as the very last step before returning it to the user.
|
One gotcha, that I don't think we handle in this PR is that if a tx calls |
|
Superseeded by #22550 |
Implement access list helpers on top of #21502 and #22290
TODO:
Usage:
Edit: the above output was from before the access list was unprepared.