erigon icon indicating copy to clipboard operation
erigon copied to clipboard

`eth_createAccessList` return empty response on Gnosis

Open mrdimidium opened this issue 1 year ago • 1 comments

Hello. It's seems that eth_createAccessList returns empty response on Gnosis instead of valid accessList

System information

Erigon version: 2.57.2-ffb6b83c OS & Version: Linux Chain/Network: Gnosis

Steps to reproduce the behaviour

curl $NODE_URL --data '{
  "id":1, "jsonrpc":"2.0",
  "method":"eth_createAccessList",
  "params": [
    {
      "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      "to":"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
      "data":"0x70a08231000000000000000000000000Ab5801a7D398351b8bE11C439e05C5B3259aeC9B",
      "gas":"0xF4240"
    },
    "0x1ef211b"
  ]
}'

Expected behaviour

{
  "jsonrpc":"2.0","id":1,
  "result":{
    "accessList":[{
      "address":"0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
      "storageKeys":["0xb1bbbef45f513c44e72efa75cfd0eb28e28e8ce68fbe4008ff8e3da60fc4b618"
    ]}],
    "gasUsed":"0x66b8"
  }
}

Actual behaviour

{"id":1,"jsonrpc":"2.0","result":{"accessList":[],"gasUsed":"0x66b8"}}

mrdimidium avatar Feb 14 '24 16:02 mrdimidium

Update on this? We're blocked by this

ConnorSB13 avatar Mar 28 '24 18:03 ConnorSB13

How are you getting the "expected behavior" for this?

somnathb1 avatar Apr 07 '24 11:04 somnathb1

Looks like the reported "expected" storage key and address is being removed from the accessList in the logic implemented in https://github.com/ledgerwatch/erigon/pull/3453 and https://github.com/ledgerwatch/erigon/pull/8261 The supposed rationale is that to address is already warm and needs not be added to the access list unless a large number of its storage slots are being used. Request for comment from @yperbasis

somnathb1 avatar Apr 07 '24 12:04 somnathb1

Yes, in those PRs we made eth_createAccessList to return the access list that optimizes the gas of a transaction. Since to (0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d) is already warm, it's actually wasteful to warm up just one slot because you save 100 gas (COLD_SLOAD_COST - WARM_STORAGE_READ_COST - ACCESS_LIST_STORAGE_KEY_COST), while having to pay 2400 gas (ACCESS_LIST_ADDRESS_COST) since you have to pay for to itself. If you want the old (non-optimal behaviour), set the 3rd (optional) parameter of eth_createAccessList ("optimizeGas") to false.

yperbasis avatar Apr 09 '24 08:04 yperbasis