-
Notifications
You must be signed in to change notification settings - Fork 21.2k
Closed
Labels
Description
Rationale
Think about this case, you need to create accesslist for the second tx.
Let's say two txs are tx0 & tx1, tx0 has an impact on tx1 execution, if tx0 failed, tx1 fails (e.g. router approve tx & swap tx).
eth_createAccessList
can be used to create acceelist before you send tx0, but for tx1, you can't do it in the same way, because tx0's state changes are not applied, tx1 will fail.
Implementation
Maybe it can be done by extend
CreateAccessList(ctx context.Context, msg ethereum.CallMsg)
to
CreateAccessList(ctx context.Context, msg ethereum.CallMsg, stateOverrides ...*ethapi.StateOverride)
So first I can find the state changes by tx0, then call eth_createAccessList
with the state changes. e.g. approved balance / erc20 balance changes.