Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ytham
Copy link
Contributor

@ytham ytham commented Jun 21, 2024

  • CLI for single page index scan operations. See bin/predicate/README.md for instructions.

Full test

Run from the root of the repository.

# config.toml
[page]
index_bytes = 32
data_bytes = 32
bits_per_fe = 16
height = 256
# Write test input file to mockdb
cargo run --release --bin afs -- mock write -f bin/common/data/test_input_file_32_32.afi -o bin/common/data/input_file_32_32.mockdb

# Cache table input trace
cargo run --release --bin afs -- cache -t 0x155687649d5789a399211641b38bb93139f8ceca042466aa98e500a904657711 --db-file bin/common/data/input_file_32_32.mockdb --output-folder bin/common/data/predicate

# Generate proving and verifying keys
cargo run --release --bin predicate -- keygen -p lt

# Prove the inputs and save the proof to file
cargo run --release --bin predicate -- prove -p lt -v 0x20 -t 0x155687649d5789a399211641b38bb93139f8ceca042466aa98e500a904657711 -d bin/common/data/input_file_32_32.mockdb -i bin/common/data/predicate/0x155687649d5789a399211641b38bb93139f8ceca042466aa98e500a904657711.cache.bin

# Verify the proof
cargo run --release --bin predicate -- verify -p lt -v 0x20 -t 0x155687649d5789a399211641b38bb93139f8ceca042466aa98e500a904657711 -d bin/common/data/input_file_32_32.mockdb

Benchmark

Keygen: 1.582042ms
Prove: 39.999417ms
Verify: 68.768792ms

@ytham ytham requested a review from jonathanpwang June 21, 2024 20:42
@ytham ytham mentioned this pull request Jun 21, 2024
Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks good, but needs to split out into keygen, prove, verify functions

@jonathanpwang
Copy link
Contributor

@ytham also update to read the initial page ProverTraceData from file now that @bfan05 's PR was merged

@ytham
Copy link
Contributor Author

ytham commented Jun 29, 2024

@jonathanpwang ready for review: addressed comments and added prover trace data inputs (failing test is in vm folder)

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting some small changes

@ytham
Copy link
Contributor Author

ytham commented Jul 1, 2024

@jonathanpwang addressed comments

@jonathanpwang jonathanpwang merged commit 472e6a0 into main Jul 1, 2024
@jonathanpwang jonathanpwang deleted the feat/predicate-binary-new branch July 1, 2024 23:25
luffykai pushed a commit that referenced this pull request Dec 13, 2024
* Predicate binary branched off main

* Merge in main changes

* Move common data to  folder

* Split out keygen, prove, and verify

* Use cached traces

* Remove -v, -t, and -d flags from common

* Require input trace
Avaneesh-axiom pushed a commit that referenced this pull request Jan 10, 2025
* Predicate binary branched off main

* Merge in main changes

* Move common data to  folder

* Split out keygen, prove, and verify

* Use cached traces

* Remove -v, -t, and -d flags from common

* Require input trace
jonathanpwang added a commit that referenced this pull request Mar 9, 2025
**Finding Link:**
https://cantina.xyz/code/c486d600-bed0-4fc6-aed1-de759fd29fa2/findings/11

## Description of Fix

The LogUp linear equalities on trace heights together with a new
condition that we require VM instruction executor chips to satisfy
ensures that the timestamp does not overflow the field. We then range
check the final timestamp in the Connector Chip.

We state the new condition in the circuit spec (circuit.md) together
with an inspection of all existing chips to justify that they satisfy
the condition.

---------

Co-authored-by: Jonathan Wang <[email protected]>
jonathanpwang added a commit that referenced this pull request Mar 9, 2025
**Finding Link:**
https://cantina.xyz/code/c486d600-bed0-4fc6-aed1-de759fd29fa2/findings/11

## Description of Fix

The LogUp linear equalities on trace heights together with a new
condition that we require VM instruction executor chips to satisfy
ensures that the timestamp does not overflow the field. We then range
check the final timestamp in the Connector Chip.

We state the new condition in the circuit spec (circuit.md) together
with an inspection of all existing chips to justify that they satisfy
the condition.

---------

Co-authored-by: Jonathan Wang <[email protected]>
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.

3 participants