Skip to content

Commit 032f98f

Browse files
authored
refactor(governance/xc_admin): add more logs on relayer (#2324)
* 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
1 parent 928b16c commit 032f98f

File tree

1 file changed

+9
-6
lines changed
  • governance/xc_admin/packages/crank_pythnet_relayer/src

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 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,7 +97,8 @@ 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),
@@ -111,6 +108,8 @@ async function run() {
111108
{ commitment: COMMITMENT }
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)