Skip to main content

Lodestar Eth Consensus Lightclient Prover

Discord ETH Beacon APIs Spec v2.1.0 ES Version Node Version

This package is part of ChainSafe's Lodestar project

A set of tools allowing to verify EL client JSON-RPC calls.

Usage

You can use the @lodestar/prover in two ways, as a Web3 Provider and as proxy. For prover use case see below example.

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

const {provider, proofProvider} = createVerifiedExecutionProvider(
new Web3.providers.HttpProvider("https://lodestar-sepoliarpc.chainsafe.io"),
{
transport: LCTransport.Rest,
urls: ["https://lodestar-sepolia.chainsafe.io"],
network: "sepolia",
wsCheckpoint: "trusted-checkpoint",
}
);

const web3 = new Web3(provider);

const address = "0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134";
const balance = await web3.eth.getBalance(address, "latest");
console.log({balance, address});

You can also invoke the package as binary.

npm i -g @lodestar/prover

lodestar-prover proxy \
--network sepolia \
--executionRpcUrl https://lodestar-sepoliarpc.chainsafe.io \
--beaconUrls https://lodestar-sepolia.chainsafe.io \
--port 8080

Supported Web3 Methods

✅ - Completed

⌛ - Todo

➡️ - Request will be forward to EL without any intermediary manipulations. You can limit these by providing unverifiedWhitelist option for provider or --unverifiedWhitelist from the cli. If not set then all methods will be forwarded.

❇️ - Always forwarded to EL.

GroupMethodStatusVersion
Blocketh_getBlockByHashv0
eth_getBlockByNumberv0
eth_getBlockTransactionCountByHashv2
eth_getBlockTransactionCountByNumberv2
eth_getUncleCountByBlockHashv2
eth_getUncleCountByBlockNumberv2
Chain/Networketh_chainId➡️
eth_syncingv1
eth_coinbasev2
eth_accounts➡️
eth_blockNumber➡️
Call and Estimateeth_callv0
eth_estimateGasv0
eth_createAccessListv2
eth_gasPricev1
eth_maxPriorityFeePerGasv1
eth_feeHistoryv2
Filterseth_newFilterv2
eth_newBlockFilterv2
eth_newPendingTransactionFilterv2
eth_uninstallFilterv2
eth_getFilterChangesv2
eth_getFilterLogsv2
eth_getLogsv1
Miningeth_mining➡️
eth_hashrate➡️
eth_getWork➡️
eth_submitWork➡️
eth_submitHashrate➡️
Signingeth_sign➡️
eth_signTransaction➡️
Stateeth_getBalancev0
eth_getStorageAtv1
eth_getTransactionCountv2
eth_getCodev0
eth_getProof❇️v0
Transactionseth_sendTransaction➡️
eth_sendRawTransaction➡️
eth_getTransactionByHashv2
eth_getTransactionByBlockHashAndIndexv2
eth_getTransactionByBlockNumberAndIndexv2
eth_getTransactionReceiptv2
Eventseth_subscribe❇️v0
eth_unsubscribe❇️v0

Non-supported features

  • Currently does not support batch requests.

Warnings

  • To use this prover the ethereum provider must support the eth_getProof method. Unfortunately, Infura does not currently support this endpoint. As an alternative, we suggest using Alchemy.

Prerequisites

What you need

You will need to go over the specification. You will also need to have a basic understanding of lightclient.

Getting started

Contributors

Read our contributors document, submit an issue or talk to us on our discord!

License

Apache-2.0 ChainSafe Systems