Innovation Blockchain

Documentation · Coston2 testnet prototype · invented data

Documentation Inspector kit

Inspector kit

One inspection is one folder. A read-only script captures each host, and five commands take the folder from the first step to a signed and checked proof record. The kit handles no key, opens no keystore, contacts no host and touches no chain.

One inspection with the inspector kit inspect new copies the schedule, draws the day’s code ibc-capture.sh on each host: serials, telemetry, time, code captures/ one file per host, hashed as captured findings.json the inspector’s own findings inspect build match, ratings, result, record digest result/ report, proof record, evidence index Inspector signs the digest with his own key inspect sign checks and files the signature inspect verify rebuilds, compares, checks the signer code writes writes digest signature
One inspection with the inspector kit. One inspection is one folder. The kit takes it from the first step to a signed and checked proof record. The signature is made by the inspector, outside the kit.
The same flow in words
  1. inspect new starts the job folder: the schedule, an empty findings file, the capture script and a code for this inspection.
  2. On each GPU host the capture script runs read-only queries and writes one file with the serial numbers, a telemetry snapshot, the time and the code.
  3. The capture files go into the job’s captures/ folder. The inspector enters findings in findings.json.
  4. inspect build matches serials to the schedule, checks each capture, rates every exception, writes the report, the proof record and the evidence index, and prints the record digest.
  5. The inspector signs the digest himself, with his own key. The kit signs nothing.
  6. inspect sign checks the signature and files it, so the record and the report carry it.
  7. inspect verify rebuilds everything from the evidence files, recomputes the digest and checks the signature.

The commands#

node src/inspect.mjs new    <job-folder> --schedule <file> --type F|Q|E --date YYYY-MM-DD
                            [--inspector-id <id>] [--key-id <address>] [--valid-until <date or UTC time>] [--config <file>]
node src/inspect.mjs build  <job-folder> [--issued-at YYYY-MM-DDTHH:MM:SSZ] [--reissue]
node src/inspect.mjs sign   <job-folder> --signer <address> --signature <0x + 130 hex>
node src/inspect.mjs verify <job-folder> [--key-id <address>] [--require-signature]
node src/inspect.mjs revocation-digest <address>

The kit needs Node 22 or later and no packages. Checking a signature also needs Foundry's cast on the PATH. An option a command does not know is an error.

Quick start#

Try it on the invented sample job.

cd prototype/collector
npm run -s sample-job
open build-output/job-demo/result/report.html

The sample builds to PASS with 16 of 16 units matched, and verify confirms every file. The sample is not signed, so the last line reads Signature: not signed.

Note. Keep real jobs outside the repository. A real job folder holds a client's schedule and serial numbers, which must never be committed.

Start a job#

inspect new copies the collateral schedule into the folder, writes an empty findings file, copies the capture script in, and draws the code of this inspection: 16 hex characters, written to job.json.

The code is not a key and signs nothing. The inspector gives it out on the day, and each capture carries it, so a capture made before the inspection cannot be passed off as today's.

OptionMeaning
--inspector-id <id>The inspector's id. It is in the report and is hashed into the record digest. --inspector is another spelling. Without it the id is DEMO-not-a-real-inspector
--key-id <address>The address of the key the inspector will sign with. Optional. When set, sign refuses any other signer
--valid-until <date or UTC time>An explicit valid-until. It may not be more than 104 days after the inspection date
--config <file>Other validity days or default ratings
Engagement typeMeaningValid for (proposed)
FFunding inspection90 days
QPeriodic re-verification90 days plus 14 days' grace
EEvent inspection90 days, a placeholder

The tools build no record that is valid for more than 104 days. The registry's own cap is 105 days, because a valid-until date runs to the last second of its day.

Capture each host#

sh ibc-capture.sh <code> [output-folder]

Run it in a session the inspector controls or watches. It writes one file, <host>.ibc-capture.txt, and prints that file's SHA-256, which the inspector notes at once. The file holds a short header (host, capture time in UTC, the code, the SHA-256 of the script itself) and four sections.

SectionCommandUsed for
identitynvidia-smi --query-gpu=index,serial,uuid,name,vbios_version,driver_version --format=csvThe serial match
telemetrynvidia-smi --query-gpu=index,serial,utilization.gpu,memory.used,temperature.gpu,power.draw --format=csvRecorded per matched unit. Not rated
dcgmdcgmi discovery -lKept as evidence. Not parsed
systemuname -srmKept as evidence

The script only reads. It changes no setting, installs nothing, needs no root and opens no network connection. A tool that is not installed is recorded as such, and the capture goes on. It never overwrites a capture.

Raw nvidia-smi output saved by hand as <host>.txt is also accepted in the captures/ folder. Such a file carries no time and no code. The report's scope then names those hosts. The record does not.

Build the report#

node src/inspect.mjs build <job-folder>

It matches the serial numbers read from the hosts to the schedule, checks every capture, rates each exception, and writes the result folder. See Report and proof record for what is in it. It then prints the record digest and stops. It signs nothing and checks no signature.

No file in the result carries a build time. The same job gives the same bytes on every build, which is what lets verify compare them.

The issue time#

The record has an issuedAt field, inside the digest. build takes it from the clock the first time, in UTC and whole seconds, or from --issued-at. It keeps it in issue.json in the job folder, together with the hash of the record without it.

build prints a note when registry v2 would refuse the record as built, for example when the inspection date is more than one day after the issue time. It is a note, not an error.

Exceptions from the serial match#

TypeMeaning
MISSINGOn the schedule, not read from any host
EXTRARead from a host, not on the schedule
DUPLICATE_IN_SCHEDULEThe same serial on two or more schedule lines
DUPLICATE_IN_READThe same serial read more than once
UNREADABLEA GPU reported no serial, or a line could not be parsed
MODEL_MISMATCHThe serial matches, but the model differs

An exception that no finding explains becomes a Red finding. The inspector can explain one in the findings file; a warranty replacement not yet on the schedule is Amber in the standard. The result is never PASS while the exceptions count is above zero.

Problems with a capture#

Each is a Red finding, because a read that cannot be relied on means the collateral cannot be verified.

CodeMeaning
NONCE_MISMATCHThe capture carries another code than this job's
DATE_MISMATCHThe capture time is more than one day from the inspection date
TRUNCATEDThe file has no end marker
NO_IDENTITY, IDENTITY_FAILEDThe identity query is missing, was cut off, or ended with an error
NO_HOST, NO_TIMEThe header lacks the host or a readable time

The overall result#

Open findingsResult
Any RedFAIL
Amber onlyPASS_WITH_EXCEPTIONS
None, or Green onlyPASS

Sign the record#

The kit never creates, opens, reads or stores a key, and never asks for a password. The inspector signs the digest with his own key, in his own terminal. build prints the line:

cast wallet sign --account <your inspector account> <record digest>

cast asks him for the keystore password and prints a signature of 65 bytes. He then hands the signature to the kit:

node src/inspect.mjs sign <job-folder> --signer <his key id> --signature <what cast printed>

sign does four things, in this order, and writes nothing if one fails:

  1. It recomputes the digest from the job folder. It never takes a digest from anywhere else.
  2. It checks the envelope itself: 65 bytes, last byte 27 or 28, and s not above half the curve order. A last byte of 0 or 1 is rewritten to 27 or 28. A high s is refused. cast would accept both; the registry would not.
  3. It checks the signer against the job's keyId, if one was set at new.
  4. It asks cast wallet verify whether that key signed that digest. This uses public values only.

It then writes signature.json in the job folder and rebuilds, so proof-record.json, report.html and onchain-encoding.json carry the signature. The digest does not change, because the signatures are outside it.

A signature shows which key issued the record and that no field changed afterwards. It does not show that the facts are true, and it does not show that the key is the inspector's. That comes from the engagement letter, which names the key id. See Keys.

Verify a result#

node src/inspect.mjs verify <job-folder> --key-id <the key in the engagement letter> --require-signature

Anyone holding the job folder can run it, with no key. It re-hashes every evidence file, regenerates every file of the result and compares bytes, recomputes the digest, and checks each signature with cast. It prints ok or DIFFERENT per item and ends with VERIFIED or NOT VERIFIED (exit code 1).

CallSignature line
--key-id <address>, and that key signedSignature: VERIFIED. Signed by <address>, the key given with --key-id.
--key-id <address>, another key signedDIFFERENT, exit code 1
No --key-idsigned by <address>: compare this with the key in your engagement letter
The record is not signednot signed. Exit code 1 only with --require-signature

Always give --key-id. job.json is not evidence and is not hashed; a key id in it is only a cross-check, since whoever rebuilds a folder can rewrite it. The reader's side of this command is on Check a record yourself.

The revocation digest#

node src/inspect.mjs revocation-digest <address>

It computes, with no network, the digest a key holder signs to revoke that key, and prints the line to sign. It sends nothing. See Keys.

The plain builder#

src/cli.mjs is the builder without a job folder. It takes the issue time from the clock, so two runs give two digests, and it has no signing step. The v1 Coston2 drivers still call it. Use inspect for a record that is signed and checked.

From here to the chain#

PathDriverState
Signed record, registry v2prototype/e2e/coston2-v2.shBuilt and checked offline and on a local chain. Not yet run by the owner on Coston2
Registry v1, the earlier demoprototype/e2e/coston2-job.shPosts a job's record through the test machine. Registry v1 stores the digest as given and checks no signature

Both are on Coston2 demo.

What a capture shows, and what it does not#

Not verified. The capture script has run only against a stand-in for nvidia-smi. It has not run on a host with a GPU, and DCGM output is captured but not parsed. No real inspector key has signed a record: the tests sign with the unlocked test account of a local chain, and otherwise use a stand-in for cast.