Skip to content
Merged
Changes from 1 commit
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
17 changes: 10 additions & 7 deletions governance/xc_admin/packages/crank_pythnet_relayer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
Connection,
Keypair,
PublicKey,
SystemProgram,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports

TransactionInstruction,
} from "@solana/web3.js";
import * as fs from "fs";
Expand All @@ -32,9 +31,6 @@ import {
REMOTE_EXECUTOR_ADDRESS,
envOrErr,
PriceStoreMultisigInstruction,
findDetermisticPublisherBufferAddress,
PRICE_STORE_BUFFER_SPACE,
PRICE_STORE_PROGRAM_ID,
createDeterministicPublisherBufferAccountInstruction,
} from "@pythnetwork/xc-admin-common";

Expand Down Expand Up @@ -101,16 +97,19 @@ async function run() {
) {
const preInstructions: TransactionInstruction[] = [];

console.log(`Found VAA ${lastSequenceNumber}, relaying ...`);
console.log(`Found VAA ${lastSequenceNumber}, relaying vaa ...`);

await postVaaSolana(
provider.connection,
signTransactionFactory(KEYPAIR),
WORMHOLE_ADDRESS[CLUSTER]!,
provider.wallet.publicKey,
Buffer.from(response.vaaBytes, "base64"),
{ commitment: COMMITMENT }
{ commitment: COMMITMENT, maxRetries: 10 }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't see what the default is. It was often failing at this step.

Copy link
Contributor

@guibescos guibescos Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meeeh, people in Solana recommend 0 retries at this level
https://github.com/rpcpool/optimized-txs-examples/blob/main/selfSolTransfer.mjs#L116
instead if you'd like to retry you should put postVaaSolana inside a for loop

);

console.log(`VAA ${lastSequenceNumber} relayed. executing ...`);

let extraAccountMetas: AccountMeta[] = [
{ pubkey: executorKey, isSigner: false, isWritable: true },
];
Expand All @@ -128,6 +127,10 @@ async function run() {
);

const parsedInstruction = multisigParser.parseInstruction(ix);

console.log("Parsed instruction:");
console.dir(parsedInstruction, { depth: null });

if (
parsedInstruction instanceof PythMultisigInstruction &&
parsedInstruction.name == "addProduct"
Expand Down Expand Up @@ -200,7 +203,7 @@ async function run() {
.postInstructions([
ComputeBudgetProgram.setComputeUnitLimit({ units: 1000000 }),
])
.rpc({ skipPreflight: true });
.rpc({ skipPreflight: false });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we get better logs with simulation. Why was it true before?

Copy link
Contributor

@guibescos guibescos Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I normally got the logs from explorer, but it might be nicer to get them from Grafana (like this would enable)

} catch (e) {
if (SKIP_FAILED_REMOTE_INSTRUCTIONS) {
console.error(e);
Expand Down
Loading