Skip to content

slave (M4): add datadir inspection and lifecycle checks#40

Open
syntrust wants to merge 10 commits into
slave-m3from
slave-m4
Open

slave (M4): add datadir inspection and lifecycle checks#40
syntrust wants to merge 10 commits into
slave-m3from
slave-m4

Conversation

@syntrust

@syntrust syntrust commented Jul 15, 2026

Copy link
Copy Markdown

M4 of #17, stacked on #38 (base: slave-m3).

What

  • Add config-free, read-only slave inspect --datadir <d> for per-shard genesis record and head. Per-shard failures do not hide healthy shards.
  • Add goleak shutdown coverage and a binary-level genesis-mismatch test that checks both hashes and the database path.
  • Consolidate cmd/slave/README.md with inspect and follow-ups.

Test

  • go test ./... — All tests passed
  • make all
  • Start/stop a slave
  • ./build/bin/slave config/genesis/inspect

syntrust and others added 5 commits July 15, 2026 17:30
DBDirName and ParseDBDirName make the shard-0x{full_shard_id} naming
convention a single point of truth: boot builds paths through it and the
inspect subcommand parses directory listings back through it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
slave inspect --datadir <d> is read-only and config-free: it scans for
shard-0x{full_shard_id}/ chaindb directories, opens each in pebble
read-only mode, and prints the stored genesis metadata record and chain
head. A shard that cannot be opened or read is reported inline without
aborting the remaining shards, with a non-zero exit if any failed. An
absent metadata record is reported as an interrupted bootstrap rather
than an error, since the next boot re-runs the fresh path.

The README gains the inspect section and a fixtures section covering
provenance and the pyquarkchain cross-validation command.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
goleak now wraps both boot/shutdown smoke-test packages. The ignore list
is empty on purpose: with metrics disabled neither geth nor pebble leaves
a background goroutine behind after Stop(), and keeping it empty means
the real chain's background work is heard here the day it lands.

A new subprocess test initializes a datadir from the mainnet config and
reruns the slave against it with the devnet config, asserting the run
exits 1 and names the stored genesis, the config-derived genesis, the db
path, and 'cluster config changed since initialization'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mmand

Running the pyquarkchain cross-validation snippet with a bare system
python fails at import time (no aiohttp); it needs a virtualenv with
pyquarkchain's requirements installed. Both READMEs carrying the
command now say so. Verified against both networks: the venv run
reproduces the pinned mainnet 4036783e... and devnet 5ad443ef... hashes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@syntrust syntrust changed the title cmd/slave, qkc/shard, qkc/slave: add datadir inspect and fault coverage (M4) slave (M4): add datadir inspection and lifecycle checks Jul 15, 2026
@syntrust
syntrust marked this pull request as ready for review July 15, 2026 11:41
syntrust and others added 5 commits July 16, 2026 16:20
slave-m3 now carries the final fixture helpers and goleak TestMain in
run_test.go, so this branch's edits to slave_test.go and run_test.go dissolve
into the merge; TestRunGenesisMismatchExitsLoudly relocates into
inspect_test.go next to the initDataDir helper it depends on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The README sections this branch reshuffled now originate upstream; its diff
reduces to the 'Inspecting a datadir' and follow-up checklist sections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The inspect labels move with it (meta version -> record version,
genesis metadata -> genesis record), keeping the value column aligned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant