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

chore: modify verifier to not require eth archive node #241

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Jan 14, 2025

Fixes Issue

Fixes #230

Changes proposed

Contains 2 main changes needed to remove archive node requirements:

  1. 4d85d3b: force ethConfirmationDepth to be <64 (so we read at most 64 blocks in the past, while normal nodes store the latest 128 states): not strictly necessary as this was a flag which could have been set by teh validators anyways, but its a nice to have to make sure that the code works even without archival node dependency.
  2. c4e6c90: read the quorum parameters (required quorums and adversary thresholds) from the EigenDAServiceManager only once, at startup.

Also updated the README with this information in cc3538f

Copying the comment on the getQuorumParametersAtLatestBlock function here to highlight the solution proposed in this PR:

// Note: this strategy (fetching once and caching) only works because these parameters are immutable.
// They might be different in different environments (for eg on a devnet or testnet), but they are fixed on a given network.
// We used to allow these parameters to change (via a setter function on the contract), but that then forced us here in the proxy
// to query for these parameters on every request, at the batch's reference block number (RBN).
// This in turn required rollup validators running this proxy to have an archive node, in case the RBN was >128 blocks in the past,
// which was not ideal. So we decided to make these parameters immutable, and cache them here.

Screenshots (Optional)

Note to reviewers

Leaving as DRAFT until we discuss whether this approach is fine, especially regarding immutability of the quorum parameters in our contracts.

We panic in the flag's action, as well as in the verifier's constructor when this condition is not respected.

This will make sure that an archival node is not required.
…ization

This removes the need for running with an eth archive node.
@samlaf samlaf marked this pull request as draft January 14, 2025 00:51
@samlaf samlaf requested a review from epociask January 14, 2025 00:51
@samlaf samlaf changed the title Chore modify verifier to not require eth archive node chore: modify verifier to not require eth archive node Jan 14, 2025
@@ -121,6 +121,9 @@ The following specs are recommended for running on a single production server:
* 4 GB RAM
* 1-2 cores CPU

### Ethereum Node Requirements
The cert verification logic inside proxy used to require an archive node to fetch quorum information at reference block numbers in the past. We have removed this requirement by making the quorum parameters immutable in the EigenDAServiceManager contract. This means that a normal Ethereum node can now be used to run the proxy. See https://github.com/Layr-Labs/eigenda-proxy/issues/230 for more details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This summary feels like something better encapsulated in release notes and within our README

// returns an error if some problem calling the contract happens, or the hash is not found.
// We make an eth_call to the EigenDAServiceManager at the given blockNumber to retrieve the hash.
// Therefore, make sure that blockNumber is <128 blocks behind the latest block, to avoid requiring an archive node.
// This is currently enforced by having EthConfirmationDepth be <64.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we poll the latest block number and ensure it's greater than the confirmation block number?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i.e, do we care about the case where the RPC node is far behind?

Comment on lines +27 to +30
// ethConfirmationDepth is using to verify that a blob's batch has been bridged to the EigenDAServiceManager contract at least
// this many blocks in the past. To do so we make an eth_call to the contract at the current block_number - ethConfirmationDepth.
// Hence in order to not require an archive node, this value should be kept low. We force it to be < 64.
// waitForFinalization should be used instead of ethConfirmationDepth if the user wants to wait for finality (typically 64 blocks in happy case).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// ethConfirmationDepth is using to verify that a blob's batch has been bridged to the EigenDAServiceManager contract at least
// this many blocks in the past. To do so we make an eth_call to the contract at the current block_number - ethConfirmationDepth.
// Hence in order to not require an archive node, this value should be kept low. We force it to be < 64.
// waitForFinalization should be used instead of ethConfirmationDepth if the user wants to wait for finality (typically 64 blocks in happy case).
// ethConfirmationDepth is used to verify that a blob's batch commitment has been bridged to the EigenDAServiceManager contract at least
// this many blocks in the past. To do so we make an eth_call to the contract at the current block_number - ethConfirmationDepth.
// Hence in order to not require an archive node, this value should be kept low. We force it to be < 64.
// waitForFinalization should be used instead of ethConfirmationDepth if the user wants to wait for finality (typically 64 blocks in happy case).

// returns an error if some problem calling the contract happens, or the hash is not found.
// We make an eth_call to the EigenDAServiceManager at the given blockNumber to retrieve the hash.
// Therefore, make sure that blockNumber is <128 blocks behind the latest block, to avoid requiring an archive node.
// This is currently enforced by having EthConfirmationDepth be <64.
Copy link
Collaborator

Choose a reason for hiding this comment

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

i.e, do we care about the case where the RPC node is far behind?

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 this pull request may close these issues.

Remove archive node requirements
2 participants