fix: improve cctp v2 offchain lookup service#7334
Conversation
🦋 Changeset detectedLatest commit: e57b5b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…7360) Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com>
Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/fuzzy-yaks-pull.md(1 hunks)typescript/ccip-server/src/services/CCTPAttestationService.ts(2 hunks)typescript/ccip-server/src/utils/prometheus.ts(1 hunks)typescript/sdk/src/ism/metadata/ccipread.ts(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/fuzzy-yaks-pull.md
🚧 Files skipped from review as they are similar to previous changes (1)
- typescript/sdk/src/ism/metadata/ccipread.ts
🧰 Additional context used
🧬 Code graph analysis (1)
typescript/ccip-server/src/services/CCTPAttestationService.ts (1)
typescript/ccip-server/src/utils/prometheus.ts (1)
PrometheusMetrics(47-57)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-and-push-to-gcr
- GitHub Check: lint-rs
- GitHub Check: lander-coverage
- GitHub Check: test-rs
- GitHub Check: Cursor Bugbot
🔇 Additional comments (3)
typescript/ccip-server/src/utils/prometheus.ts (1)
30-31: Clean addition for CCTP v2 error tracking.These new enum members follow the existing naming pattern and will help classify JSON parse failures and pending-state scenarios. Good stuff.
typescript/ccip-server/src/services/CCTPAttestationService.ts (2)
9-14: Type definitions align with CCTP v2 API spec.The DelayReason and Status types correctly model the v2 response structure. Nice reference to the docs, too.
16-24: Let me dig deeper into the codebase to see how v1 and v2 responses are handled:Let me search the codebase for how v1 and v2 responses are actually handled:
Let me search the codebase to understand how responses are parsed and where eventNonce comes from:
Perfect. I found the official API documentation. Let me verify the V2 structure as well:
No action needed — eventNonce is present in CCTP V1 API responses.
The Circle API documentation for V1 messages confirms
eventNonceis returned in the response alongsidemessageandattestationfields, making it a required field across both protocol versions. The interface is correctly structured witheventNoncerequired and the v2-specific fields (cctpVersion,status,delayReason) marked optional.Likely an incorrect or invalid review comment.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7334 +/- ##
============================
============================
🚀 New features to boost your workflow:
|
Co-authored-by: Jamin <57451149+yjamin@users.noreply.github.com> Co-authored-by: Jeff <jeff.no.zhao@gmail.com> Co-authored-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com> Co-authored-by: Danil Nemirovsky <ameten@users.noreply.github.com> Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com> Co-authored-by: Mohammed Hussan <22501692+Mo-Hussain@users.noreply.github.com> Co-authored-by: Christopher Brumm <97845034+christopherbrumm@users.noreply.github.com> Co-authored-by: Lee <6251863+ltyu@users.noreply.github.com> Co-authored-by: Troy Kessler <43882936+troykessler@users.noreply.github.com> Co-authored-by: iPLAY888 <133153661+letmehateu@users.noreply.github.com> Co-authored-by: xeno097 <xeno097.cp@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrey Taranov <86911+antigremlin@users.noreply.github.com>
Description
Drive-by changes
Related issues
Fixes opaque error
Backward compatibility
Testing
Manual
$ yarn hyperlane status --private-key $(hypkey) --origin base --relay --dispatchTx 0xf78db32e5c77317a25b94608016ea19e4f22aaf337b1ab39ae6052d0d967c9a1 Hyperlane CLI Checking status of message 0x6a1e2bbf3e46e356157f7568500429e2f789300fa309add0afc746fe7216fec9 on hyperevm Message 0x6a1e2bbf3e46e356157f7568500429e2f789300fa309add0afc746fe7216fec9 was not yet delivered Preparing to relay message 0x6a1e2bbf3e46e356157f7568500429e2f789300fa309add0afc746fe7216fec9 Server http://localhost:3000/cctp/getCctpAttestation responded with error: CCTP attestation is pending due to insufficient_fee Failed to relay message 0x6a1e2bbf3e46e356157f7568500429e2f789300fa309add0afc746fe7216fec9, Error: Could not fetch CCIP-read metadataSummary by CodeRabbit
Bug Fixes
New Features
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.
Note
Enhances CCTP attestation error handling (pending/JSON-parse with metrics) and hardens CCIP-read metadata fetch with safe JSON/0x handling and retries across URLs.
CCTPAttestationServicehandling of CCTP v2 responses: parse JSON safely, detectPENDINGattestations, and log delay reasons; emit new Prometheus error metrics (cctp_attestation_service_json_parse_error,cctp_attestation_service_pending).eventNonce, optionalcctpVersion,status, anddelayReason.ensure0xbefore returning.Written by Cursor Bugbot for commit e57b5b1. This will update automatically on new commits. Configure here.