Feat/hint arena - #942
Draft
diegokingston wants to merge 5 commits into
Draft
Conversation
The non-constraining hint ecall (and its prover HINT table) is replaced by untrusted 32-byte hint slots appended to the private-input region: [u32 len][data][pad8][u32 hint_count][u32 pad][32-byte slots] Guests consume slots positionally (syscalls: hint_count/hint_slot/ next_hint/request_hint) and must still verify each hint in-circuit, falling back to software on failure or arena exhaustion. A lying host can only force fallbacks, never change the result. When hints are not known beforehand, request_hint appends (hint_id, input) to a request log above the private-input window; the host reads it back (Memory::hint_requests / ExecutionResult::hint_requests), answers with compute_hint, and re-runs with a complete arena (executor::collect_hints — the two-pass flow). - executor: encode_private_input_region (single source of truth for the wire format), hints threaded through Executor::new, ecall dispatch and HINT_* error variants removed - prover: HINT table and its trace-builder/CPU plumbing removed; hints threaded through prove_*/count_*/Traces::from_* - ethrex-crypto: field_inv/scalar_inv/decompress_r read from the arena (verify + software fallback kept) - cli: --hints on execute/prove/count-elements, execute --record-hints for the recording pass - guests: hint_arena (slot API) and ecrecover_hints (N recoveries); two-pass measurement drivers on the executor and prover (continuation) sides Measured on 30 ecrecovers: 6.41M guest cycles with software fallback vs 866k with arena hints (7.40x); continuation proof of the hinted run verifies end-to-end (14 epochs @ 2^16).
Collaborator
Author
|
/bench |
Benchmark — real block (
|
| Metric | main | PR | Δ |
|---|---|---|---|
| Peak heap | 47973 MB | 47942 MB | -31 MB (-0.1%) ⚪ |
| Prove time | 136.340s | 123.573s | -12.767s (-9.4%) 🟢 |
❓ -9.4% — beyond what 3 runs resolve. Use
/bench-abbafor a paired test of the same block (default 12 pairs, ~72 min, resolves ~1%).Prove-time spread 2.0% (121.714s / 123.573s / 124.190s)
Commit: cd1d611 · Baseline: cached · Runner: self-hosted bench
Collaborator
Author
|
/bench |
|
Benchmark Results for modified programs 🚀
|
The restack brought in the ethrex bump, which moved lambda-vm-ethrex-crypto to ethrex 4f658c2b while the guest kept its direct dep at 156cb8d6 — two distinct Crypto traits, so the guest no longer compiled. Unify on the bumped rev (lockfile collapses to a single ethrex-crypto entry).
|
Benchmark Results for unmodified programs 🚀
|
The removed hint ecall accelerated hint-consuming guests on EVERY prove, no caller opt-in; the arena made acceleration opt-in, so hint-less flows (plain cli prove, bench_abba.sh) silently proved the software-fallback trace — measured on ethrex_10_transfers: 3.35M cycles without hints vs 1.31M hinted (the ecall baseline was 1.70M). resolve_hints restores the always-on ergonomics: when the caller passes an empty arena, prove_with_options_and_inputs / prove_continuation / count_elements first run the recording pass (collect_hints) and prove the hinted trace. Both runs commit the same output — the arena only changes cost — so the statement being proved is unchanged. Guests that request nothing get an empty arena and an identical trace; the only cost is one extra execution, negligible against proving. Regression coverage: test_prove_ecrecover_hints_auto_records_arena asserts hint-less and explicit-arena calls produce identical element counts and equal verified public outputs.
Collaborator
Author
|
/bench |
- cargo fmt over the hint-arena diff - group private_input/hints paths into ProveInputPaths so cmd_prove and cmd_prove_continuation stay under clippy's too_many_arguments (8/7), matching the FlamegraphCliOptions precedent Verified: cargo fmt --check --all plus all four CI clippy passes (default, debug-checks, disk-spill, cuda) green; the ethrex fixture checksum gate passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.