@pushchain/core 5.1.14 → 5.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/orchestrator/internals/outbound-sync.d.ts +2 -2
- package/src/lib/orchestrator/internals/outbound-sync.js +2 -2
- package/src/lib/orchestrator/internals/route-handlers.js +11 -7
- package/src/lib/price-fetch/price-fetch.js +23 -5
- package/src/lib/universal/account/account.d.ts +1 -1
- package/src/lib/universal/account/account.js +1 -1
- package/src/lib/universal-tx-detector/child-inbounds.js +15 -0
package/package.json
CHANGED
|
@@ -15,8 +15,8 @@ export declare const OUTBOUND_POLL_INTERVAL_MS = 3000;
|
|
|
15
15
|
export declare const OUTBOUND_MAX_TIMEOUT_MS = 180000;
|
|
16
16
|
/** Maximum total timeout for the R3 inbound round-trip polling loop (ms). */
|
|
17
17
|
export declare const INBOUND_MAX_TIMEOUT_MS = 300000;
|
|
18
|
-
/** Initial wait before the first inbound poll (ms).
|
|
19
|
-
export declare const INBOUND_INITIAL_WAIT_MS =
|
|
18
|
+
/** Initial wait before the first inbound poll (ms). Validator observation + Push commit + indexer ingestion realistically take 15-25 s on testnet (esp. SVM source), so polling immediately just burns RPC on guaranteed-empty results. */
|
|
19
|
+
export declare const INBOUND_INITIAL_WAIT_MS = 15000;
|
|
20
20
|
/**
|
|
21
21
|
* Thrown by `waitForOutboundTx` when the polling loop exceeds the configured
|
|
22
22
|
* timeout without observing an external tx hash. Callers can `instanceof`
|
|
@@ -30,8 +30,8 @@ exports.OUTBOUND_POLL_INTERVAL_MS = 3000; // 3s
|
|
|
30
30
|
exports.OUTBOUND_MAX_TIMEOUT_MS = 180000; // 180s (3 min)
|
|
31
31
|
/** Maximum total timeout for the R3 inbound round-trip polling loop (ms). */
|
|
32
32
|
exports.INBOUND_MAX_TIMEOUT_MS = 300000; // 300s (5 min) — covers R3 inbound latency on testnet
|
|
33
|
-
/** Initial wait before the first inbound poll (ms).
|
|
34
|
-
exports.INBOUND_INITIAL_WAIT_MS =
|
|
33
|
+
/** Initial wait before the first inbound poll (ms). Validator observation + Push commit + indexer ingestion realistically take 15-25 s on testnet (esp. SVM source), so polling immediately just burns RPC on guaranteed-empty results. */
|
|
34
|
+
exports.INBOUND_INITIAL_WAIT_MS = 15000;
|
|
35
35
|
// ============================================================================
|
|
36
36
|
// Typed errors
|
|
37
37
|
// ============================================================================
|
|
@@ -1235,13 +1235,17 @@ function executeCeaToPushSvm(ctx, params, sourceChain, executeFn) {
|
|
|
1235
1235
|
response.chain = sourceChain;
|
|
1236
1236
|
const chainInfo = chain_1.CHAIN_INFO[sourceChain];
|
|
1237
1237
|
response.chainNamespace = `${chain_1.VM_NAMESPACE[chainInfo.vm]}:${chainInfo.chainId}`;
|
|
1238
|
-
// R3 SVM inbound round-trip tracking
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1242
|
-
//
|
|
1243
|
-
//
|
|
1244
|
-
|
|
1238
|
+
// R3 SVM inbound round-trip tracking is disabled.
|
|
1239
|
+
//
|
|
1240
|
+
// For Route 3 SVM drains (rescue_funds-style flow, txType=RESCUE_FUNDS),
|
|
1241
|
+
// empirical check on donut showed the keeper does NOT create a child
|
|
1242
|
+
// universalTxId on Push for the Solana-side `UniversalTx(fromCEA=true)`
|
|
1243
|
+
// log — the parent utxId's `outboundStatus=OBSERVED` is the terminal state.
|
|
1244
|
+
// Polling for a deterministically-derived child id therefore never
|
|
1245
|
+
// resolves, and the cosmos `inbound_tx_hash` text-search fallback also
|
|
1246
|
+
// returns 0 hits. Receipts now resolve as soon as the Solana outbound is
|
|
1247
|
+
// observed instead of timing out at 300s.
|
|
1248
|
+
response._expectsInboundRoundTrip = false;
|
|
1245
1249
|
return response;
|
|
1246
1250
|
});
|
|
1247
1251
|
}
|
|
@@ -54,11 +54,29 @@ class PriceFetch {
|
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
55
|
}, { commitment: 'confirmed' });
|
|
56
56
|
const program = new anchor_1.Program(feeLocker_json_1.default, provider);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
let result;
|
|
58
|
+
try {
|
|
59
|
+
result = yield program.methods['getSolPrice']()
|
|
60
|
+
.accounts({
|
|
61
|
+
priceUpdate: PRICE_ACCOUNT,
|
|
62
|
+
})
|
|
63
|
+
.view();
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const e = err;
|
|
67
|
+
console.error('[price-fetch][SVM getSolPrice] FAILED');
|
|
68
|
+
console.error(' rpc:', rpcUrls[0]);
|
|
69
|
+
console.error(' locker:', lockerContract);
|
|
70
|
+
console.error(' priceAccount:', PRICE_ACCOUNT.toBase58());
|
|
71
|
+
console.error(' message:', e === null || e === void 0 ? void 0 : e.message);
|
|
72
|
+
if (e === null || e === void 0 ? void 0 : e.logs)
|
|
73
|
+
console.error(' logs:', e.logs);
|
|
74
|
+
if (e === null || e === void 0 ? void 0 : e.simulationResponse)
|
|
75
|
+
console.error(' simulationResponse:', JSON.stringify(e.simulationResponse, null, 2));
|
|
76
|
+
if (e === null || e === void 0 ? void 0 : e.programErrorStack)
|
|
77
|
+
console.error(' programErrorStack:', e.programErrorStack);
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
62
80
|
if (!result || !result.price) {
|
|
63
81
|
throw new Error('Invalid price data returned');
|
|
64
82
|
}
|
|
@@ -94,7 +94,7 @@ export declare function deriveSvmCeaPda(ueaAddress: `0x${string}`, targetChain:
|
|
|
94
94
|
*
|
|
95
95
|
* @param account - UniversalAccount with chain and address.
|
|
96
96
|
* @param options.chain - Target external chain for CEA derivation. If omitted, returns UEA.
|
|
97
|
-
* @param options.skipNetworkCheck - If true, skip deployment check and return deployed:
|
|
97
|
+
* @param options.skipNetworkCheck - If true, skip deployment check and return deployed: null.
|
|
98
98
|
* @returns The derived executor account address and deployment status.
|
|
99
99
|
*/
|
|
100
100
|
export declare function deriveExecutorAccount(account: UniversalAccount, options?: {
|
|
@@ -471,7 +471,7 @@ function deriveSvmCeaPda(ueaAddress, targetChain, skipNetworkCheck) {
|
|
|
471
471
|
*
|
|
472
472
|
* @param account - UniversalAccount with chain and address.
|
|
473
473
|
* @param options.chain - Target external chain for CEA derivation. If omitted, returns UEA.
|
|
474
|
-
* @param options.skipNetworkCheck - If true, skip deployment check and return deployed:
|
|
474
|
+
* @param options.skipNetworkCheck - If true, skip deployment check and return deployed: null.
|
|
475
475
|
* @returns The derived executor account address and deployment status.
|
|
476
476
|
*/
|
|
477
477
|
function deriveExecutorAccount(account, options) {
|
|
@@ -135,6 +135,21 @@ function resolveChildInboundsFromLogs(pushClient, sourceChainCaip, externalTxHas
|
|
|
135
135
|
}
|
|
136
136
|
catch (err) {
|
|
137
137
|
diagnostics === null || diagnostics === void 0 ? void 0 : diagnostics.push(`getUniversalTxByIdV2(${utxIdHex}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
138
|
+
// Cosmos lookup failed (commonly NotFound while the indexer is still
|
|
139
|
+
// catching up). The utxId is deterministically derived from the source
|
|
140
|
+
// log, so surface it as notFound rather than dropping the entry —
|
|
141
|
+
// otherwise callers like inbound-tracker repeatedly re-run the full
|
|
142
|
+
// detector pass instead of advancing to lightweight status polling.
|
|
143
|
+
out.push({
|
|
144
|
+
universalTxId: utxIdHex,
|
|
145
|
+
sourceLogIndex: log.logIndex,
|
|
146
|
+
sourceEventName: log.eventName,
|
|
147
|
+
status: 0,
|
|
148
|
+
statusName: STATUS_NAMES[0],
|
|
149
|
+
pcTxHashes: [],
|
|
150
|
+
outboundHashes: [],
|
|
151
|
+
notFound: true,
|
|
152
|
+
});
|
|
138
153
|
}
|
|
139
154
|
}
|
|
140
155
|
return out;
|