Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: unpack and log agglayer errors #158

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

goran-ethernal
Copy link
Collaborator

@goran-ethernal goran-ethernal commented Nov 1, 2024

Description

This PR introduces error unpacking when getting a certificate header using the interop_getCertificateHeader rpc endpoint on agglayer.

When agglayer marks a certificate as InError it also packs the error in the json format of CertificateHeader status field. These errors can be different, where each error has its own unique error code and structure.

This PR handles unmarshaling of these different errors, so we can log them when we get the certificate header from agglayer, which can be useful for debugging purposes, to know in a clear way what was the cause of error when settling a certificate.

Types of errors from Agglayer

There are 3 main types of errors that the agglayer can return:

  1. TypeConversionError - errors that can occur on failure on the pessimistic proof witness generation from the LocalNetworkStateData and the provide Certificate. List of TypeConversionErrors can be found here: https://agglayer.github.io/agglayer/agglayer_types/enum.Error.html
  2. ProofGenerationError - errors that can occur on failure on the pessimistic proof execution, either natively or in the prover. List of ProofGenerationErrors can be found here: https://agglayer.github.io/agglayer/pessimistic_proof/enum.ProofError.html.
  3. ProofVerificationError - errors that can occur on failure on the proof verification. List of ProofVerificationErrors can be found here: https://agglayer.github.io/agglayer/agglayer_types/enum.ProofVerificationError.html

What to review

Only .go files. .json files are just test vectors for different errors.

@goran-ethernal goran-ethernal self-assigned this Nov 1, 2024
@goran-ethernal goran-ethernal force-pushed the feat/agglayer-error-handling branch 3 times, most recently from a076f0d to 4ef77b4 Compare November 5, 2024 14:03
@goran-ethernal goran-ethernal marked this pull request as ready for review November 5, 2024 14:18
@goran-ethernal goran-ethernal force-pushed the feat/agglayer-error-handling branch 2 times, most recently from 7915df1 to f3c8b33 Compare November 8, 2024 14:17
@goran-ethernal goran-ethernal force-pushed the feat/agglayer-error-handling branch from f3c8b33 to fa6966e Compare November 12, 2024 09:20
@goran-ethernal goran-ethernal merged commit 7545d8f into develop Nov 12, 2024
10 checks passed
@goran-ethernal goran-ethernal deleted the feat/agglayer-error-handling branch November 12, 2024 10:39
joanestebanr added a commit that referenced this pull request Nov 12, 2024
* feat: unpack and log agglayer errors (#158)

* feat: unpack and log agglayer errors

* feat: agglayer error unpacking

* fix: lint and UT

* feat: epoch notifier (#144)

- Send certificates after a percentage of epoch
- Require epoch configuration to AggLayer
- Change config of `aggsender` adding: `BlockFinality` and `EpochNotificationPercentage`

* refact: GetSequence method (#169)

* feat: remove sanity check (#178) (#179)

---------

Co-authored-by: Goran Rojovic <100121253+goran-ethernal@users.noreply.github.com>
Co-authored-by: Rachit Sonthalia <54906134+rachit77@users.noreply.github.com>
Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com>
Vui-Chee added a commit to okx/xlayer-cdk that referenced this pull request Dec 3, 2024
* tag 'v0.5.0-beta6':
  feat: write on database the number of retries per certificate and the certificates in a history table (0xPolygon#208)
  feat: return an error in case agglayer returns certificate with height lower than in local storage (0xPolygon#209)
  chore: simplify the `HashMeddler` (0xPolygon#205)
  fix: clean proof table on start (0xPolygon#207) (0xPolygon#210)
  feat: improve logs (0xPolygon#204)
  fix: cdk603 error calculating previousLocalExitRoot (0xPolygon#199)
  fix: Integration Bali PP (0xPolygon#198)
  feat: check agglayer certificate and use as initial if db is empty (0xPolygon#192)
  feat: sqlite aggregator (0xPolygon#189)
  feat: BridgeMessage e2e test (0xPolygon#184)
  feat: aggsender e2e (0xPolygon#183)
  fix: aggregating proofs (0xPolygon#191) (0xPolygon#193)
  feat: l1infotreesync can be run as individual component (0xPolygon#188)
  fix: l1infotree flaky test (0xPolygon#182)
  fix: `L1InfoRootIncorrect` error from `agglayer` (0xPolygon#185)
  feat: improve aggsender logs (0xPolygon#186) (0xPolygon#187)
  feat: remove sanity check (0xPolygon#178) (0xPolygon#179)
  refact: GetSequence method (0xPolygon#169)
  feat: epoch notifier (0xPolygon#144)
  feat: unpack and log agglayer errors (0xPolygon#158)
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants