Skip to content

Commit dbdce7b

Browse files
committed
chore: add retry logic to names and fix benchmarking suite
1 parent d3e59a9 commit dbdce7b

13 files changed

Lines changed: 1277 additions & 118 deletions

File tree

.github/ISSUE_TEMPLATE/benchmark-request.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ body:
1616
- label: 25 MB
1717
- label: 50 MB
1818
- label: 100 MB
19-
- label: 200 MB
20-
- label: 500 MB
2119
- label: UI build (dotns-ui)
2220

2321
- type: textarea

.github/actions/dotns/action.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,23 @@ runs:
9797
# registered through the governance (registerReserved) path, which is
9898
# gated on the caller being whitelisted (the "Whitelist deployer" step
9999
# authorises exactly this). Longer names use regular registration.
100-
REGISTER_ARGS=(register domain --name "$BASENAME")
100+
# Base registration is commit-reveal, so retries are delegated to the
101+
# CLI's --retry: on failure it resumes from the cached commitment rather
102+
# than submitting a fresh commit each attempt. --retry counts retries on
103+
# top of the initial attempt, so subtract one from the total budget.
104+
RETRIES=$((MAX_RETRIES - 1))
105+
[[ "$RETRIES" -lt 0 ]] && RETRIES=0
106+
107+
REGISTER_ARGS=(register domain --name "$BASENAME" --retry "$RETRIES")
101108
if [[ "${#BASENAME}" -le 5 ]]; then
102109
REGISTER_ARGS+=(--governance)
103110
echo "::notice::${BASENAME}.dot is a reserved name; using governance registration."
104111
fi
105112
106-
for ATTEMPT in $(seq 1 "$MAX_RETRIES"); do
107-
echo "Register base attempt $ATTEMPT/$MAX_RETRIES"
108-
109-
if dotns "${REGISTER_ARGS[@]}" 2>&1; then
110-
echo "::notice::Base domain ${BASENAME}.dot registered"
111-
exit 0
112-
fi
113-
114-
echo "::warning::Register base attempt $ATTEMPT failed"
115-
[[ "$ATTEMPT" -lt "$MAX_RETRIES" ]] && sleep "$RETRY_DELAY"
116-
done
113+
if dotns "${REGISTER_ARGS[@]}" 2>&1; then
114+
echo "::notice::Base domain ${BASENAME}.dot registered"
115+
exit 0
116+
fi
117117
118118
echo "::error::Base domain registration failed after $MAX_RETRIES attempts."
119119
echo ""

.github/workflows/benchmark-on-demand.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ jobs:
4545
"25 MB": { size: "25MB", slug: "25mb" },
4646
"50 MB": { size: "50MB", slug: "50mb" },
4747
"100 MB": { size: "100MB", slug: "100mb" },
48-
"200 MB": { size: "200MB", slug: "200mb" },
49-
"500 MB": { size: "500MB", slug: "500mb" },
5048
};
5149
5250
const selected = [];
@@ -269,7 +267,7 @@ jobs:
269267
const reports = reportFiles
270268
.map((f) => JSON.parse(fs.readFileSync(path.join(reportsDir, f), "utf8")))
271269
.sort((a, b) => {
272-
const sizeOrder = ["1MB","5MB","10MB","25MB","50MB","100MB","200MB","500MB","UI build"];
270+
const sizeOrder = ["1MB","5MB","10MB","25MB","50MB","100MB","UI build"];
273271
return sizeOrder.indexOf(a.size) - sizeOrder.indexOf(b.size);
274272
});
275273

examples/deploy/sized-sites/benchmarks.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,5 @@
2222
{
2323
"size": "100MB",
2424
"slug": "100mb"
25-
},
26-
{
27-
"size": "200MB",
28-
"slug": "200mb"
29-
},
30-
{
31-
"size": "500MB",
32-
"slug": "500mb"
3325
}
3426
]

packages/cli/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,40 @@ dotns --password test-password register domain --account default --name coolname
118118

119119
# With reverse record
120120
dotns --password test-password register domain --account default --name coolname42 --reverse
121+
122+
# Auto-retry on failure, resuming from the cached commitment (here, up to 3 times)
123+
dotns --password test-password register domain --account default --name coolname42 --retry 3
124+
```
125+
126+
### Resume and manage commitments
127+
128+
Registration is a two-step commit-reveal: the commit lands on-chain, then after the
129+
minimum commitment age the reveal completes the mint. If the reveal is interrupted
130+
(crash, network drop, closed terminal), the commitment is cached locally so it can be
131+
resumed rather than restarted. The reveal secret is encrypted at rest with your
132+
credential (keystore password, mnemonic, or key URI); the rest of the record is
133+
plaintext so it can be listed and cleared without unlocking.
134+
135+
Records live under `~/.dotns/registrations/` (override with `DOTNS_REGISTRATION_DIR`).
136+
137+
```bash
138+
# Resume the most recent interrupted registration
139+
dotns --password test-password register retry --account default
140+
141+
# Resume a specific cached commitment by name
142+
dotns --password test-password register retry coolname42 --account default
143+
144+
# List cached commitments and their on-chain status
145+
dotns register list
146+
147+
# Review cached commitments: purges completed ones, then prompts for any pending
148+
dotns --password test-password register clear --account default
149+
150+
# Non-interactively discard pending commitments
151+
dotns register clear --discard
152+
153+
# Non-interactively complete pending commitments
154+
dotns --password test-password register clear --register --account default
121155
```
122156

123157
### Register Subnames

packages/cli/benchmarks/benchmark.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { mkdirSync, rmSync, writeFileSync, readFileSync } from "fs";
55
import { join, resolve } from "path";
66
import { spawnSync } from "child_process";
77

8-
const DEFAULT_SIZES = ["500KB", "1MB", "5MB", "10MB", "50MB", "100MB", "500MB", "1GB"];
8+
// Bulletin uploads are benchmarked up to 100MB; larger payloads are out of
9+
// scope and excluded so the stats stay focused on the supported range.
10+
const DEFAULT_SIZES = ["500KB", "1MB", "5MB", "10MB", "50MB", "100MB"];
911
const DEFAULT_RPC = "wss://paseo-bulletin-next-rpc.polkadot.io";
1012
const DEFAULT_TIMEOUT_MINUTES = 120;
1113

0 commit comments

Comments
 (0)