Skip to content

test(zkatsnark): add regression tests and fix transfer action validation - #2373

Open
neetance wants to merge 2 commits into
LFDT-Panurus:feature/zkat-snark-driverfrom
neetance:test/zkatsnark-regression
Open

neetance wants to merge 2 commits into
LFDT-Panurus:feature/zkat-snark-driverfrom
neetance:test/zkatsnark-regression

Conversation

@neetance

Copy link
Copy Markdown
Contributor

Summary

This PR adds an end-to-end regression test suite for the zkatsnark token driver and resolves key transfer action validation and signature verification requirements:

  1. End-to-End Regression Test Suite (regression_test.go):
    • Tests complete token lifecycle flows (Issue and Transfer) end-to-end using real SNARK provers (SpendProver, OutputProver), circuits, and validators.
    • Verifies single-input and multi-input transfer requests, ensuring ledger state resolution, SNARK proof verification, and signature consumption behave as expected.
  2. Transfer Signature Validation & Consumption (validator_transfer_sig.go):
    • Implemented TransferSignatureValidate to satisfy the common token framework validation contract.
    • Validates that each spend input is signed by its respective owner identity and that signatures are properly consumed from the signature provider (EnsureExhausted).
  3. Input Token State Matching in Transfer Actions:
    • Updated TransferAction to hold and serialize original input OutputDescriptions in InputTokens, ensuring ledger lookup and token key verification succeed during transfer validation.

Testing

All tests pass

 go test ./...
?       github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark  [no test files]
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/circuit  148.514s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/circuit/gadgets  0.043s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/crypto/jubjub    0.121s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/crypto/mimc      0.045s
?       github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/crypto/params    [no test files]
?       github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/driver   [no test files]
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/pp       0.039s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/prover   152.515s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/regression       7.358s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/setup    155.601s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/token    0.044s
ok      github.com/LFDT-Panurus/panurus/x/token/core/zkatsnark/validator        183.331s

Signed-off-by: Ankit Basu <ankitbasu14@gmail.com>
Comment thread x/token/core/zkatsnark/validator/validator_transfer_sig.go
Comment thread x/token/core/zkatsnark/validator/validator_transfer_sig.go
Comment thread x/token/core/zkatsnark/transfer.go Outdated
Comment thread x/token/core/zkatsnark/validator/validator_transfer_sig.go
Comment thread x/token/core/zkatsnark/token/transfer.go
Comment thread x/token/core/zkatsnark/regression/regression_test.go
…fuzz targets

Signed-off-by: Ankit Basu <ankitbasu14@gmail.com>

@Effi-S Effi-S left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@neetance Is zkatsnark is meant to be a first-class driver like zkatdlog?

  • make checks / fmt / lint / license: all loop over GO_MODULES, and x/token/core/zkatsnark isn't in that list.

  • nightly-fuzz.yml: the new entries use pkg: ./x/token/core/zkatsnark/validator and run go test ${pkg} from repo root. That path is a different module, so it won't resolve either. the fuzz targets won't actually run!

So the suite passes locally but is invisible to the CI

@adecaro adecaro added this to the ZKAT Snark Driver milestone Sep 23, 2026
@adecaro adecaro self-assigned this Sep 23, 2026
@adecaro
adecaro self-requested a review September 23, 2026 12:19

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants