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

Remove archive node requirements #230

Open
samlaf opened this issue Jan 9, 2025 · 5 comments · May be fixed by #241
Open

Remove archive node requirements #230

samlaf opened this issue Jan 9, 2025 · 5 comments · May be fixed by #241

Comments

@samlaf
Copy link
Collaborator

samlaf commented Jan 9, 2025

Right now the verifier logic requires an rpc url to an archive node.

This is because it needs to retrieve information from the eigenDAServiceManager contract at old blocks, for eg:

  1. at the batch's confirmation block number
  2. at the batch's reference block number

Creating this issue to discuss ways to remove this dependency, and allow proxy to be run with a normal (non-archive) node rpc. Some obvious suggestion is to emit events in the contract and run some kind of indexer, basically moving the dependency from an archive node to a graph node. It isn't clear to me this is much better...

EigenDA v2 will remove some needs for the archive node dependency, but I'm not sure it removes all need atm. For eg. we'll still need to reference operator state at a previous block number (RBN), but this can be done at the current block because we store all state updates in the contract state itself.

Action Items

  1. Add README documentation for what/when archive node is required
  2. Design V2 such that we don't need archive node (move requiredQuorums history into the contract state?)
@jcortejoso
Copy link
Contributor

Hi @samlaf! Great to see this.

I think an alternative that would not require additional external dependencies but work with RPC full nodes could be fetching all L1 blocks (from an initial pivot) searching for the logs/events emitted by EigenDAServiceManager contract. This is something similar to what OP stack does. In case of a OP rollup, they start looking based on the latest safe block from the rollup. I think in case of an EigenDA proxy, it's not so clear to determine an starting "block", or it'd be the block where the EigenDAServiceManager was deployed onwards.

@samlaf
Copy link
Collaborator Author

samlaf commented Jan 9, 2025

@jcortejoso iiuc that works for a derivation pipeline where you're anyways scanning the full chain linearly, but doesn't seem super nice to be something to do on a webserver that can receive requests from random block numbers.

After discussing internally, I think we have a pretty simple solution which will work for v2 at least. Most of our state in avs middleware contracts has its history reified in that all previous versions of params are stored in the current state (we store an array of all previous versions of a field instead of just the current version). This way we can always query the latest block, even for previous information.

For V2 the information that we need to retrieve from the chain is stored in https://github.com/Layr-Labs/eigenda/blob/99792bf38b035b3d67d82d56b67b4950f4a5bdb1/contracts/src/core/EigenDAThresholdRegistryStorage.sol#L12

    bytes public quorumAdversaryThresholdPercentages;
    bytes public quorumConfirmationThresholdPercentages;
    bytes public quorumNumbersRequired;

We will move those inside the VersionedBlobParams struct which has its history reified.

@samlaf
Copy link
Collaborator Author

samlaf commented Jan 13, 2025

Notes from our recent discussion on this issue. We will most likely remove the archival node requirements by making the contract immutable and hence only needing to read from it once upon proxy load (or can read from the latest block whenever). Still useful to read from a contract instead of hardcoding it in the proxy itself because we might want different values in different environments (say if we're testing against a devnet which has 5 required quorums)
image

@samlaf samlaf linked a pull request Jan 14, 2025 that will close this issue
@gastonponti
Copy link

So, the gap that we had where the quorum required changed to only use the quorum 0, will fail (probably require a special case in the proxy) but this will remove the possibility of that bug in the future. Am I right?

@samlaf
Copy link
Collaborator Author

samlaf commented Jan 15, 2025

@gastonponti correct. The only way for that bug not to happen again it to harden our smart contract practices, which we already have. V2 implementation for the quorum parameters is much much harder to update “by mistake”. Unfortunately for the v1 bug we caused on testnet there isn’t much to be done at this point. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants