Layr-Labs/eigenpod-proofs-generation

How to call manually `verifyWithdrawalCredentials` and `verifyCheckpointProofs` using the CLI?

asanson1404 opened this issue · 1 comments

Hey there,

I'm using the CLI to generate the validator and checkpoint proofs. However, I want to call manually the functions verifyWithdrawalCredentials:

function verifyWithdrawalCredentials(
    uint64 beaconTimestamp,
    BeaconChainProofs.StateRootProof calldata stateRootProof,
    uint40[] calldata validatorIndices,
    bytes[] calldata validatorFieldsProofs,
    bytes32[][] calldata validatorFields
) external;

This is what the CLI returns for a validator proof (if we don't provide --sender $EIGENPOD_OWNER_PK):

[
  {
    "type": "credential_proof",
    "to": "0xab93E8bC5f7A2c22D9Dcae4943095a5709F6E2fC",
    "calldata": "3f65cf190000000000[.............]0000000000",
    "validator_indices": [1759825]
  }
]

What's calldata? Is it only the validatorFieldsProofs argument?

I've seen that beaconTimestamp should correspond to the timestamp of the block that comes after the beacon block we're proving against. How can we know the correct beacon block root the CLI is proving against?

That would be great if the CLI could return all the function arguments.

Otherwise, could elaborate how to call manually these function?

SOLUTION:

import { ethers } from 'ethers';
import { eigenPodABI } from './ABI/eigenPodABI.js';
import { calldata } from './calldata/calldata.js';

let iface = new ethers.Interface(eigenPodABI);
//console.log(iface);

let args = iface.decodeFunctionData('verifyWithdrawalCredentials', calldata);
console.log(args);