test(tools): match dragonxd's lock-free getrescaninfo; count requests per method

- getrescaninfo takes no lock in dragonxd (it only reads wallet fields),
  so the stub no longer holds it behind cs_main. Holding it there made
  the GUI's rescan-progress poll look like an abandoned request every
  30 s during a simulated rebuild.
- a `methods` event lists the 10 most-requested JSON-RPC methods with
  counts (alongside `stats`, and at exit): what the GUI is polling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 09:49:43 -05:00
co-authored by Claude Opus 5.5
parent 6b14098bb2
commit 98fa2154b4
2 changed files with 34 additions and 5 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ What it copies from the real daemon (DragonX v1.3.0):
command line or `DRAGONX.conf`). When the queue is full the request gets an immediate plain-text
`HTTP 500 "Work queue depth exceeded"`. A request whose client timed out **keeps its slot** until
a worker reaches it.
- **cs_main.** One global lock. Every method except `stop` and `help` takes it. A "witness rebuild"
- **cs_main.** One global lock. Every method except `stop`, `help` and `getrescaninfo` (lock-free in dragonxd too) takes it. A "witness rebuild"
holds it for `FAKE_REBUILD_SECS` and logs the real markers:
- `Reading blocks for witness rebuild: <off> / <total>` (Phase 1, abortable);
- nothing during Phase 2, which ignores shutdown;
@@ -53,6 +53,7 @@ Everything that matters for a test is appended to `<datadir>/fake_dragonxd.event
| `sigterm` | SIGTERM/SIGINT received (POSIX) |
| `http-interrupted`, `shutdown-begin` | shutdown progress |
| `stats ...` | counters, every 30 s when they change |
| `methods ...` | the 10 most-requested JSON-RPC methods with counts (with `stats`, and at exit): what the GUI is polling |
| `clean-exit ...` | **graceful exit**, with final counters. If this is missing, the process was killed. |
## Build