Skip to content

feat: make constraint.Element generic interface#1463

Merged
ivokub merged 64 commits into
masterfrom
feat/clean-generic-element
Apr 13, 2025
Merged

feat: make constraint.Element generic interface#1463
ivokub merged 64 commits into
masterfrom
feat/clean-generic-element

Conversation

@ivokub
Copy link
Copy Markdown
Collaborator

@ivokub ivokub commented Apr 1, 2025

Description

With the upcoming support of smallfield fields for compiling the circuits to in conjuction with Linea prover, we need to be able to compile gnark circuits over small fields. gnark-crypto defines small field operations over [1]uint32 instead of [4]uint64 and [6]uint64, so we have some incompatibility in marshalling etc.

However, the biggest problem is the in-memory size of the compiled circuits - even if we would continue using [6]uint64 for all possible elements and fixing the marshalling, then we would have 12x overhead when defining coefficients. The actual overhead compared with existing circuits would be even bigger, as we need more constraints to represent the same computations (for example when using non-native arithmetic).

I have tried to create type aliases so that existing code would compile and run without needing any changes. The only place which has incompatible change is the log-derivate lookup gadget, as previously we returned concrete implementation, and now an interface. As the concrete implementation returned a reference to the lookup table, then we need to dereference when the lookup table type was explicitly defined. I have updated it in gnark, but there may be external users, however the change to fix the interface should be simple (*logderivlookup.Table ---> logderivlookup.Table).

Furthermore, it would be nice to change the tinyfield implementation also to use constraint.U32, as allows to remove some assumptions and hard-coded edge cases.

Another thing we could try is to omit code generation for constraint/ package now and use the generic implementation.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

Added tests to ensure constraint.Element marshalling and unmarshalling is consistent. Existing tests should run cleanly.

How has this been benchmarked?

goos: linux
goarch: amd64
pkg: github.com/consensys/gnark/internal/smallfields
cpu: AMD Ryzen 9 7940HS w/ Radeon 780M Graphics     
                                                  │   old.txt   │               new.txt               │
                                                  │   sec/op    │   sec/op     vs base                │
CompileEcdsaBn254/curve=bn254/builder=r1cs-16       302.2m ± 1%   348.7m ± 1%  +15.39% (p=0.000 n=10)
CompileEcdsaBn254/curve=bn254/builder=scs-16        194.0m ± 1%   196.2m ± 1%   +1.17% (p=0.019 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-16   305.2m ± 1%   348.9m ± 1%  +14.32% (p=0.000 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-16    194.2m ± 1%   198.4m ± 2%   +2.12% (p=0.000 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-16     309.2m ± 1%   355.4m ± 1%  +14.96% (p=0.000 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=scs-16      204.0m ± 1%   209.4m ± 1%   +2.63% (p=0.000 n=10)
SolveEcdsa/curve=bn254/builder=r1cs-16              41.80m ± 1%   42.32m ± 1%   +1.24% (p=0.043 n=10)
SolveEcdsa/curve=bn254/builder=scs-16               65.21m ± 3%   65.12m ± 2%        ~ (p=0.529 n=10)
SolveEcdsa/curve=bls12-377/builder=r1cs-16          42.17m ± 1%   42.10m ± 1%        ~ (p=0.631 n=10)
SolveEcdsa/curve=bls12-377/builder=scs-16           65.37m ± 1%   65.24m ± 1%        ~ (p=0.739 n=10)
SolveEcdsa/curve=bw6-761/builder=r1cs-16            54.47m ± 2%   54.64m ± 1%        ~ (p=0.529 n=10)
SolveEcdsa/curve=bw6-761/builder=scs-16             80.61m ± 2%   81.52m ± 4%        ~ (p=0.052 n=10)
ProveEcdsa/curve=bn254/groth16-16                   273.3m ± 1%   274.8m ± 1%        ~ (p=0.353 n=10)
ProveEcdsa/curve=bn254/plonk-16                      3.557 ± 0%    3.568 ± 1%        ~ (p=0.315 n=10)
ProveEcdsa/curve=bls12-377/groth16-16               453.4m ± 1%   453.4m ± 1%        ~ (p=1.000 n=10)
ProveEcdsa/curve=bls12-377/plonk-16                  4.701 ± 1%    4.704 ± 0%        ~ (p=0.579 n=10)
ProveEcdsa/curve=bw6-761/groth16-16                  1.617 ± 1%    1.619 ± 1%        ~ (p=0.353 n=10)
ProveEcdsa/curve=bw6-761/plonk-16                    16.07 ± 1%    16.13 ± 1%        ~ (p=0.052 n=10)
geomean                                             300.1m        308.7m        +2.88%

                                                  │   old.txt    │               new.txt               │
                                                  │     B/op     │     B/op      vs base               │
CompileEcdsaBn254/curve=bn254/builder=r1cs-16       726.0Mi ± 0%   726.4Mi ± 0%       ~ (p=0.393 n=10)
CompileEcdsaBn254/curve=bn254/builder=scs-16        263.0Mi ± 1%   263.6Mi ± 0%       ~ (p=0.579 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-16   726.4Mi ± 0%   725.9Mi ± 0%       ~ (p=0.912 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-16    263.0Mi ± 0%   263.0Mi ± 0%       ~ (p=0.853 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-16     729.1Mi ± 0%   729.6Mi ± 0%       ~ (p=0.218 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=scs-16      266.1Mi ± 1%   265.8Mi ± 1%       ~ (p=0.912 n=10)
SolveEcdsa/curve=bn254/builder=r1cs-16              31.64Mi ± 0%   31.70Mi ± 0%       ~ (p=0.075 n=10)
SolveEcdsa/curve=bn254/builder=scs-16               74.15Mi ± 0%   74.12Mi ± 0%       ~ (p=0.684 n=10)
SolveEcdsa/curve=bls12-377/builder=r1cs-16          31.65Mi ± 0%   31.65Mi ± 0%       ~ (p=0.481 n=10)
SolveEcdsa/curve=bls12-377/builder=scs-16           74.07Mi ± 0%   74.12Mi ± 0%       ~ (p=0.247 n=10)
SolveEcdsa/curve=bw6-761/builder=r1cs-16            40.96Mi ± 0%   40.98Mi ± 0%       ~ (p=0.971 n=10)
SolveEcdsa/curve=bw6-761/builder=scs-16             104.3Mi ± 0%   104.3Mi ± 0%       ~ (p=0.436 n=10)
ProveEcdsa/curve=bn254/groth16-16                   72.99Mi ± 0%   72.99Mi ± 0%       ~ (p=0.579 n=10)
ProveEcdsa/curve=bn254/plonk-16                     921.1Mi ± 0%   921.1Mi ± 0%       ~ (p=0.436 n=10)
ProveEcdsa/curve=bls12-377/groth16-16               73.51Mi ± 0%   73.51Mi ± 0%       ~ (p=0.912 n=10)
ProveEcdsa/curve=bls12-377/plonk-16                 921.1Mi ± 0%   921.1Mi ± 0%       ~ (p=0.393 n=10)
ProveEcdsa/curve=bw6-761/groth16-16                 959.7Mi ± 0%   959.7Mi ± 0%       ~ (p=0.631 n=10)
ProveEcdsa/curve=bw6-761/plonk-16                   4.526Gi ± 1%   4.526Gi ± 1%       ~ (p=0.393 n=10)
geomean                                             230.5Mi        230.5Mi       +0.02%

                                                  │   old.txt   │              new.txt               │
                                                  │  allocs/op  │  allocs/op   vs base               │
CompileEcdsaBn254/curve=bn254/builder=r1cs-16       3.258M ± 0%   3.258M ± 0%  -0.00% (p=0.000 n=10)
CompileEcdsaBn254/curve=bn254/builder=scs-16        1.876M ± 0%   1.876M ± 0%  -0.00% (p=0.029 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-16   3.258M ± 0%   3.258M ± 0%  -0.00% (p=0.002 n=10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-16    1.876M ± 0%   1.876M ± 0%       ~ (p=0.404 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-16     3.258M ± 0%   3.258M ± 0%  -0.00% (p=0.000 n=10)
CompileEcdsaBn254/curve=bw6-761/builder=scs-16      1.876M ± 0%   1.876M ± 0%       ~ (p=1.000 n=10)
SolveEcdsa/curve=bn254/builder=r1cs-16              350.0k ± 0%   350.1k ± 0%       ~ (p=0.529 n=10)
SolveEcdsa/curve=bn254/builder=scs-16               365.1k ± 0%   365.1k ± 0%       ~ (p=0.618 n=10)
SolveEcdsa/curve=bls12-377/builder=r1cs-16          349.8k ± 0%   349.9k ± 0%       ~ (p=0.615 n=10)
SolveEcdsa/curve=bls12-377/builder=scs-16           365.1k ± 0%   365.6k ± 0%       ~ (p=0.280 n=10)
SolveEcdsa/curve=bw6-761/builder=r1cs-16            351.6k ± 0%   351.5k ± 0%       ~ (p=0.796 n=10)
SolveEcdsa/curve=bw6-761/builder=scs-16             367.6k ± 0%   367.7k ± 0%       ~ (p=0.645 n=10)
ProveEcdsa/curve=bn254/groth16-16                   380.7k ± 0%   380.6k ± 0%       ~ (p=0.528 n=10)
ProveEcdsa/curve=bn254/plonk-16                     519.9k ± 0%   519.9k ± 0%       ~ (p=0.739 n=10)
ProveEcdsa/curve=bls12-377/groth16-16               392.0k ± 0%   392.0k ± 0%       ~ (p=0.529 n=10)
ProveEcdsa/curve=bls12-377/plonk-16                 519.8k ± 0%   519.9k ± 0%       ~ (p=0.315 n=10)
ProveEcdsa/curve=bw6-761/groth16-16                 483.3k ± 0%   483.4k ± 0%  +0.01% (p=0.043 n=10)
ProveEcdsa/curve=bw6-761/plonk-16                   520.8k ± 0%   520.8k ± 0%       ~ (p=0.280 n=10)
geomean                                             744.1k        744.2k       +0.01%

Macbook, but the variance is high (power saving I guess)

name                                               old time/op    new time/op    delta
CompileEcdsaBn254/curve=bn254/builder=r1cs-10         302ms ± 4%     326ms ± 2%   +7.82%  (p=0.000 n=9+9)
CompileEcdsaBn254/curve=bn254/builder=scs-10          196ms ± 3%     196ms ± 4%     ~     (p=0.842 n=9+10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-10     298ms ± 1%     330ms ± 3%  +10.78%  (p=0.000 n=10+10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-10      197ms ± 4%     194ms ± 1%   -1.57%  (p=0.035 n=10+10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-10       319ms ±11%     333ms ± 1%     ~     (p=0.079 n=9+10)
CompileEcdsaBn254/curve=bw6-761/builder=scs-10        207ms ± 2%     204ms ± 1%   -1.60%  (p=0.000 n=9+8)
SolveEcdsa/curve=bn254/builder=r1cs-10               52.2ms ± 3%    50.4ms ± 1%   -3.50%  (p=0.000 n=9+10)
SolveEcdsa/curve=bn254/builder=scs-10                75.5ms ± 7%    74.7ms ± 2%     ~     (p=0.661 n=10+9)
SolveEcdsa/curve=bls12-377/builder=r1cs-10           50.9ms ± 1%    50.9ms ± 2%     ~     (p=0.460 n=10+8)
SolveEcdsa/curve=bls12-377/builder=scs-10            73.9ms ± 1%    74.3ms ± 2%     ~     (p=0.218 n=10+10)
SolveEcdsa/curve=bw6-761/builder=r1cs-10             67.2ms ± 5%    67.1ms ± 5%     ~     (p=1.000 n=10+10)
SolveEcdsa/curve=bw6-761/builder=scs-10              92.2ms ± 2%    93.2ms ± 4%     ~     (p=0.243 n=10+9)
ProveEcdsa/curve=bn254/groth16-10                     360ms ± 2%     365ms ± 3%     ~     (p=0.122 n=8+10)
ProveEcdsa/curve=bn254/plonk-10                       4.96s ±12%     4.80s ± 6%     ~     (p=0.529 n=10+10)
ProveEcdsa/curve=bls12-377/groth16-10                 582ms ± 9%     573ms ± 0%     ~     (p=0.515 n=10+8)
ProveEcdsa/curve=bls12-377/plonk-10                   5.86s ± 4%     6.12s ± 7%   +4.52%  (p=0.007 n=10+10)
ProveEcdsa/curve=bw6-761/groth16-10                   2.00s ±15%     1.96s ± 5%     ~     (p=0.684 n=10+10)
ProveEcdsa/curve=bw6-761/plonk-10                     23.8s ± 8%     24.2s ±10%     ~     (p=0.631 n=10+10)

name                                               old alloc/op   new alloc/op   delta
CompileEcdsaBn254/curve=bn254/builder=r1cs-10         763MB ± 0%     762MB ± 0%   -0.10%  (p=0.029 n=10+10)
CompileEcdsaBn254/curve=bn254/builder=scs-10          277MB ± 0%     277MB ± 0%     ~     (p=0.780 n=9+10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-10     763MB ± 0%     762MB ± 0%     ~     (p=0.211 n=9+10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-10      276MB ± 0%     276MB ± 0%     ~     (p=0.684 n=10+10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-10       765MB ± 0%     765MB ± 0%     ~     (p=0.684 n=10+10)
CompileEcdsaBn254/curve=bw6-761/builder=scs-10        279MB ± 1%     280MB ± 0%     ~     (p=0.156 n=10+9)
SolveEcdsa/curve=bn254/builder=r1cs-10               33.2MB ± 0%    33.1MB ± 0%   -0.23%  (p=0.023 n=10+10)
SolveEcdsa/curve=bn254/builder=scs-10                77.7MB ± 0%    77.8MB ± 0%     ~     (p=0.436 n=10+10)
SolveEcdsa/curve=bls12-377/builder=r1cs-10           33.2MB ± 1%    33.1MB ± 1%     ~     (p=0.481 n=10+10)
SolveEcdsa/curve=bls12-377/builder=scs-10            77.7MB ± 0%    77.8MB ± 0%   +0.03%  (p=0.001 n=10+8)
SolveEcdsa/curve=bw6-761/builder=r1cs-10             42.9MB ± 0%    43.0MB ± 0%     ~     (p=0.218 n=10+10)
SolveEcdsa/curve=bw6-761/builder=scs-10               109MB ± 0%     109MB ± 0%     ~     (p=0.161 n=10+7)
ProveEcdsa/curve=bn254/groth16-10                    76.5MB ± 0%    76.5MB ± 0%     ~     (p=0.573 n=10+8)
ProveEcdsa/curve=bn254/plonk-10                       966MB ± 0%     966MB ± 0%     ~     (p=0.720 n=10+9)
ProveEcdsa/curve=bls12-377/groth16-10                77.6MB ± 0%    77.6MB ± 0%     ~     (p=0.360 n=10+8)
ProveEcdsa/curve=bls12-377/plonk-10                   966MB ± 0%     966MB ± 0%     ~     (p=0.621 n=9+9)
ProveEcdsa/curve=bw6-761/groth16-10                   708MB ± 0%     708MB ± 0%     ~     (p=0.905 n=10+9)
ProveEcdsa/curve=bw6-761/plonk-10                    8.20GB ± 0%    8.20GB ± 0%     ~     (p=0.315 n=10+10)

name                                               old allocs/op  new allocs/op  delta
CompileEcdsaBn254/curve=bn254/builder=r1cs-10         3.26M ± 0%     3.26M ± 0%   -0.00%  (p=0.009 n=10+10)
CompileEcdsaBn254/curve=bn254/builder=scs-10          1.88M ± 0%     1.88M ± 0%     ~     (p=0.063 n=10+10)
CompileEcdsaBn254/curve=bls12-377/builder=r1cs-10     3.26M ± 0%     3.26M ± 0%     ~     (p=0.055 n=10+10)
CompileEcdsaBn254/curve=bls12-377/builder=scs-10      1.88M ± 0%     1.88M ± 0%   -0.00%  (p=0.020 n=10+10)
CompileEcdsaBn254/curve=bw6-761/builder=r1cs-10       3.26M ± 0%     3.26M ± 0%     ~     (p=0.984 n=10+9)
CompileEcdsaBn254/curve=bw6-761/builder=scs-10        1.88M ± 0%     1.88M ± 0%     ~     (p=0.436 n=10+10)
SolveEcdsa/curve=bn254/builder=r1cs-10                 351k ± 0%      351k ± 0%     ~     (p=0.063 n=10+10)
SolveEcdsa/curve=bn254/builder=scs-10                  367k ± 0%      367k ± 0%     ~     (p=0.165 n=10+10)
SolveEcdsa/curve=bls12-377/builder=r1cs-10             351k ± 0%      351k ± 0%     ~     (p=0.190 n=10+10)
SolveEcdsa/curve=bls12-377/builder=scs-10              367k ± 0%      367k ± 0%   +0.12%  (p=0.003 n=10+9)
SolveEcdsa/curve=bw6-761/builder=r1cs-10               353k ± 0%      353k ± 0%     ~     (p=0.536 n=7+10)
SolveEcdsa/curve=bw6-761/builder=scs-10                369k ± 0%      369k ± 0%     ~     (p=0.670 n=10+10)
ProveEcdsa/curve=bn254/groth16-10                      391k ± 0%      391k ± 0%     ~     (p=0.353 n=10+10)
ProveEcdsa/curve=bn254/plonk-10                        519k ± 0%      519k ± 0%     ~     (p=0.971 n=10+10)
ProveEcdsa/curve=bls12-377/groth16-10                  414k ± 0%      414k ± 0%     ~     (p=0.089 n=10+10)
ProveEcdsa/curve=bls12-377/plonk-10                    519k ± 0%      519k ± 0%     ~     (p=0.661 n=10+9)
ProveEcdsa/curve=bw6-761/groth16-10                    483k ± 0%      483k ± 0%     ~     (p=0.393 n=10+10)
ProveEcdsa/curve=bw6-761/plonk-10                      521k ± 0%      521k ± 0%   -0.02%  (p=0.011 n=10+10)

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

Copy link
Copy Markdown
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.

Copilot reviewed 95 out of 95 changed files in this pull request and generated 4 comments.

Comment thread constraint/bls24-317/r1cs_test.go Outdated
Comment thread constraint/bls24-315/r1cs_test.go Outdated
Comment thread constraint/bls12-381/r1cs_test.go Outdated
Comment thread constraint/bls12-377/r1cs_test.go Outdated
@ivokub
Copy link
Copy Markdown
Collaborator Author

ivokub commented Apr 10, 2025

@gbotrel - ready now. Only thing I'm still thinking, but would require modifying gnark-crypto or bavard is to have option for finite field generator config to force compiling on uint32. Then we could also make tinyfield to work on [1]uint32 and imo would be a bit nicer. What do you think, would it be worth it?

@ivokub ivokub requested a review from Copilot April 10, 2025 11:54
Copy link
Copy Markdown
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.

Copilot reviewed 95 out of 95 changed files in this pull request and generated no comments.

@gbotrel
Copy link
Copy Markdown
Collaborator

gbotrel commented Apr 10, 2025

@gbotrel - ready now. Only thing I'm still thinking, but would require modifying gnark-crypto or bavard is to have option for finite field generator config to force compiling on uint32. Then we could also make tinyfield to work on [1]uint32 and imo would be a bit nicer. What do you think, would it be worth it?

Yes I guess I took some shortcuts in gnark-crypto and would need to ensure the condition to generate code for koala/babybear is different than the one for fields that are smaller than 32bits .

For tinyfield since we just care about the base field arithmetic I think I just need to correct the vector code generation, will double check.. and do a PR in gnark-crypto 👍

@ivokub
Copy link
Copy Markdown
Collaborator Author

ivokub commented Apr 10, 2025

@gbotrel - ready now. Only thing I'm still thinking, but would require modifying gnark-crypto or bavard is to have option for finite field generator config to force compiling on uint32. Then we could also make tinyfield to work on [1]uint32 and imo would be a bit nicer. What do you think, would it be worth it?

Yes I guess I took some shortcuts in gnark-crypto and would need to ensure the condition to generate code for koala/babybear is different than the one for fields that are smaller than 32bits .

For tinyfield since we just care about the base field arithmetic I think I just need to correct the vector code generation, will double check.. and do a PR in gnark-crypto 👍

So what I was thinking is to add Option to NewFieldConfig which allows to force code generation over uint32. And then for tinyfield we would use that in gnark side.

Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel left a comment

Choose a reason for hiding this comment

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

great, glad this could work out; minor remarks, and maybe worth it to add U64x4 and U64x6 that would negate any perf changes for most production use cases.

also, not sure we needed to bring in babybear just yet, but since you did it ... :)

Comment thread constraint/field.go
Comment thread frontend/compile.go Outdated
Comment thread std/rangecheck/rangecheck.go Outdated
Comment thread test/engine.go
@ivokub
Copy link
Copy Markdown
Collaborator Author

ivokub commented Apr 11, 2025

Feedback addressed imo:

  • targeted gnark-crypto PR which compiles tinyfield on [1]uint32. Had to make some fixes there but now seems to work.
  • made the compile error a bit more explicit and helpful.

Imo there is two big things we'd need to decide still before merging this PR. First, do we want to split U64 between 4 and 6 element array. I'd prefer not to.

Secondly - what to do with api.Commit. The issue is that when we compile the circuit over small field, then the commit from Commit is small and insecure for any use case. For now imo this wouldn't be an issue, we don't have any backend associated and we cannot anyway create any proofs.

We should somehow still address it to avoid any problems in the future. We could either just panic in api.Commit when we're compiling over a small field. Imo we only test small field compiling right now for simple circuits which don't do api.Commit. And when in the future we have an explicit blocker we need to solve in the future somehow. Actually in the non-native PR I have I have addressed the issue by implementing WideCommit method which returns the commitment in field extension, and it should be sound.

A bit better solution imo is to use the frontend.Committer interface - we could try to unimplement it somehow when compiling over small field, such that there is no way to compile a circuit at all.

In the end the result is the same, it is just technical difference (either we panic inside Commit method or we panic as the type assertion doesn't hold).

@ivokub ivokub requested review from Copilot and gbotrel April 11, 2025 12:29
Copy link
Copy Markdown
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.

Copilot reviewed 98 out of 98 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

constraint/bls24-317/coeff.go:155

  • The field arithmetic functions (e.g. Mul) currently modify the first operand in place. Consider performing the operation on a copy of the input to avoid unexpected side-effects in caller code.
_a.Mul(_a, _b)

constraint/bls12-377/system.go:69

  • [nitpick] With the introduction of generics, the blueprint interfaces now include a type parameter (e.g. constraint.BlueprintStateful[constraint.U64]). It would be beneficial to add documentation comments to clarify the new generic usage and its implications for external users.
if b, ok := cs.Blueprints[i].(constraint.BlueprintStateful[constraint.U64]); ok {

@ivokub ivokub merged commit b534049 into master Apr 13, 2025
@ivokub ivokub deleted the feat/clean-generic-element branch April 13, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: consolidate strengthen an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants