Skip to content
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

fix: ignore "execution reverted" errors in eth_createAccessList #6020

Conversation

rdvorkin
Copy link
Contributor

@rdvorkin rdvorkin commented Oct 3, 2023

eth_createAccessList sometimes returns "execution reverted" errors, even if the tx is supposed to succeed.
I wasn't able to find the reason for this, maybe more investigation is needed

Code to replicate

The following example calls balanceOf on USDC, the tx should work but eth_createAccessList returns "execution reverted"

import Web3 from "web3";
import {createVerifiedExecutionProvider, LCTransport} from "@lodestar/prover";
import {LogLevel} from "@lodestar/logger";


const network = "mainnet";
const beaconApiUrl = "https://lodestar-mainnet.chainsafe.io"
const elRpcUrl = "https://lodestar-mainnetrpc.chainsafe.io";
const checkpoint = "0xcc8251d86c07d31c2afd7edda6df5896d7b8b721b4402557f1a8de4a5965ae09";

const {provider, proofProvider} = createVerifiedExecutionProvider(
  new Web3.providers.HttpProvider(elRpcUrl),
  {
    transport: LCTransport.Rest,
    urls: [beaconApiUrl],
    network: network,
    wsCheckpoint: checkpoint,
    logLevel: LogLevel.info
  }
);

const web3 = new Web3(provider);

const balanceOfABI = [
  {
      "constant": true,
      "inputs": [
          {
              "name": "_owner",
              "type": "address"
          }
      ],
      "name": "balanceOf",
      "outputs": [
          {
              "name": "balance",
              "type": "uint256"
          }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
  },
];

const tokenContract = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" // USDC
const tokenHolder = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

const contract = new web3.eth.Contract(balanceOfABI, tokenContract)
const result = await contract.methods.balanceOf(tokenHolder).call();

eth_createAccessList sometimes returns "execution reverted" errors, even if the tx is supposed to succeed
@rdvorkin rdvorkin requested a review from a team as a code owner October 3, 2023 11:57
@CLAassistant
Copy link

CLAassistant commented Oct 3, 2023

CLA assistant check
All committers have signed the CLA.

@nazarhussain nazarhussain self-assigned this Oct 11, 2023
@nazarhussain nazarhussain added the scope-light-clients All issues regarding light client development. label Oct 11, 2023
Copy link
Contributor

@nazarhussain nazarhussain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If eth_createAccessList returning execution reverted we can't consider it a success. May be some storage was missed in the response.

We have to debug this scenario further. Here is a similar issue reported to geth earlier.
ethereum/go-ethereum#27999

I will suggest following:

  1. Add a test case particular for this edge case.
  2. Try running a local geth node and run the tests against it
  3. When test fails execute debug_traceCall afterwards to get full logs

We may be able to find the reason why the eth_createAccessList was reverted.

@rdvorkin
Copy link
Contributor Author

rdvorkin commented Nov 9, 2023

This is fixed by #6101

@rdvorkin rdvorkin closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-light-clients All issues regarding light client development.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants