Skip to content

[Feat] - Add dynamic chain config to template#1663

Merged
ivokub merged 10 commits intoConsensys:masterfrom
thedarkjester:feat/dynamic-chain-config
Jan 14, 2026
Merged

[Feat] - Add dynamic chain config to template#1663
ivokub merged 10 commits intoConsensys:masterfrom
thedarkjester:feat/dynamic-chain-config

Conversation

@thedarkjester
Copy link
Copy Markdown
Contributor

@thedarkjester thedarkjester commented Dec 16, 2025

Description

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Test A
  • Test B

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Introduces configurable hooks for the Solidity verifier generators and updates templates accordingly.

  • Update groth16/bn254/solidity.go and plonk/bn254/solidity.go templates to support optional SortedImports, InterfaceDeclaration, extra Constants, Constructor, and Functions blocks
  • Add backend/solidity/solidity.go with ExportOptions: WithImport, WithInterface, WithConstants, WithConstructor, WithFunctions, plus helpers SortedImports() and InterfaceDeclaration()
  • New tests in backend/solidity/options_test.go and expanded solidity_test.go; add snapshot contracts in backend/solidity/testdata/* demonstrating all options

Written by Cursor Bugbot for commit 38416cb. This will update automatically on new commits. Configure here.

Comment thread backend/plonk/bn254/solidity.go Outdated
@ivokub ivokub added dep: linea Issues affecting Linea downstream priority: P2-medium Issue priority: medium feat: solidity labels Dec 17, 2025
@ivokub ivokub self-assigned this Dec 17, 2025
@ivokub
Copy link
Copy Markdown
Collaborator

ivokub commented Dec 17, 2025

The plan to integrate the configuration is as follows:

  • add Solidity export options:
    • Withlmport -- multiple options. Every line goes to separate row
    • WithInheretance -- can allow multiple. In this case have to format accordingly
    • WithConstants -- additional constants to whatever is defined in the template
    • WithFunctions -- aditionnal functions which can be included in the template
      And then we replace during contract generation. On Linea side we then provide the corresponding parameters for different cases (test case generation).

Timeline-wise -- can do after new year's.

@ivokub
Copy link
Copy Markdown
Collaborator

ivokub commented Jan 10, 2026

I made the changes. I'll double check soon.

Comment thread backend/groth16/bn254/solidity.go Outdated
Comment thread backend/solidity/options_test.go Outdated
Comment thread backend/solidity/options_test.go
Copy link
Copy Markdown
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Made parametric. Otherwise looks good to me.

@ivokub ivokub requested a review from ThomasPiellard January 13, 2026 11:26
@ivokub
Copy link
Copy Markdown
Collaborator

ivokub commented Jan 13, 2026

Also added @ThomasPiellard to confirm

@ivokub ivokub merged commit 1c68ad5 into Consensys:master Jan 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dep: linea Issues affecting Linea downstream feat: solidity priority: P2-medium Issue priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants