Open
Conversation
…num to da-server (#45) * feat(altda-client): pass l1_inclusion_block_number as query param to da server This is used to perform punctuality check on EigenDA, but is generic and should be used by all da layers for the same purpose. * feat(altda): drop invalid certs Defined generic protocol where da-server will return a 418 (TEAPOT) error when a cert is invalid, along with the reason (250 bytes) in the body. The 418 error is transformed into an internal golang InvalidCommitmentError which when received by the derivation pipeline, causes it to skip the commitment and move forward. * chore(daclient): use uint64 for blocknum directly instead of L1BlockRef struct The struct was confusing to use in tests because it wasnt sure only the .Number field of it was used, so made implementers unsure whether they needed to populate the whole struct. Since we only used the .Number field, I opted to just take a uint64 directly as argument to GetInput. * style(daclient): use MaxBytesReader Use MaxBytesReader and document why we restrict error body to 1000 characters (upped from 250 previously): to prevent DDoS
) feat: InvalidCommitmentError contains status code This commit goes hand-in-hand with Layr-Labs/eigenda-proxy#406, as it now parses the StatusCodes that are returned during 418 TEAPOT errors by proxy.
feat(altda): implement all teapot statuscodes This should (hopefully!) be the last PR changing the teapot error handling. I think (??) we've finally nailed it with the recent spec: https://github.com/Layr-Labs/eigenda/blob/f4ef5cd55633d70bed0d54416c2d253684f0639c/docs/spec/src/integration/spec/6-secure-integration.md#derivation-process This PR thus implements handling of the 4 types of TEAPOT errors possible. Still need to update proxy to return those errors.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## piersy/celo-rebase-16 #415 +/- ##
======================================================
Coverage 66.42% 66.42%
======================================================
Files 55 55
Lines 4030 4030
======================================================
Hits 2677 2677
Misses 1209 1209
Partials 144 144
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update of #408 on rebase-16.
These are cherry-picks implementing EigenDA integration for the alt-DA (alternative data availability) client. They build on each other in
sequence:
The foundation. Passes the L1 inclusion block number as a query param to the DA server so it can perform a recency/punctuality check —
verifying that a DA certificate's reference block number isn't stale relative to when it landed on L1 (the RBN recency validation from the
spec). When the DA server detects an invalid cert, it returns a 418 TEAPOT status, which gets turned into an InvalidCommitmentError in Go. The
derivation pipeline then drops (skips) that commitment and moves on.
Extends the InvalidCommitmentError to carry the status code from the 418 response body. This goes hand-in-hand with eigenda-proxy changes to
actually return meaningful error info in the teapot response.
The final piece. Implements handling for all 4 types of teapot errors that the DA server can return, aligning with the spec's failure cases
(parse failed, recency check failed, cert validity failed, decode blob failed).
Why
The EigenDA spec defines a derivation process where invalid DA certificates must be dropped rather than stalling the chain. The mechanism is:
This prevents a malicious batcher from stalling the rollup by posting garbage or stale certs. The chain just drops them and keeps going.