apow-cli 0.11.10 → 0.11.11
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/dist/mint.js +17 -9
- package/package.json +1 -1
package/dist/mint.js
CHANGED
|
@@ -168,15 +168,23 @@ async function runMintFlow(options = {}) {
|
|
|
168
168
|
throw new Error("Challenge request reverted on-chain");
|
|
169
169
|
}
|
|
170
170
|
challengeSpinner.stop(`Requesting challenge${attempt > 1 ? ` (retry ${attempt}/2)` : ""}... done`);
|
|
171
|
-
//
|
|
172
|
-
// waiting for latest-state propagation
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
// Try reading the seed at the exact receipt block to avoid burning the 20s
|
|
172
|
+
// window waiting for latest-state propagation. Many public RPCs are NOT
|
|
173
|
+
// archive nodes, so they throw "header not found" for historical blocks —
|
|
174
|
+
// catch that and fall through to latest-state polling.
|
|
175
|
+
let challengeSeed = ZERO_SEED;
|
|
176
|
+
try {
|
|
177
|
+
challengeSeed = (await wallet_1.publicClient.readContract({
|
|
178
|
+
address: config_1.config.miningAgentAddress,
|
|
179
|
+
abi: miningAgentAbi,
|
|
180
|
+
functionName: "challengeSeeds",
|
|
181
|
+
args: [account.address],
|
|
182
|
+
blockNumber: challengeReceipt.blockNumber,
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Non-archive RPC — fall through to latest-state polling below.
|
|
187
|
+
}
|
|
180
188
|
if (challengeSeed.toLowerCase() === ZERO_SEED.toLowerCase()) {
|
|
181
189
|
// Fall back to latest-state polling if the provider does not expose the
|
|
182
190
|
// just-mined storage view reliably.
|