Replies: 1 comment
-
This should certainly be possible, and there are non-standard JSON-RPC calls that are supposed to do it, à la One thing to keep in mind is that there will be the same consistency issues as For example, imagine a contract that will look up the owner of an ENS name and send an NFT to it. If you call the “compute access list” method you get a storage slot in the NFT contract to update for tokensOwnedBy but if the ENS name changes hands before that transaction, the storage slot will have changed which means you are paying the non-discounted rate for the new slot as well as the pre-payment for a slot you no longer need to access. Long story short, I hope a call is made available in the non-distant future too. :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hi! with @jparnaudo we've been researching gas optimization for specific txs by using access lists. We've seen ethers.js supports them via the
accessList
parameter inTransactionRequest
.However, it's not clear to us how to build the access list. There's some examples here:
https://docs.ethers.io/v5/api/providers/types/#types--access-lists
and we understand the storage keys can be calculated using
await provider.getStorageAt(contractAddress, pos)
where
pos
depends on the contract's storage layout (which in solidity is explained here: https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html)We're still working our way with our specific contract transaction (which by the way involves an OpenZeppelin upgradeable contract, which further complicates stuff)
our question is: shouldn't it be possible, in principle, to generate a transaction's access list automatically, given the rest of the transaction's parameters? I know this would not be trivial, but I wanted to bounce the idea here, and if you think it should be possible, maybe we can start work on this after we finish our specific case. If we got this correctly, shouldn't this allow for "automatic" gas cost reductions for most transactions?
More info: https://eips.ethereum.org/EIPS/eip-2930#charging-less-for-accesses-in-the-access-list
Beta Was this translation helpful? Give feedback.
All reactions