Bigger proofs on smaller computers

With the merger of pull request #662, users can now upgrade bigger proofs without running out of RAM.

Specifically, the user can supply environment variables for Triton VM that are only set when Triton VM is about to produce a proof of a certain size. This means that the RAM frugal path in Triton VM can be selected only when necessary. In other words, it allows the user to trade some performance for a lower RAM consumption, and this trade can be configured for each possible proof size.

On one of our machines, a Threadripper 7995wx with 768GB RAM, this means we can now handle proofs with a padded height of 2^{24} whereas we could previously only handle 2^{23}. This translates to the ability to upgrade a transaction with at least 50 inputs, probably more.

To activate padded height-specific performance configuration for Triton VM, use the CLI argument triton-vm-env-vars.

Example:

--triton-vm-env-vars='24:"TVM_LDE_TRACE=no_cache RAYON_NUM_THREADS=90"' --max-log2-padded-height-for-proofs=24

This will pick the RAM frugal path in Triton VM when a padded height of 2^{24} is encountered, and it will limit the number of threads used in parallel to 90, the latter being an important part of total RAM consumption. The CLI argument max-log2-padded-height-for-proofs=24 in the above example guarantees that the application will never attempt to generate a proof greater than 2^{24}.

So far this feature is only available when you build from master. You’ll have to wait for version 0.3.1 before we ship binaries with this functionality.

See Performance numbers for Triton VM proving - #4 by sword-smith for concrete performance numbers of the prover.

To test this functionality on big transactions on a running instance of neptune-core, we provide two new CLI endpoints: neptune-cli list-mempool-transaction-ids and neptune-cli upgrade <txid>.