Skip to content

Commit bf37e07

Browse files
committed
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.
1 parent 5ef46e4 commit bf37e07

File tree

1 file changed

+10
-7
lines changed
  • governance/xc_admin/packages/crank_pythnet_relayer/src

1 file changed

+10
-7
lines changed

governance/xc_admin/packages/crank_pythnet_relayer/src/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
Connection,
1616
Keypair,
1717
PublicKey,
18-
SystemProgram,
1918
TransactionInstruction,
2019
} from "@solana/web3.js";
2120
import * as fs from "fs";
@@ -32,9 +31,6 @@ import {
3231
REMOTE_EXECUTOR_ADDRESS,
3332
envOrErr,
3433
PriceStoreMultisigInstruction,
35-
findDetermisticPublisherBufferAddress,
36-
PRICE_STORE_BUFFER_SPACE,
37-
PRICE_STORE_PROGRAM_ID,
3834
createDeterministicPublisherBufferAccountInstruction,
3935
} from "@pythnetwork/xc-admin-common";
4036

@@ -101,16 +97,19 @@ async function run() {
10197
) {
10298
const preInstructions: TransactionInstruction[] = [];
10399

104-
console.log(`Found VAA ${lastSequenceNumber}, relaying ...`);
100+
console.log(`Found VAA ${lastSequenceNumber}, relaying vaa ...`);
101+
105102
await postVaaSolana(
106103
provider.connection,
107104
signTransactionFactory(KEYPAIR),
108105
WORMHOLE_ADDRESS[CLUSTER]!,
109106
provider.wallet.publicKey,
110107
Buffer.from(response.vaaBytes, "base64"),
111-
{ commitment: COMMITMENT }
108+
{ commitment: COMMITMENT, maxRetries: 10 }
112109
);
113110

111+
console.log(`VAA ${lastSequenceNumber} relayed. executing ...`);
112+
114113
let extraAccountMetas: AccountMeta[] = [
115114
{ pubkey: executorKey, isSigner: false, isWritable: true },
116115
];
@@ -128,6 +127,10 @@ async function run() {
128127
);
129128

130129
const parsedInstruction = multisigParser.parseInstruction(ix);
130+
131+
console.log("Parsed instruction:");
132+
console.dir(parsedInstruction, { depth: null });
133+
131134
if (
132135
parsedInstruction instanceof PythMultisigInstruction &&
133136
parsedInstruction.name == "addProduct"
@@ -200,7 +203,7 @@ async function run() {
200203
.postInstructions([
201204
ComputeBudgetProgram.setComputeUnitLimit({ units: 1000000 }),
202205
])
203-
.rpc({ skipPreflight: true });
206+
.rpc({ skipPreflight: false });
204207
} catch (e) {
205208
if (SKIP_FAILED_REMOTE_INSTRUCTIONS) {
206209
console.error(e);

0 commit comments

Comments
 (0)