@ethernity-cloud/sdk-js 1.5.19 → 1.5.20
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.
|
@@ -515,7 +515,23 @@ class EtnySecureLock {
|
|
|
515
515
|
// input carries no checksum (has_checksum === false) and is skipped. Kept
|
|
516
516
|
// identical across securelock / trustedzone / validator so all three agree.
|
|
517
517
|
async validateClientPayload(payload_data, input_data) {
|
|
518
|
-
|
|
518
|
+
// The order metadata comes from the chain; a transient RPC failure
|
|
519
|
+
// must end in a signed failure result the trustedzone can hand over,
|
|
520
|
+
// not in a task that produces nothing until the trustedzone times out.
|
|
521
|
+
const maxRetries = 5;
|
|
522
|
+
for (let attempt = 1; ; attempt++) {
|
|
523
|
+
try {
|
|
524
|
+
await this.getDORequestMetadata();
|
|
525
|
+
break;
|
|
526
|
+
} catch (e) {
|
|
527
|
+
if (attempt === maxRetries) {
|
|
528
|
+
this.task_code = TaskStatus.SYSTEM_ERROR;
|
|
529
|
+
this.task_result = `Failed to fetch metadata after ${maxRetries} attempts: ${e && e.message ? e.message : e}`;
|
|
530
|
+
this.is_valid_client_data = false;
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
519
535
|
|
|
520
536
|
const pmeta = this._metadata.payload_metadata_obj;
|
|
521
537
|
if (pmeta.has_checksum) {
|
package/package.json
CHANGED