Skip to content

Commit

Permalink
refactor(governance/xc_admin): add more logs on relayer (#2324)
Browse files Browse the repository at this point in the history
* refactor(governance/xc_admin): add more logs on relayer

If the relayer fails for whatever reason it is hard to debug what
is going on. This change adds more logs to see the details of the
proposals which is quite helpful in debugging the issues.

* fix: remove maxretries
  • Loading branch information
ali-bahjati authored Feb 7, 2025
1 parent 928b16c commit 032f98f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 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,
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,7 +97,8 @@ 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),
Expand All @@ -111,6 +108,8 @@ async function run() {
{ commitment: COMMITMENT }
);

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 });
} catch (e) {
if (SKIP_FAILED_REMOTE_INSTRUCTIONS) {
console.error(e);
Expand Down

0 comments on commit 032f98f

Please sign in to comment.