This page lists everything that the default build of cp_prove (build.sh without a target) prints after it has begun to read secrets, and every file name that it creates. It is for an operator who reads the program's output, and for anyone who asks what that output can reveal. Paths are relative to prover/. Words: status, folder, refuse, stored copy, default build and made-up weights on this page mean what the pages under docs/ call exit code, directory, reject, leaf table, production build and synthetic weights.
Before the program reads its first secret it prints ordinary sentences: the usage text, each refusal with its reason, the lines of the set-up. All of that follows from the command line and the text and public files in the secret folder. By then it has read, of the secret folder, isk.txt and the three configuration files; of the secret files it has only asked whether they exist; it has listed the names in the folder of weights and read no weight. Requests that an earlier process left in work/ are read and zeroed at once; one line may speak of them: where files there have a request's name and length but not the hash of their bytes as their name, or cannot be read, the program removes them and prints how many they were. Nothing of a client's request is printed, with three exceptions: with -in, one refusal (cp-in-name) prints a file name from the folder of requests, and the line p258 at most <n> .. shows how many files that folder holds; and one cp-spool refusal prints one name from the spool directory's in/. Some cp-spool refusals print up to 20 names from the top of the folder named with -spool, or the kind that mark.txt there holds. cp-batch depends on the names or the number of the files in the folder of requests, and the other cp-spool refusals on those in the spool directory.
Then it prints one line that begins p258 closed: and redirects its standard output and standard error to /dev/null, for itself. This happens once, immediately before the seed is read (prover/service.cuh, run(); prover/closed_front.h, close()). From there on only the fixed lines of the next section reach the output that the program was started with.
A call that proves or serves also protects itself from its first step (-h, --setting and -clear return before that): it starts itself a second time with an environment that holds only HOME, TMPDIR, CUDA_VISIBLE_DEVICES and CUDA_DEVICE_ORDER (where the caller is root also SUDO_UID, which it reads once, for the paths that it walks (those named with -spool, -isk, -out and -clear), and then takes out); it disables core files and makes itself undumpable, and refuses to run if it cannot; and it sets the umask to 077. HOME and TMPDIR must each name an existing folder.
The build with the test options (build.sh tests) does not close its output: it prints everything. It too disables core files and makes itself undumpable; it makes no second start on a commitment to made-up weights under a test's seed (docs/build.md). It refuses a model's weight files.
All lines are meant for the operator. A front end should pass none of them on to clients, nor the exit status. What to do after each ending, and when not to start the program again, is in docs/ends-in-short.md, "The three exit statuses". What must not be done with the secret folder (copies, restored backups) is in ../docs/operators-duties.md, "Backups and restored copies" and "After a refusal or a fault".
| line | when | what it depends on |
|---|---|---|
p258 closed: the program reads its secrets now. From here on it prints only the fixed lines listed in prover/docs/closed_front.md; prover/docs/ends-in-short.md explains the name in the last line |
once | nothing |
p258 the parameter file and the sub-proofs' shapes meet the conditions for hiding |
once, when the layout of a proof is fixed | the configuration files (these conditions count positions and masks; they say nothing of how a record's masks are made) |
p258 the parameter file and the sub-proofs' shapes miss a condition for hiding: <text> |
in its place; the program then ends | the configuration files; the text names the condition |
p258 setting <six numbers> |
once, after the first batch's release | five constants of the build and the parameter file's line sec |
batch <number> leaf <k> n <requests> |
after each batch's release | see below |
p258 -keep-for-the-audit: this batch's 32 random bytes are kept in the secret folder. Until the audit has erased them, hiding is void for this batch and no service may start on this folder; hand out none of its responses unless the audit has said YES. Run tools/audit/audit_batch.sh. |
only with the option -keep-for-the-audit: right after the file is written and synced, and once more right before the last line, at every ending that prints a last line (not at a kill, a loss of power, a stack overflow or a fault inside the handler) |
the command line |
p258 alarm memory-grew: the prover's own GPU memory has risen above its peak at the end of the first pass; the service goes on (prover/docs/ends-in-short.md) |
at most once in a process | see below |
p258 alarm cut-short: in/ holds more requests than one scan reads, so those that are served need not be the oldest; the service goes on (prover/docs/ends-in-short.md) |
at most once in a process | the number of files in in/ |
p258 alarm unreadable-request: in/ holds a file with a request's name and length that cp_prove may not read (Permission denied). It stays there without a response; once the account that runs cp_prove may read it, the next scan takes it like any other file there. Printed once in a process: look into in/ (ls -l) for later ones; the service goes on (prover/docs/ends-in-short.md) |
at most once in a process, right after the first scan of in/ that meets such a file |
whether the system lets cp_prove open a file in in/, so as a rule the file's owner and mode; which files are tried follows from their names, kinds, lengths, owners and owner's read permission; no byte of a file is read for it. It also takes a scan that reaches the file: a service that is about to end takes no more (the stop file, -most-batches, a fault in the secret folder, a failed self-check, a leaf table without room), and a scan breaks off at 100,000 readable requests. |
p258 not every step of the wipe ran: GPU memory, host memory or staged response files may still hold secrets (prover/docs/ends-in-short.md) |
before the last line (and before the line on kept bytes), at every exit at which the program can still print and at which not every step of the wipe ran without a failure, a crash included | whether every step of the wipe ran (the line itself has not been seen on a GPU) |
p258 end 0, p258 end 1, p258 end 1 <name> or p258 end 9 <name> |
last | docs/ends-in-short.md explains the three statuses and every name |
A batch's line. The number counts the process's batches. k is the number of the stored copy that the batch uses; it also stands in every proof of the batch. n is the number of requests in the batch. No field says whether a request failed. A request that is refused when it is taken (a token outside the vocabulary, bad r or e) gets "failed" and is not counted in n; with -in a malformed file keeps its slot and is counted (read in the sources).
The last line. The name is a fixed word, chosen by which line of the program speaks. It never carries a number, a place or a sentence.
What a name or an alarm can depend on. The alarm memory-grew and the names no-host-memory and cuda-call can follow a batch's memory use, and so perhaps the routing of its tokens. They are declared with the other things that are not hidden (../docs/what-is-not-hidden.md), not called harmless. After a fault of the machine or of the program, whether a verifier refuses a response at all can depend on hidden values. The alarm cut-short follows the clients' load. The alarm unreadable-request follows what the table above says, and nothing that is in a file; it has no number and no file's name.
The name cp-isk-seed-public, where it comes after the close, says that seed.bin is not the seed derived from the file that the caller named with -public-weights, or that this file can no longer be read, and nothing else of the seed.
How the list is checked. tests/closed_front_lines.txt holds one pattern for each line. Two GPU tests (tests/serving_first_run.sh, tests/refused_at_the_start.sh; the suite's rows gpu.serving_first_run and gpu.refused_at_the_start.serving) compare what a running program prints after the line p258 closed: with those patterns, in honest runs and at refusals. A test that is not in this repository compares every line format that can be printed after the close, and every word of the last line, with the sources. No test reads this page, none shows that the output is the same when a request fails, and nothing keeps the page from falling behind the sources: in one comparison, as reported, it lacked three lines that the sources print (row T21 of ../docs/limits-all-rows.tsv). That each number in a line is public, and whether a name's appearance depends on hidden values, is this page's statement: no test shows it. No comparison of a run's whole output under two sets of weights covers the lines that are printed before the close.
| line | what it depends on |
|---|---|
p258 at most <n> requests share one opening, each with its own proof file |
-batch; with -in, the number of files in the folder of requests |
p258 timing not hidden: nothing is done to hide the time of a release, so a batch's time shows; empty seats are not proved, so the number of requests in a batch shows; |
constant; with -overlap or -overlap-two one more clause |
p258 FOR PUBLIC WEIGHTS: the commitment's seed is public, so nothing is hidden |
constant; only with -public-weights |
p258 the parameter file meets the conditions for hiding that follow from it alone (their names and what each asks: blocks/frame/hiding_conditions.h) (these conditions count positions and masks; they say nothing of how a record's masks are made) |
the parameter file |
p258 the parameter file misses conditions for hiding (their names and what each asks: blocks/frame/hiding_conditions.h): <text> |
in its place; the program then ends with the name prover-only-hiding-conditions. The same name can also come after the close, from the second check (the line on the sub-proofs' shapes, above) |
Around them stand lines that begin # (what was read, the settings, the digest of the configuration files, GPU memory in use) and start-up:.
Other builds print further lines, in capitals or beginning measure:, p258 measuring:, # seat, # overlap: or ended: cause (read in the sources). The default build prints none of them and refuses -measure. In those builds a batch's line goes on with four times; one of them, how long the opening waited for the thread that loads a stored copy's tree, is an inner time of the batch and follows the routing of the requests' tokens, which is why the default build prints none of the four.
<id> is 64 hex digits: the hash of the request's file with its 32-byte nonce.
| name | what |
|---|---|
in/, in/.tmp/ |
where the front end writes a request and gives it its name. The file gets its name by a call that fails rather than replace an existing file: renameat2() with RENAME_NOREPLACE, or link() (Linux manual page rename(2), man-pages 6.15: "Don't overwrite newpath of the rename. Return an error if newpath already exists.") |
in/<id>.req |
a request that waits |
work/<id>.req |
a request that a batch has taken, until its released response is on the disk |
out/.tmp/<id>/ |
a response while it is staged; what is dropped is overwritten before it is removed. One case is excepted: where a final name in out/ is already taken, the staged file, which nobody has checked, is removed without zeros. A file that cannot be overwritten is removed all the same by the running process; the next start and cp_prove -clear leave such a file in place, report it, and the folder is refused |
out/<id>.y, out/<id>.tag, out/<id>.proof |
a response with its tag; .proof is named last |
out/<id>.tag, out/<id>.failed |
the other response: its tag, then one empty file, whatever the cause. After a failed self-check (status 9) it is the next start that writes it, for every request that had been taken and had no final name |
stop |
the operator's empty file; the service removes it when it obeys it |
mark.txt |
three lines: cp-folder 1, the kind of directory, and commitment with 64 hexadecimal digits: zeros where cp_prove wrote it. cp_prove writes it at its first start, unless a front end has, never changes or removes it, and takes any well-formed mark |
mark.txt.making.<process ID>.<clock reading> |
that file while it is written; a kill can leave it. Both names also occur in .tmp/ of -out, where cp_prove removes them at its end if nothing else is left there |
With -in and -out: <name>.y and <name>.proof, or <name>.failed, in the folder given as -out, which is new or was left by a batch that was killed before it released anything, and .tmp/, with a mark.txt in it, while the batch is being proved. There is no tag there. After a failed self-check (status 9) no request has a file under -out, not even <name>.failed; a file in -in that is no request has, as a rule, its <name>.failed by then, because it is released before the batch is proved.
Outside the spool the process writes one thing, and with the option -keep-for-the-audit a second. The first: at the head of each batch it appends to count.bin, in the secret folder's folder of the stored copy that the batch uses, one byte for each column that the batch's opening will show. That number follows from the configuration files. The second: audit/batch.fresh in the secret folder, the batch's 32 random bytes (mode 0600, in a folder audit/ of mode 0700, which cp_prove makes if it is not there; one that is there must be the caller's own with that mode, or the run ends with the name cp-prove-kept-not-written). The file is created under that name only if the name is free, before any key is derived from the bytes; cp_prove never reads, overwrites or removes it: only the audit erases it, and only in a call whose last word is --erase-kept-files: then with each of its verdicts (YES, NO, NOT WHOLE), unless its last line says that the erasure stopped or that the file was left alone (../tools/audit/README.md). With the seed, which is in the same folder, these bytes open every mask, pad and salt of that batch's proofs. Apart from these two the process creates, renames and removes nothing there, and writes into no other folder. No name tells a request's place in its batch, its batch or the other requests.
- Times. When each line, each file and the end of the process appear. The program says so itself in its line on timing.
- File timestamps. The service sets the modification time and the access time of a response's files to the moment at which the batch's responses get their names. Setting them moves the file's status-change time to the moment at which they are set. No folder's times are set. The birth time cannot be set, and it shows when the file was written. (Read in the source; not tested.)
- Lengths and numbers. A proof's length moves with the sampled positions, also between two proofs of the same request (
../docs/what-is-not-hidden.md). The number of responses that are released together showsn, and with it any requests that were refused when they were taken (read in the sources). - The exit status and the name: 0, 1 or 9 (the call
cp_prove -clearis apart: it proves nothing, ends with 0, 1 or 2, which the usage text tells, and prints no linep258 end); that a name comes, and which, shows which line of the program spoke (docs/ends-in-short.md). - What the program does not write itself. CUDA's library creates
.nv/ComputeCacheunderHOME; what else it writes underHOMEandTMPDIRhas not been looked at. What the driver, the kernel's log or a profiler keep of a process is outside this page. - A library's own copy of the output. CUDA is initialised before the close. A library that had kept its own copy of the output's descriptor could still write to it afterwards. That has not been examined; the GPU tests hold the output against the list in honest runs and at refusals, not on every error path of the driver.
- Signals. Every signal that asks a process to end (TERM, INT, HUP, QUIT, ALRM, USR1, USR2, PIPE, XCPU, XFSZ, VTALRM, PROF, IO, PWR, STKFLT and the real-time signals) leads to the wipe and to
p258 end 1 asked-to-end; before the program has armed its ends it prints that last line and exits with no wipe, and after a failed self-check the end keeps status 9 and that name (read in the sources); a signal that the parent process ignored stays ignored. After a crash (SEGV, BUS, FPE, ILL, ABRT, SYS, TRAP) nothing is wiped; if the program has begun to read its secrets, the line before the last says that not every step of the wipe ran; the last line is the barep258 end 1, unless a name was set before the crash: then that name is printed, with status 9 if it beginsown-test-. A stack overflow, or a fault inside the handler itself, prints nothing. After a KILL there is no last line and no wipe, and staged files stay; a next start on that spool directory whose requests have the same length as those left inwork/overwrites and removes what it can. - What stays in memory:
docs/ends-in-short.md.