Skip to content

x/inference: validation_sample_size is not bounded; values above 500 make honest PoC validation fail #2210

Open @kaileido opened 2026-11-03 17:47 UTC 0 comments Updated 2026-11-03 17:47 UTC

Problem

poc_params.validation_sample_size has no bound in param validation, while the proof endpoint every participant serves accepts at most 500 leaf indices per request. A governance update to a value above 500 or below 0 passes validation and makes honest participants fail PoC validation.

So with validation_sample_size = 501, every validator's proof request to a participant whose commit count is above 500 gets a 400. The validator classifies a non-200 answer as validateFailRetry (poc/validator.go:861-873), and every retry fails the same way, so it votes -1 once attempts run out (poc/validator.go:105). With a negative value the request is empty and fails the same way for every participant. The current mainnet value is 200, so nothing is affected today. upgrade-v0.2.18 and main have the same code.

Expected

A param value that passes Params.Validate should not make honest participants fail validation.

Suggested fix

In PocParams.Validate, reject validation_sample_size < 0 || > 500, with 500 taken from one constant shared with the DAPI handler. This is a chain change and ships with an upgrade. The DAPI can also clamp the sample size to [1, 500] in both readers, which needs no chain upgrade.


🔄 Auto-synced from Issue #2210 every hour.