Repository navigation
Conversation
Reconcile the relayer's tracked message status against the destination chain so a hung executor, a dropped completion callback, or a receipt that never finalised cannot strand a message in flight forever. - MessageQueue lifecycle API for reconciliation: markSubmitted() records a broadcast transaction hash, fail() force-fails an in-flight message, getMessageStatus()/getInflightSnapshot() expose tracked state, and complete() now advances the message to confirmed and records a late duplicate result only once. Staleness is measured from the current delivery attempt (inflightAt, set at dequeue) so normal retries are never flagged stale. - New MessageStatusReconciler repairs drift: stale processing messages are re-queued (or failed once the retry budget is spent); submitted messages are confirmed when the receipt is final, failed on revert, and re-queued when no receipt appears after the stale threshold. Fresh deliveries and chains without a provider are left untouched. Emits message-reconciled, stale-message-detected, reconcile-error, reconciler-degraded/recovered and a per-run reconciliation-summary, and exports getStats(). - Ships EvmExecutorStatusProvider, which reuses EvmExecutor's own getTransactionStatus so reconciliation shares the live confirmation policy instead of defining a second notion of finality. - 42 new tests (121 total): queue lifecycle, reconciler unit coverage at 100% statements/functions/lines, and an integration pipeline across queue -> reconciler -> executor -> mocked RPC. - Docs: MESSAGE_STATUS_RECONCILIATION.md plus a cross-link from the duplicate-detection doc; CI now runs relayer-service tests. Closes MDTechLabs#1164
…tatus-reconciliation # Conflicts: # docs/CROSS_CHAIN_DUPLICATE_MESSAGE_DETECTION.md
…ion merge Merging upstream main brought in malformed-message validation (PR MDTechLabs#1241), which rejects messages whose sourceChainId equals destinationChainId. Our reconciler and pipeline fixtures used 'ethereum' for both. Point the fixtures at an 'arbitrum' source so they stay valid under the new intake validation while still exercising the EVM destination path. Full suite: 295 tests passing (11 suites).
|
@barry01-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
12 tasks
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.
Reconcile the relayer's tracked message status against the destination chain so a hung executor, a dropped completion callback, or a receipt that never finalised cannot strand a message in flight forever.
Closes #1164
What changed
MessageQueuelifecycle API for reconciliation (backward compatible, purely additive):markSubmitted(messageId, txHash)— records a broadcast transaction; the message stays in flight assubmitteduntil completed, failed, or reconciled.fail(messageId, error?)— force-fails an in-flight message with no further delivery attempt (used for on-chain reverts).getMessageStatus()/getInflightSnapshot()— read-only tracked state for monitoring and the reconciler.complete()now advances the message toconfirmedon success, and a late duplicate completion (e.g. reconciler racing the executor) is recorded once so the real outcome is never overwritten.inflightAt, set at dequeue), so normal retries are never flagged stale.MessageStatusReconciler— repairs drift in in-flight messages:processingpaststaleAfterMs→ re-queued for another attempt; failed once the retry budget is spent.submitted+ final receipt →confirmed; reverted receipt → failed immediately (deterministic); no receipt afterstaleAfterMs→ re-queued for resubmission.message-reconciled,stale-message-detected,reconcile-error,reconciler-degraded/reconciler-recovered, per-runreconciliation-summary;getStats()metrics.EvmExecutorStatusProvider— reference provider that reusesEvmExecutor.getTransactionStatus, so reconciliation shares the live confirmation policy rather than defining a second notion of finality. Other chain adapters (Soroban/Solana) build to the sameMessageStatusProvidershape.docs/MESSAGE_STATUS_RECONCILIATION.md(rules table, events, metrics, configuration, dependencies, troubleshooting) plus a cross-link fromdocs/CROSS_CHAIN_DUPLICATE_MESSAGE_DETECTION.md.Verification evidence
maininto the branch: the 270 upstream tests (including PR test(messaging): reject malformed cross-chain messages at intake #1241's malformed-message validation) untouched plus our 26 reconciler, 11 queue-lifecycle, and 4 pipeline tests.message-status-reconciler.spec.tscovers normal/boundary/failure paths: fresh vs stale, retries exhausted, confirm/revert/not-found, provider throws/unknown/unavailable, degraded/recovered alerts, timers, run coalescing. 100% statement/function/line coverage (98% branches; one defensive formatting fallback).reconciliation-pipeline.spec.tsintegrates queue → reconciler → executor → mocked RPC: executor-backed confirmation, lost-submission recovery (requeue then confirm), revert → permanent fail, and healthy deliveries untouched.tsc --noEmitclean;npm run buildsucceeds.sourceChainId === destinationChainId.Notes for reviewers
apps/relayer-service/node_modulesis a broken install) required a localpnpm install --ignore-workspaceto run tests; the trackednode_modulesis committed untouched.