Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ccip-cli/src/commands/manual-exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*
* # Execute with custom gas limit
* ccip-cli manual-exec 0xSourceTxHash... --gas-limit 500000
*
* # Execute with custom Solana heap frame
* ccip-cli manual-exec 0xMessageId... --heap-frame-bytes 262144
* ```
*
* @packageDocumentation
Expand Down Expand Up @@ -81,6 +84,11 @@ export const builder = (yargs: Argv) =>
describe:
'Override gas limit for tokens releaseOrMint calls (0 keeps original, v1.5..v1.6 only)',
},
'heap-frame-bytes': {
type: 'number',
describe:
'For Solana, request a transaction-wide heap frame size in bytes (must be a multiple of 1024).',
},
'estimate-gas-limit': {
type: 'number',
describe:
Expand Down
2 changes: 2 additions & 0 deletions ccip-sdk/src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ export type ExecuteOpts = (
gasLimit?: number
/** For EVM (v1.5..v1.6), overrides gasLimit on tokenPool call */
tokensGasLimit?: number
/** For Solana, request a transaction-wide heap frame size in bytes (must be a multiple of 1024). */
heapFrameBytes?: number
/** For Solana, send report in chunks to OffRamp, to later execute */
forceBuffer?: boolean
/** For Solana, create and extend addresses in a lookup table before executing */
Expand Down
20 changes: 19 additions & 1 deletion ccip-sdk/src/solana/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
type TransactionInstruction,
AddressLookupTableAccount,
AddressLookupTableProgram,
ComputeBudgetProgram,
PublicKey,
SystemProgram,
} from '@solana/web3.js'
Expand Down Expand Up @@ -47,7 +48,12 @@ export async function generateUnsignedExecuteReport(
payer: PublicKey,
offramp: PublicKey,
execReport: ExecutionInput<CCIPMessage_V1_6_Solana>,
opts?: { forceLookupTable?: boolean; forceBuffer?: boolean; clearLeftoverAccounts?: boolean },
opts?: {
forceLookupTable?: boolean
forceBuffer?: boolean
clearLeftoverAccounts?: boolean
heapFrameBytes?: number
},
): Promise<UnsignedSolanaTx> {
const { connection, logger = console } = ctx

Expand Down Expand Up @@ -126,6 +132,18 @@ export async function generateUnsignedExecuteReport(
.remainingAccounts(accounts.slice(12))
.instruction()

if (opts?.heapFrameBytes != null && opts.heapFrameBytes % 1024 !== 0) {
throw new Error(
`heapFrameBytes must be a multiple of 1024, got ${opts.heapFrameBytes}`,
)
}

if (opts?.heapFrameBytes) {
instructions.push(
ComputeBudgetProgram.requestHeapFrame({ bytes: opts.heapFrameBytes }),
)
}

// actual exec tx
let execIndex = instructions.length
instructions.push(execIx)
Expand Down
Loading