Skip to main content
Version: 1.0.0

Function: calculateManualExecProof()

calculateManualExecProof<V>(messagesInBatch: readonly CCIPMessage<V>[], lane: Lane<V>, messageId: string, merkleRoot?: string, ctx?: WithLogger): { merkleRoot: string; proofFlagBits: bigint; proofs: string[]; }

Defined in: execution.ts:54

Pure/sync function to calculate/generate OffRamp.executeManually report for messageIds

Type Parameters

Type ParameterDefault type
V extends CCIPVersionCCIPVersion

Parameters

ParameterTypeDescription
messagesInBatchreadonly CCIPMessage<V>[]Array containing all messages in batch, ordered
laneLane<V>Arguments for leafHasher (lane info)
messageIdstringMessage ID to prove for manual execution
merkleRoot?stringOptional merkleRoot of the CommitReport, for validation
ctx?WithLoggerContext for logging

Returns

{ merkleRoot: string; proofFlagBits: bigint; proofs: string[]; }

ManualExec report arguments

merkleRoot

merkleRoot: string

proofFlagBits

proofFlagBits: bigint

proofs

proofs: string[] = proof.hashes

Throws

CCIPMessageNotInBatchError - When the messageId is not found in the provided batch

Throws

CCIPMerkleRootMismatchError - When calculated merkle root doesn't match the provided one

Remarks

This is a pure/sync function that performs no I/O - all data must be pre-fetched. It builds a merkle tree from the messages, generates a proof for the target messageId, and optionally validates against the provided merkleRoot.

The returned proof can be used with execute to manually execute a stuck message.

Example

TypeScript
import { calculateManualExecProof, EVMChain } from '@chainlink/ccip-sdk'

// Fetch the request and all messages in its batch
const request = (await source.getMessagesInTx(txHash))[0]
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, commit.report)

// Calculate proof for manual execution
const proof = calculateManualExecProof(
messages,
request.lane,
request.message.messageId,
commit.report.merkleRoot
)
console.log('Merkle root:', proof.merkleRoot)
console.log('Proofs:', proof.proofs)

See

  • discoverOffRamp - Find the OffRamp for manual execution
  • execute - Execute the report on destination chain
  • generateUnsignedExecute - Build unsigned execution tx