Skip to content

feat: bump constraint limit to 2^20 - #817

Merged
sourabhxyz merged 12 commits into
808-circuit-optfrom
upon-808-test-pau2-20
Apr 6, 2026
Merged

feat: bump constraint limit to 2^20#817
sourabhxyz merged 12 commits into
808-circuit-optfrom
upon-808-test-pau2-20

Conversation

@sourabhxyz

Copy link
Copy Markdown
Contributor

Previously:

updateLedgerState
  E2E One [✔]
  E2E Two [✔]
  E2E Three [✔]
  Null transaction as batch padding passes validation [✔]
Time taken to compute ledgerCircuit: 4.267 sec
constraints: 64523, variables: 65816
Time taken to compute zkLedgerSetup: 83.523 sec
Time taken to compute zkLedgerProof: 165.563 sec
Time taken to compute zkLedgerProof2: 165.923 sec
zkLedgerInput: Plonkup Input: [0,3195721223432807590315931744774089114582959145720905619494438813130265079564,0,15856765338934567876274247118180883708295486259209517075734479437976472467496,15856765338934567876274247118180883708295486259209517075734479437976472467496,48351281068924492262321468896264504833411400898654358688731651776892901623667,30873107671128920979358651041813029837000612435957166159820003367028799279372,1,34949590100076397709405755766291531737705177100855665100823916672972473040272,15856765338934567876274247118180883708295486259209517075734479437976472467496,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,5000000,0,0,0,0]
zkLedgerInput2: Plonkup Input: [48351281068924492262321468896264504833411400898654358688731651776892901623667,30873107671128920979358651041813029837000612435957166159820003367028799279372,1,34949590100076397709405755766291531737705177100855665100823916672972473040272,15856765338934567876274247118180883708295486259209517075734479437976472467496,34765955657041655293816282537274670880107433050433417259985169455278703708800,3195721223432807590315931744774089114582959145720905619494438813130265079564,2,15856765338934567876274247118180883708295486259209517075734479437976472467496,41407070337595132130395268741395832453203845317575224103192549686812917401832,1,0,0,0,0,19889081452670861588114349990778949346404544631803352712004893411981264611445,0,0,5000000]
  E2E ledger circuit, One: prove and verify [✔]
Time taken to compute ledgerCircuit: 41.631 sec
constraints: 208440, zero constraints: 0, variables: 213736
Time taken to compute zkLedgerSetup: 88.619 sec
Time taken to compute zkLedgerProof: 178.044 sec
Time taken to compute zkLedgerProof2: 177.948 sec
zkLedgerInput: Plonkup Input: [0,45657705944472882265086323600425938266507381675436748523027424488304981985054,0,3168427766254734602800027243876685285256750821462392254135519847565200904400,3168427766254734602800027243876685285256750821462392254135519847565200904400,34818080958997748745904040433212409173947150796653521607003496062211592543207,14820233507260226097969677013972906370618206906708611318674207662908566353439,1,37602514700970693461296811620022775074377607632824876101220160483674748373660,3168427766254734602800027243876685285256750821462392254135519847565200904400,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,10000000,5416991460958575053756211119605256293102838005726979983329238545068,2258225731751461549424,50000000,0,0,0,0,0,0,0]
  E2E ledger circuit, Three: prove and verify [✔]
LedgerContractInput JSON
  encodes to JSON matching the golden file [✔]
  decodes from the golden JSON back to the same value (by re-encoding) [✔]

Finished in 708.2335 seconds

Now:

updateLedgerState
  E2E One [✔]
  E2E Two [✔]
  E2E Three [✔]
  Null transaction as batch padding passes validation [✔]
Time taken to compute ledgerCircuit: 4.206 sec
constraints: 64523, variables: 65816
Time taken to compute zkLedgerSetup: 329.670 sec
Time taken to compute zkLedgerProof: 674.909 sec
Time taken to compute zkLedgerProof2: 667.557 sec
zkLedgerInput: Plonkup Input: [0,3195721223432807590315931744774089114582959145720905619494438813130265079564,0,15856765338934567876274247118180883708295486259209517075734479437976472467496,15856765338934567876274247118180883708295486259209517075734479437976472467496,48351281068924492262321468896264504833411400898654358688731651776892901623667,30873107671128920979358651041813029837000612435957166159820003367028799279372,1,34949590100076397709405755766291531737705177100855665100823916672972473040272,15856765338934567876274247118180883708295486259209517075734479437976472467496,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,5000000,0,0,0,0]
zkLedgerInput2: Plonkup Input: [48351281068924492262321468896264504833411400898654358688731651776892901623667,30873107671128920979358651041813029837000612435957166159820003367028799279372,1,34949590100076397709405755766291531737705177100855665100823916672972473040272,15856765338934567876274247118180883708295486259209517075734479437976472467496,34765955657041655293816282537274670880107433050433417259985169455278703708800,3195721223432807590315931744774089114582959145720905619494438813130265079564,2,15856765338934567876274247118180883708295486259209517075734479437976472467496,41407070337595132130395268741395832453203845317575224103192549686812917401832,1,0,0,0,0,19889081452670861588114349990778949346404544631803352712004893411981264611445,0,0,5000000]
  E2E ledger circuit, One: prove and verify [✔]
Time taken to compute ledgerCircuit: 39.492 sec
constraints: 208440, zero constraints: 0, variables: 213736
Time taken to compute zkLedgerSetup: 335.433 sec
Time taken to compute zkLedgerProof: 676.194 sec
Time taken to compute zkLedgerProof2: 673.829 sec
zkLedgerInput: Plonkup Input: [0,45657705944472882265086323600425938266507381675436748523027424488304981985054,0,3168427766254734602800027243876685285256750821462392254135519847565200904400,3168427766254734602800027243876685285256750821462392254135519847565200904400,34818080958997748745904040433212409173947150796653521607003496062211592543207,14820233507260226097969677013972906370618206906708611318674207662908566353439,1,37602514700970693461296811620022775074377607632824876101220160483674748373660,3168427766254734602800027243876685285256750821462392254135519847565200904400,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,10000000,5416991460958575053756211119605256293102838005726979983329238545068,2258225731751461549424,50000000,0,0,0,0,0,0,0]
  E2E ledger circuit, Three: prove and verify [✔]
LedgerContractInput JSON
  encodes to JSON matching the golden file [✔]
  decodes from the golden JSON back to the same value (by re-encoding) [✔]

Finished in 2581.9947 seconds

We see 4x gain in setup & proof generation.

@sourabhxyz
sourabhxyz changed the base branch from main to 808-circuit-opt March 18, 2026 07:26
@sourabhxyz sourabhxyz linked an issue Mar 18, 2026 that may be closed by this pull request
@sourabhxyz

Copy link
Copy Markdown
Contributor Author

For batch of 4 txs:

Time taken to compute ledgerCircuit: 95.783 sec
constraints: 388841, zero constraints: 0, variables: 399325
Time taken to compute zkLedgerSetup: 353.149 sec
Time taken to compute zkLedgerProof: 737.670 sec
Time taken to compute zkLedgerProof2: 729.628 sec
zkLedgerInput: Plonkup Input: [0,45657705944472882265086323600425938266507381675436748523027424488304981985054,0,20275691624226864747704249524617689954755290591750816060402035900777646817182,14820233507260226097969677013972906370618206906708611318674207662908566353439,1,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,10000000,5416991460958575053756211119605256293102838005726979983329238545068,2258225731751461549424,50000000,0,0,0,0,0,0,0]
  E2E ledger circuit, Five: prove and verify [✔]

@sourabhxyz

Copy link
Copy Markdown
Contributor Author

For batch of 10 txs:

Time taken to compute ledgerCircuit: 421.458 sec
constraints: 947141, zero constraints: 0, variables: 973189
Time taken to compute zkLedgerSetup: 365.861 sec
Time taken to compute zkLedgerProof: 772.583 sec
Time taken to compute zkLedgerProof2: 771.536 sec
zkLedgerInput: Plonkup Input: [0,45657705944472882265086323600425938266507381675436748523027424488304981985054,0,20275691624226864747704249524617689954755290591750816060402035900777646817182,14820233507260226097969677013972906370618206906708611318674207662908566353439,1,1,46158797386681279449660551146192109801082715412008826514275147611100144249071,0,0,10000000,5416991460958575053756211119605256293102838005726979983329238545068,2258225731751461549424,50000000,0,0,0,0,0,0,0]
  E2E ledger circuit, Five: prove and verify [✔]

@sourabhxyz
sourabhxyz marked this pull request as ready for review April 6, 2026 12:11
@sourabhxyz
sourabhxyz merged commit 0079580 into 808-circuit-opt Apr 6, 2026
@sourabhxyz
sourabhxyz deleted the upon-808-test-pau2-20 branch April 6, 2026 12:17
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.

[symbolic-ledger] bump constraint limit to 2^20

1 participant