Skip to content
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

Dead Code: Unused Fields in Constraint Generation Module #309

Open
wamimi opened this issue Oct 22, 2024 · 0 comments
Open

Dead Code: Unused Fields in Constraint Generation Module #309

wamimi opened this issue Oct 22, 2024 · 0 comments

Comments

@wamimi
Copy link

wamimi commented Oct 22, 2024

While building Circom from source, several "dead code" warnings were identified in the constraint generation module. These warnings indicate multiple struct fields that are defined but never read in the codebase.

Specific Locations

In constraint_generation/src/execution_data/executed_bus.rs:

  1. BusConnexion struct:

    • full_name: String
    • dag_offset: usize
    • dag_jump: usize
  2. ExecutedBus struct:

    • report_name: String
    • bus_id: Option<usize>

In constraint_generation/src/execution_data/type_definitions.rs:

  1. BusData struct:

    • name: String
  2. AccessingInformation struct:

    • tag_access: Option<String>

Questions for Maintainers

  1. Are these fields intentionally kept for future implementation?
  2. If not, would removing these unused fields be a welcome contribution?
  3. If the fields should be retained, would you prefer:
    • Adding documentation explaining their intended future use?
    • Adding #[allow(dead_code)] annotations?
    • Implementing functionality that utilizes these fields?

Proposed Solutions

I'm willing to contribute a PR with one of these approaches:

  1. Remove unused fields if they're no longer needed
  2. Add proper documentation if they're for future use
  3. Add #[allow(dead_code)] annotations if preferred
  4. Implement missing functionality if there's a specific intended use

Additional Context

These warnings appear during the build process with:

cargo build --release
cargo install --path circom
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

No branches or pull requests

1 participant