Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added get_version to zkvm / bonsai version check #899

Merged
merged 13 commits into from
Sep 26, 2023
Merged

Conversation

mothran
Copy link
Contributor

@mothran mothran commented Sep 20, 2023

This PR adds the get_version() method into the risc0-zkvm crate to support version checking between bonsai and local clients. Additionally we now include a x-risc0-version http header on requests to the Bonsai API to provide server side validation of the clients local zkvm version.

Finally I refactors some of the HTTP header keys into exported values for other layers to reuse safely.

TODO:

  • Add /get_version Bonsai REST routes

@mothran mothran requested a review from flaub September 20, 2023 18:33
@github-actions
Copy link

Benchmark for Linux-cuda 059838a

Click to hide benchmark
Test Base PR %
fib/100/execute 5.3±0.10ms 5.1±0.09ms -3.77%
fib/100/prove 1481.5±48.64ms 1191.7±29.35ms -19.56%
fib/100/total 1385.1±44.87ms 1124.9±10.10ms -18.79%
fib/1000/execute 5.9±0.12ms 5.7±0.15ms -3.39%
fib/1000/prove 1429.5±28.52ms 1170.0±12.70ms -18.15%
fib/1000/total 1352.9±37.45ms 1143.0±12.32ms -15.51%
fib/10000/execute 12.2±0.06ms 12.0±0.15ms -1.64%
fib/10000/prove 4.4±0.01s 3.7±0.02s -15.91%
fib/10000/total 4.3±0.01s 3.6±0.01s -16.28%

Benchmark for Linux-default 059838a

Click to hide benchmark
Test Base PR %
fib/100/execute 6.9±0.52ms 6.8±0.47ms -1.45%
fib/100/prove 5.0±0.04s 5.0±0.03s 0.00%
fib/100/total 5.0±0.03s 5.0±0.02s 0.00%
fib/1000/execute 8.0±0.67ms 7.9±0.39ms -1.25%
fib/1000/prove 5.0±0.04s 5.0±0.03s 0.00%
fib/1000/total 5.0±0.04s 5.0±0.01s 0.00%
fib/10000/execute 14.5±0.57ms 14.3±0.49ms -1.38%
fib/10000/prove 20.8±0.19s 20.7±0.05s -0.48%
fib/10000/total 20.8±0.16s 20.7±0.12s -0.48%

Benchmark for macOS-default 059838a

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.12ms 2.7±0.13ms -3.57%
fib/100/prove 3.6±0.08s 3.6±0.06s 0.00%
fib/100/total 3.7±0.06s 3.7±0.05s 0.00%
fib/1000/execute 3.1±0.07ms 3.0±0.10ms -3.23%
fib/1000/prove 3.7±0.04s 3.7±0.06s 0.00%
fib/1000/total 3.7±0.05s 3.7±0.07s 0.00%
fib/10000/execute 6.1±0.14ms 6.1±0.12ms 0.00%
fib/10000/prove 15.1±0.23s 15.0±0.09s -0.66%
fib/10000/total 15.1±0.24s 15.1±0.10s 0.00%

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@github-actions
Copy link

Benchmark for Linux-cuda af9fade

Click to hide benchmark
Test Base PR %
fib/100/execute 5.2±0.06ms 5.2±0.07ms 0.00%
fib/100/prove 700.7±3.39ms 658.6±2.26ms -6.01%
fib/100/total 703.8±4.10ms 662.3±3.02ms -5.90%
fib/1000/execute 5.9±0.20ms 5.8±0.09ms -1.69%
fib/1000/prove 732.6±4.83ms 687.9±2.42ms -6.10%
fib/1000/total 735.0±5.19ms 696.0±3.50ms -5.31%
fib/10000/execute 12.8±0.77ms 12.2±0.11ms -4.69%
fib/10000/prove 2.8±0.01s 2.5±0.01s -10.71%
fib/10000/total 2.8±0.01s 2.5±0.01s -10.71%

Benchmark for Linux-default af9fade

Click to hide benchmark
Test Base PR %
fib/100/execute 6.9±0.52ms 6.9±0.47ms 0.00%
fib/100/prove 5.0±0.03s 5.0±0.02s 0.00%
fib/100/total 5.0±0.03s 5.0±0.02s 0.00%
fib/1000/execute 8.1±0.64ms 7.9±0.50ms -2.47%
fib/1000/prove 5.1±0.02s 5.0±0.02s -1.96%
fib/1000/total 5.1±0.02s 5.0±0.02s -1.96%
fib/10000/execute 14.6±0.31ms 14.3±0.38ms -2.05%
fib/10000/prove 20.8±0.12s 20.7±0.11s -0.48%
fib/10000/total 20.8±0.09s 20.6±0.13s -0.96%

Benchmark for macOS-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@mothran mothran self-assigned this Sep 21, 2023
@github-actions
Copy link

Benchmark for Linux-cuda 25f8e78

Click to hide benchmark
Test Base PR %
fib/100/execute 5.2±0.10ms 5.0±0.10ms -3.85%
fib/100/prove 1386.7±68.86ms 841.2±18.19ms -39.34%
fib/100/total 1240.0±5.04ms 819.6±12.65ms -33.90%
fib/1000/execute 5.8±0.12ms 5.6±0.09ms -3.45%
fib/1000/prove 1335.3±63.57ms 870.5±15.48ms -34.81%
fib/1000/total 1213.1±5.29ms 867.1±13.63ms -28.52%
fib/10000/execute 11.8±0.11ms 11.7±0.08ms -0.85%
fib/10000/prove 4.2±0.03s 3.2±0.01s -23.81%
fib/10000/total 4.2±0.01s 3.2±0.02s -23.81%

Benchmark for Linux-default 25f8e78

Click to hide benchmark
Test Base PR %
fib/100/execute 7.0±0.41ms 7.0±0.43ms 0.00%
fib/100/prove 5.0±0.02s 5.0±0.03s 0.00%
fib/100/total 5.0±0.03s 5.0±0.04s 0.00%
fib/1000/execute 8.1±0.48ms 7.9±0.53ms -2.47%
fib/1000/prove 5.0±0.01s 5.0±0.02s 0.00%
fib/1000/total 5.1±0.02s 5.1±0.02s 0.00%
fib/10000/execute 14.8±0.78ms 14.4±0.55ms -2.70%
fib/10000/prove 20.8±0.12s 20.8±0.07s 0.00%
fib/10000/total 20.8±0.09s 20.7±0.08s -0.48%

Benchmark for macOS-default 25f8e78

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.15ms 2.7±0.11ms -3.57%
fib/100/prove 3.6±0.05s 3.6±0.03s 0.00%
fib/100/total 3.7±0.05s 3.5±0.04s -5.41%
fib/1000/execute 3.2±0.13ms 3.1±0.20ms -3.13%
fib/1000/prove 3.7±0.06s 3.6±0.04s -2.70%
fib/1000/total 3.7±0.05s 3.6±0.03s -2.70%
fib/10000/execute 6.2±0.10ms 5.9±0.07ms -4.84%
fib/10000/prove 15.0±0.07s 14.4±0.18s -4.00%
fib/10000/total 15.0±0.07s 14.4±0.28s -4.00%

Benchmark for macOS-metal 25f8e78

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.09ms 2.7±0.13ms -3.57%
fib/100/prove 803.6±8.35ms 801.3±3.58ms -0.29%
fib/100/total 822.1±6.16ms 821.6±5.02ms -0.06%
fib/1000/execute 3.0±0.09ms 3.0±0.13ms 0.00%
fib/1000/prove 822.5±5.01ms 818.8±4.35ms -0.45%
fib/1000/total 841.9±7.42ms 840.2±9.80ms -0.20%
fib/10000/execute 6.0±0.08ms 6.0±0.07ms 0.00%
fib/10000/prove 3.1±0.02s 3.1±0.02s 0.00%
fib/10000/total 3.1±0.01s 3.1±0.02s 0.00%

@github-actions
Copy link

Benchmark for Linux-cuda 5c84f5a

Click to hide benchmark
Test Base PR %
fib/100/execute 5.0±0.09ms 5.0±0.12ms 0.00%
fib/100/prove 827.0±25.88ms 699.0±6.96ms -15.48%
fib/100/total 821.4±8.27ms 702.4±4.78ms -14.49%
fib/1000/execute 5.7±0.11ms 5.6±0.11ms -1.75%
fib/1000/prove 841.0±16.09ms 732.8±6.95ms -12.87%
fib/1000/total 845.0±14.12ms 736.6±4.13ms -12.83%
fib/10000/execute 11.8±0.10ms 11.8±0.12ms 0.00%
fib/10000/prove 2.9±0.02s 2.9±0.02s 0.00%
fib/10000/total 2.9±0.01s 2.9±0.01s 0.00%

Benchmark for Linux-default 5c84f5a

Click to hide benchmark
Test Base PR %
fib/100/execute 4.8±0.15ms 4.7±0.05ms -2.08%
fib/100/prove 2.9±0.76s 2.4±0.58s -17.24%
fib/100/total 2.6±0.43s 2.0±0.17s -23.08%
fib/1000/execute 5.4±0.25ms 5.3±0.15ms -1.85%
fib/1000/prove 4.1±1.09s 2.4±0.33s -41.46%
fib/1000/total 2.7±0.36s 2.0±0.26s -25.93%
fib/10000/execute 10.8±0.60ms 10.2±0.10ms -5.56%
fib/10000/prove 7.2±0.39s 7.1±0.48s -1.39%
fib/10000/total 7.4±0.54s 7.3±0.51s -1.35%

Benchmark for macOS-default 5c84f5a

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.16ms 2.7±0.18ms -3.57%
fib/100/prove 3.6±0.06s 3.6±0.05s 0.00%
fib/100/total 3.7±0.05s 3.6±0.07s -2.70%
fib/1000/execute 3.0±0.07ms 3.0±0.07ms 0.00%
fib/1000/prove 3.7±0.05s 3.6±0.07s -2.70%
fib/1000/total 3.7±0.06s 3.7±0.06s 0.00%
fib/10000/execute 6.1±0.06ms 5.9±0.10ms -3.28%
fib/10000/prove 15.0±0.07s 14.9±0.15s -0.67%
fib/10000/total 15.1±0.12s 15.0±0.10s -0.66%

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@mothran mothran marked this pull request as ready for review September 25, 2023 19:29
@github-actions
Copy link

Benchmark for Linux-cuda d3a71ac

Click to hide benchmark
Test Base PR %
fib/100/execute 5.4±0.12ms 5.3±0.11ms -1.85%
fib/100/prove 707.9±4.43ms 657.8±2.16ms -7.08%
fib/100/total 712.2±3.26ms 663.9±3.02ms -6.78%
fib/1000/execute 6.0±0.11ms 5.9±0.13ms -1.67%
fib/1000/prove 739.9±2.41ms 686.7±1.99ms -7.19%
fib/1000/total 747.6±3.88ms 692.3±1.92ms -7.40%
fib/10000/execute 12.3±0.12ms 12.0±0.11ms -2.44%
fib/10000/prove 2.8±0.01s 2.5±0.01s -10.71%
fib/10000/total 2.8±0.01s 2.5±0.01s -10.71%

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default d3a71ac

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.14ms 2.8±0.14ms 0.00%
fib/100/prove 3.6±0.06s 3.6±0.07s 0.00%
fib/100/total 3.6±0.07s 3.6±0.06s 0.00%
fib/1000/execute 3.1±0.10ms 3.1±0.12ms 0.00%
fib/1000/prove 3.7±0.05s 3.6±0.09s -2.70%
fib/1000/total 3.7±0.05s 3.6±0.07s -2.70%
fib/10000/execute 6.2±0.06ms 5.9±0.06ms -4.84%
fib/10000/prove 15.1±0.17s 15.0±0.08s -0.66%
fib/10000/total 15.1±0.11s 15.1±0.11s 0.00%

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@github-actions
Copy link

Benchmark for Linux-cuda f6bb120

Click to hide benchmark
Test Base PR %
fib/100/execute 5.0±0.10ms 5.0±0.11ms 0.00%
fib/100/prove 808.4±12.88ms 669.2±2.05ms -17.22%
fib/100/total 811.8±9.41ms 674.3±1.80ms -16.94%
fib/1000/execute 5.7±0.09ms 5.6±0.09ms -1.75%
fib/1000/prove 832.6±16.47ms 695.8±2.29ms -16.43%
fib/1000/total 807.5±19.89ms 703.8±2.66ms -12.84%
fib/10000/execute 11.7±0.09ms 11.6±0.12ms -0.85%
fib/10000/prove 3.2±0.01s 2.5±0.01s -21.88%
fib/10000/total 3.2±0.01s 2.6±0.01s -18.75%

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-metal f6bb120

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.06ms 2.8±0.07ms 0.00%
fib/100/prove 799.1±7.05ms 798.4±5.04ms -0.09%
fib/100/total 822.1±4.95ms 817.4±7.23ms -0.57%
fib/1000/execute 3.1±0.03ms 3.0±0.14ms -3.23%
fib/1000/prove 818.7±5.87ms 814.7±3.48ms -0.49%
fib/1000/total 841.5±4.64ms 836.9±7.51ms -0.55%
fib/10000/execute 6.1±0.07ms 6.1±0.07ms 0.00%
fib/10000/prove 3.1±0.01s 3.1±0.01s 0.00%
fib/10000/total 3.1±0.01s 3.1±0.01s 0.00%

@mothran
Copy link
Contributor Author

mothran commented Sep 26, 2023

@flaub migrated to the #908 style VERSION in: d551a58

@mothran mothran requested a review from flaub September 26, 2023 17:46
@github-actions
Copy link

Benchmark for Linux-cuda f673c54

Click to hide benchmark
Test Base PR %
fib/100/execute 5.1±0.12ms 5.0±0.10ms -1.96%
fib/100/prove 1135.6±21.02ms 661.1±2.75ms -41.78%
fib/100/total 1091.1±5.42ms 665.9±2.83ms -38.97%
fib/1000/execute 5.7±0.09ms 5.6±0.11ms -1.75%
fib/1000/prove 1129.1±15.45ms 691.4±2.43ms -38.77%
fib/1000/total 1127.8±5.02ms 698.6±3.11ms -38.06%
fib/10000/execute 11.7±0.15ms 11.6±0.12ms -0.85%
fib/10000/prove 3.4±0.02s 2.5±0.01s -26.47%
fib/10000/total 3.4±0.01s 2.5±0.01s -26.47%

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default f673c54

Click to hide benchmark
Test Base PR %
fib/100/execute 2.8±0.17ms 2.7±0.10ms -3.57%
fib/100/prove 3.6±0.08s 3.6±0.04s 0.00%
fib/100/total 3.6±0.04s 3.6±0.07s 0.00%
fib/1000/execute 3.0±0.06ms 3.0±0.06ms 0.00%
fib/1000/prove 3.7±0.05s 3.6±0.06s -2.70%
fib/1000/total 3.7±0.07s 3.6±0.06s -2.70%
fib/10000/execute 6.0±0.03ms 6.0±0.07ms 0.00%
fib/10000/prove 15.0±0.13s 15.0±0.11s 0.00%
fib/10000/total 15.0±0.20s 15.0±0.14s 0.00%

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@github-actions
Copy link

Benchmark for Linux-cuda 52822f9

Click to hide benchmark
Test Base PR %
fib/100/execute 5.0±0.09ms 5.0±0.11ms 0.00%
fib/100/prove 701.9±5.75ms 665.3±2.17ms -5.21%
fib/100/total 701.0±3.15ms 668.1±1.11ms -4.69%
fib/1000/execute 5.7±0.13ms 5.7±0.10ms 0.00%
fib/1000/prove 730.3±2.59ms 697.2±1.41ms -4.53%
fib/1000/total 734.4±3.94ms 702.7±2.52ms -4.32%
fib/10000/execute 11.7±0.16ms 11.7±0.11ms 0.00%
fib/10000/prove 2.9±0.02s 2.4±0.01s -17.24%
fib/10000/total 2.9±0.01s 2.5±0.01s -13.79%

Benchmark for Linux-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-default 52822f9

Click to hide benchmark
Test Base PR %
fib/100/execute 2.9±0.11ms 2.6±0.13ms -10.34%
fib/100/prove 3.6±0.09s 3.6±0.05s 0.00%
fib/100/total 3.6±0.05s 3.6±0.06s 0.00%
fib/1000/execute 3.1±0.15ms 3.1±0.11ms 0.00%
fib/1000/prove 3.7±0.06s 3.7±0.09s 0.00%
fib/1000/total 3.7±0.05s 3.7±0.05s 0.00%
fib/10000/execute 6.1±0.10ms 6.0±0.05ms -1.64%
fib/10000/prove 15.0±0.10s 14.9±0.13s -0.67%
fib/10000/total 15.1±0.07s 15.1±0.10s 0.00%

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@github-actions
Copy link

Benchmark for Linux-cuda 8e53ad2

Click to hide benchmark
Test Base PR %
fib/100/execute 5.6±0.18ms 5.4±0.24ms -3.57%
fib/100/prove 847.0±17.53ms 686.3±3.33ms -18.97%
fib/100/total 834.6±6.19ms 689.4±1.71ms -17.40%
fib/1000/execute 6.1±0.18ms 6.1±0.22ms 0.00%
fib/1000/prove 860.7±17.31ms 705.3±1.67ms -18.06%
fib/1000/total 864.6±14.57ms 719.5±1.98ms -16.78%
fib/10000/execute 12.5±0.18ms 12.1±0.28ms -3.20%
fib/10000/prove 3.4±0.02s 2.6±0.01s -23.53%
fib/10000/total 3.4±0.01s 2.6±0.01s -23.53%

Benchmark for Linux-default 8e53ad2

Click to hide benchmark
Test Base PR %
fib/100/execute 4.8±0.14ms 4.7±0.15ms -2.08%
fib/100/prove 2.9±1.06s 2.5±0.51s -13.79%
fib/100/total 2.4±0.53s 2.1±0.26s -12.50%
fib/1000/execute 8.0±0.91ms 5.3±0.14ms -33.75%
fib/1000/prove 2.3±0.30s 2.1±0.31s -8.70%
fib/1000/total 2.3±0.24s 2.2±0.25s -4.35%
fib/10000/execute 11.8±1.54ms 10.1±0.07ms -14.41%
fib/10000/prove 7.6±0.66s 6.9±0.21s -9.21%
fib/10000/total 7.4±0.51s 7.2±0.21s -2.70%

Benchmark for macOS-default

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

Benchmark for macOS-metal

    <details open>
      <summary>Click to hide benchmark</summary>
      Benchmarks have changed between the two branches, unable to diff.
    </details>

@mothran mothran merged commit 54b8cb7 into main Sep 26, 2023
20 checks passed
@mothran mothran deleted the parker/zkvm-get-ver branch September 26, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants