Skip to main content

DEFAULT_POLY_THRESHOLD

Constant DEFAULT_POLY_THRESHOLD 

Source
pub const DEFAULT_POLY_THRESHOLD: u8 = 64;
Expand description

Minimum number of shares needed to recover one polynomial of an SSA.

64 rather than the 128 this was before the split was re-tuned. Dropping the non-constant coefficient commitments (see SsaPartCommitment) put every commitment-side cost — wire volume, ingest, reconstructor memory, share verification — on polys alone. What still grows with the threshold is Exit interpolation (O(threshold²) per polynomial), fault-detection latency (threshold return packets) and, on the Entry, the per-packet SsaShareGenerator::next_share, which evaluates a threshold-wide polynomial by Horner for every share it emits. The full cost model is documented on DEFAULT_PIX_POLYS_PER_SSA in hopr-transport-session.

§What 64 optimises

Exit reconstruction capacity, deliberately, and not total network CPU. The two sides do not deserve equal weight: an Exit is a shared resource serving 10–30 concurrent clients while each Entry generates only its own shares, so the Exit is the side that saturates first and the one whose per-share cost sets what the network can carry. Both were measured (48 cores, acknowledge_shares/interpolation and SsaShareGenerator::next_share, µs/share):

thresholdExitEntrytotal
1613.150.9014.05
3211.121.2012.32
4810.621.5112.13
6410.681.8212.50

The Exit curve falls and then flattens: fitting µs/polynomial = A + B·t + C·t² gives A ≈ 81 µs, B ≈ 7.61, C ≈ 0.028, so per share it is A/t + B + C·t — the fixed per-polynomial commitment opening is amortised over threshold shares and punishes low thresholds harder than interpolation punishes high ones. The Exit-only optimum is t = √(A/C) ≈ 54, flat within 0.5 % from 48 to 64, and 64 sits within 0.4 % of it.

Under the total column 48 is about 3 % cheaper. That reading is recorded rather than acted on: it weights one Entry’s share generation equally with the Exit work of the 10–30 clients that Exit serves, which is not where the capacity limit is. Moving the split also moves the negotiated per-SSA quota and everything derived from it, which is not worth 3 % of a model that does not describe the bottleneck.