-
Notifications
You must be signed in to change notification settings - Fork 19
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
Default ProofParams on sandstorm and Starkware Verifier expected ProofParams #6
Comments
Yeah, not all the proof params can be derived directly from the Sandstorm params. Here's how you can calculate each of them: let lde_blowup_factor = proof.options.lde_blowup_factor as usize;
let lde_domain_size = proof.trace_len * lde_blowup_factor;
let fri_options = proof.options.into_fri_options();
let remainder_codeword_size = fri_options.remainder_size(lde_domain_size);
let max_remainder_coeffs = remainder_codeword_size / lde_blowup_factor;
let fri_last_layer_log_deg_bound = max_remainder_coeffs.ilog2();
let fri_steps = [
vec![0u32],
vec![proof.options.fri_folding_factor.ilog2(); fri_options.num_layers(lde_domain_size)],
]
.concat();
let n_fri_steps = fri_steps.len(); |
Hi @andrewmilson thank you! That really helped understanding and putting it together on my side. Another fields which I couldn't find a matching anywhere was the cairoAuxInput and cairoVerifierId.
Note: I am not fluent in rust, so sorry if there is something that doesn't make sense. However I have a few questions which can also be seen as comments on the code above.
Thank you again your help! |
Hello @andrewmilson, quick update: Found the utility function public_input_elements on the type CairoAuxInput inside sandstorm which helps with my previous comment, however I did notice the following:
Also looked into the contract source code: Trying to submit a transaction to a starkex verifier on chain and I am getting: Can you give some insights on what I might be missing? Here is the current cairoAuxInput: |
The proof generation on sandstorm uses the following parameters listed below as default:
While checking starkex smart contracts, the proofParams expected on the smart contract method verifyProofAndRegister of Starkware GpsStatementVerifier seems to be the related with the following:
PROOF_PARAMS_N_QUERIES_OFFSET
PROOF_PARAMS_LOG_BLOWUP_FACTOR_OFFSET
PROOF_PARAMS_PROOF_OF_WORK_BITS_OFFSET
PROOF_PARAMS_FRI_LAST_LAYER_LOG_DEG_BOUND_OFFSET
PROOF_PARAMS_N_FRI_STEPS_OFFSET
PROOF_PARAMS_FRI_STEPS_OFFSET
I can see a relation between the first three to the default ones used by sandstorm, but even looking at sandstorm and comparing with starkex smart contracts, couldn't figure yet how I can get the other parameters (PROOF_PARAMS_FRI_LAST_LAYER_LOG_DEG_BOUND_OFFSET, PROOF_PARAMS_N_FRI_STEPS_OFFSET, PROOF_PARAMS_FRI_STEPS_OFFSET), taking into account on sandstorm there is the fri_folding_factor and fri_max_remainder_coeffs.
I believe there might be a way, maybe not trivial, can some insight be given on this matter? @andrewmilson
Thank you!
The text was updated successfully, but these errors were encountered: