Skip to content

Conversation

@lightsing
Copy link
Member

  1. make submodules group scroll public inputs
  2. expose public inputs api, refactor pi hash api using default trait implementation

@lightsing lightsing requested a review from Copilot December 4, 2025 05:04
@github-actions github-actions bot added crate-chunk-circuit Updates to the guest program chunk-circuit crate-batch-circuit Updates to the guest program batch-circuit crate-bundle-circuit Updates to the guest grogram bundle-circuit crate-integration Updates to the integration crate crate-circuits Any update made to the circuits, i.e. commitments reflect a change labels Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures the public inputs API to improve customization by organizing Scroll-specific public input types under a scroll submodule and exposing a cleaner API surface. The refactoring separates the encoding of public inputs from their hashing, using default trait implementations for the hash functions.

Key Changes:

  • Moved Scroll-specific public input types (batch, bundle, chunk) into a new public_inputs::scroll submodule
  • Renamed methods from pi_hash_* to pi_* to return raw encoded bytes instead of hashes, with hash computation moved to default trait implementations
  • Updated all import paths throughout the codebase to reference the new public_inputs::scroll::* locations

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/types/base/src/public_inputs/scroll.rs New module file exposing batch, bundle, and chunk submodules
crates/types/base/src/public_inputs.rs Added pi() method to traits with default pi_hash() implementations using keccak256
crates/types/base/src/public_inputs/scroll/chunk.rs Refactored methods to return Vec<u8> instead of B256, changed cloned() to copied()
crates/types/base/src/public_inputs/scroll/bundle.rs Refactored methods to return Vec<u8>, removed redundant pi_hash_euclidv2() method
crates/types/base/src/public_inputs/scroll/batch.rs Refactored methods to return Vec<u8> instead of B256
crates/types/src/lib.rs Updated imports to use public_inputs::scroll::* paths
crates/types/chunk/src/scroll/*.rs Updated imports to reference new module structure
crates/types/bundle/src/witness.rs Updated imports to reference new module structure
crates/types/batch/src/*.rs Updated imports throughout batch types to reference new module structure
crates/circuits/*/src/circuit.rs Updated imports in circuit files to reference new module structure
crates/integration/tests/bundle_circuit.rs Updated test to use PublicInputs trait and tuple-based API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lightsing
Copy link
Member Author

running e2e making sure it's ok

Copy link
Member

@noel2004 noel2004 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate-batch-circuit Updates to the guest program batch-circuit crate-bundle-circuit Updates to the guest grogram bundle-circuit crate-chunk-circuit Updates to the guest program chunk-circuit crate-circuits Any update made to the circuits, i.e. commitments reflect a change crate-integration Updates to the integration crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants