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

lodestar/prover eth_getBlockByNumber doesn't work correctly #6032

Closed
rdvorkin opened this issue Oct 11, 2023 · 2 comments · Fixed by #6442
Closed

lodestar/prover eth_getBlockByNumber doesn't work correctly #6032

rdvorkin opened this issue Oct 11, 2023 · 2 comments · Fixed by #6442
Assignees
Labels
meta-bug Issues that identify a bug and require a fix.

Comments

@rdvorkin
Copy link
Contributor

Describe the bug

getExecutionPayloadForBlockNumber gets called here https://github.com/ChainSafe/lodestar/blob/unstable/packages/prover/src/proof_provider/payload_store.ts#L97
with min blocknumber stored and the requested blocknumber
But getExecutionPayloadForBlockNumber seems to accept a beacon slot and not min block as parameter, therefore later in the code it tries to fetch a beacon block for an el block number and fails
https://github.com/ChainSafe/lodestar/blob/unstable/packages/prover/src/utils/consensus.ts#L82
https://github.com/ChainSafe/lodestar/blob/unstable/packages/prover/src/utils/consensus.ts#L14

Expected behavior

using the verified provider to call eth_getBlockByNumber should work

Steps to reproduce

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 verifiedWeb3 = new Web3(provider);
const blockNum = 17956161;
const verifiedBlock = await verifiedWeb3.eth.getBlock(blockNum);
console.log(verifiedBlock);

Additional context

No response

Operating system

macOS

Lodestar version or commit hash

1.11.1

@rdvorkin rdvorkin added the meta-bug Issues that identify a bug and require a fix. label Oct 11, 2023
@wemeetagain
Copy link
Member

cc @nazarhussain

@jeluard
Copy link
Contributor

jeluard commented Feb 16, 2024

@rdvorkin You might want to give a try to this branch. Let me know if it helps! We'll merge this soon in unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-bug Issues that identify a bug and require a fix.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants