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

better rpc error handling when rpc is behind requested block #251

Closed
samlaf opened this issue Jan 22, 2025 · 0 comments · Fixed by #254
Closed

better rpc error handling when rpc is behind requested block #251

samlaf opened this issue Jan 22, 2025 · 0 comments · Fixed by #254
Assignees

Comments

@samlaf
Copy link
Collaborator

samlaf commented Jan 22, 2025

Our current error handling for rpc calls is not fine-grained enough.

See for eg https://github.com/Layr-Labs/eigenda-proxy/blob/main/verify/cert.go#L68-L71:

	confirmationBlockNumber := batchMetadata.GetConfirmationBlockNumber()
	confirmationBlockNumberBigInt := big.NewInt(0).SetInt64(int64(confirmationBlockNumber))
	_, err := cv.retrieveBatchMetadataHash(ctx, batchID, confirmationBlockNumberBigInt)
	if err != nil {
		return fmt.Errorf("batch not found onchain at supposedly confirmed block %d: %w", confirmationBlockNumber, err)
	}

retrieveBatchMetadataHash can actually return 2 very distinct errors:

  1. when rpc node is behind confirmationBlockNumber (see here)
  2. when contract was successfully queried at the confirmationBlockNumber, and the metadata was not present (see here)

Currently in both cases we still wrap the error returned from retrieveBatchMetadataHash in "batch not found onchain at block #", which is wrong. We should prob just have retrieveBatchMetadataHash write the entire error context in both cases, and then the outer callers shouldnt wrap the error at all.

@ethenotethan ethenotethan self-assigned this Jan 22, 2025
ethenotethan added a commit that referenced this issue Jan 30, 2025
* fix(#251): better error logging for RPC lookup errors against service manager (#254)

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

* chore: force verifier's EthConfirmationDepth to be <64

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.

* chore: modify verifier to load quorum parameters only once at initialization

This removes the need for running with an eth archive node.

* style: fix minor lint issue

* docs: update README to mention that archival node is no longer needed

* docs: clean-up README archival node requirement explanation

* docs: fix verify/cert.go comment typo

Co-authored-by: Ethen <[email protected]>

* docs: for eg -> e.g.

* style(cert): remove unecessary bound checks from inside loop

* style: create consts package with EthHappyPathFinalizationDepthBlocks = 64

* style: change panic into error return

* docs: change op reference for eth reference

* docs: make flag comment simpler

* Update verify/cert.go

Co-authored-by: EthenNotEthan <[email protected]>

---------

Co-authored-by: Ethen <[email protected]>

* docs: pimp out readme with blob lifecycle diagrams (#233)

* chore: move pull_request_template.md under .github/ dir

* docs: reorder README sections to feel more natural (move flags to bottom)

* docs (wip): add blob lifecycle diagrams to README

* docs: remove Sidecar from README title (proxy is not necessarily a side)

* docs: add blob lifecycle section to README

* docs: add TOC to README

* style(routing): rename raw_commitment -> payload

We changed the name in README so should be consistent in the code

* docs: update README sections to use Payload instead of Blob

Posting Blobs -> Posting Payloads
Retrieving Blobs -> Retrieving Payloads

* docs: remove "obviously" word

* Required quorums glitch (#255)

* Avoid quorum 1 check on range of Holesky blocks

* Improve SVC address check

* Update verify/verifier.go

Co-authored-by: Samuel Laferriere <[email protected]>

* Update verify/verifier.go

Co-authored-by: Samuel Laferriere <[email protected]>

* Avoid unnecessary cast

* Rename constant

* Fix lint

---------

Co-authored-by: Samuel Laferriere <[email protected]>

* docs: update README posting payload image (#256)

* fix: remove last eth_call that required archive node (#259)

Forgot this one in #241

* docs: update SECURITY.md with audit commit + fix small typos (#263)

* docs: update SECURITY.md

* docs: update SECURITY.md with audited release number + release where findings were addressed

* feat: EigenDAV2 commitment processing and generation

* feat: EigenDAV2 commitment processing and generation - add note describing follow up todo

---------

Co-authored-by: Samuel Laferriere <[email protected]>
Co-authored-by: Gaston Ponti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants