Skip to content

feat: link c6-c7 [skip-line-limit]#1498

Merged
0xjei merged 3 commits into
mainfrom
feat/link-c6-c7
Mar 30, 2026
Merged

feat: link c6-c7 [skip-line-limit]#1498
0xjei merged 3 commits into
mainfrom
feat/link-c6-c7

Conversation

@0xjei

@0xjei 0xjei commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded the zero-knowledge proof-linking framework with new validation mechanisms ensuring consistency and correct data extraction between interconnected proof circuits during verification processes.
  • Tests

    • Added extensive unit tests verifying accurate public-signal extraction, correct field indexing from data buffers, and robust edge-case handling across multiple circuit types and layout configurations.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6178815e-ed08-417e-a25a-70e4656a5394

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/link-c6-c7

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel

vercel Bot commented Mar 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Mar 30, 2026 3:01pm
enclave-docs Ready Ready Preview, Comment Mar 30, 2026 3:01pm

Request Review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 07574da and 99c44f5.

📒 Files selected for processing (4)
  • crates/events/src/enclave_event/proof.rs
  • crates/zk-helpers/src/circuits/output_layout.rs
  • crates/zk-prover/src/actors/commitment_links/c6_to_c7.rs
  • crates/zk-prover/src/actors/commitment_links/mod.rs

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@0xjei 0xjei merged commit 66780fa into main Mar 30, 2026
33 checks passed
@github-actions github-actions Bot deleted the feat/link-c6-c7 branch April 7, 2026 03:21
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.

Cross-circuit check: C6→C7 — verify C7 uses C6s decrypted shares of honest parties

2 participants