feat: link c6-c7 [skip-line-limit]#1498
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/zk-prover/src/actors/commitment_links/c6_to_c7.rs (1)
142-151: Consider using realistic C6 signal size for extraction test.The test uses only 32 bytes (just the output), while actual C6 signals would be 96 bytes (2 public inputs + 1 output). The extraction logic works correctly due to tail-indexing, but a realistic signal size would make the test more representative.
💡 Optional: Use realistic 96-byte C6 signals
#[test] fn extract_d_commitment_from_c6() { let link = C6ToC7DCommitmentLink; let d = make_field(7); - let signals = d.to_vec(); + // C6: 2 public inputs + 1 output (d_commitment at tail) + let mut signals = vec![0u8; 96]; + signals[0..32].copy_from_slice(&make_field(0x11)); // expected_sk_commitment + signals[32..64].copy_from_slice(&make_field(0x22)); // expected_e_sm_commitment + signals[64..96].copy_from_slice(&d); // d_commitment let values = link.extract_source_values(&signals); assert_eq!(values.len(), 1); assert_eq!(values[0], d); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/zk-prover/src/actors/commitment_links/c6_to_c7.rs` around lines 142 - 151, The test extract_d_commitment_from_c6 uses a single 32-byte signal but should use a realistic 96-byte C6 signal (2 public inputs + 1 output) to better represent real input layout; update the test that constructs signals in the C6ToC7DCommitmentLink test by prepending two 32-byte dummy public input fields (e.g., make_field(0) and make_field(1)) before the output field d (make_field(7).to_vec()), then call link.extract_source_values(&signals) and keep the same assertions to verify extraction still returns the single d field; reference C6ToC7DCommitmentLink, extract_source_values, extract_d_commitment_from_c6 (test name), make_field, and signals when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/zk-prover/src/actors/commitment_links/c6_to_c7.rs`:
- Around line 142-151: The test extract_d_commitment_from_c6 uses a single
32-byte signal but should use a realistic 96-byte C6 signal (2 public inputs + 1
output) to better represent real input layout; update the test that constructs
signals in the C6ToC7DCommitmentLink test by prepending two 32-byte dummy public
input fields (e.g., make_field(0) and make_field(1)) before the output field d
(make_field(7).to_vec()), then call link.extract_source_values(&signals) and
keep the same assertions to verify extraction still returns the single d field;
reference C6ToC7DCommitmentLink, extract_source_values,
extract_d_commitment_from_c6 (test name), make_field, and signals when making
the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5c931eca-51f7-4ae3-aed8-2762521a4dcc
📒 Files selected for processing (4)
crates/events/src/enclave_event/proof.rscrates/zk-helpers/src/circuits/output_layout.rscrates/zk-prover/src/actors/commitment_links/c6_to_c7.rscrates/zk-prover/src/actors/commitment_links/mod.rs
Summary by CodeRabbit
Release Notes
New Features
Tests