Repository navigation
test(zkatsnark): extend integration coverage to match zkatdlog - #2596
Merged
Merged
Conversation
- fabricx Backend skips transient TMSs in PrepareNamespace and InstallPublicParams, as the Fabric chaincode backend does - topology propagates FSC endorsement, namespace policy and own-org settings to extra TMSs, so their merged config does not wipe fsc_endorsement - fzkatsnark SDK also registers the fabtoken token/validator drivers - add TestTokensUpgradeWithAlias / TestLocalTokensUpgradeWithAlias and wait for every node to load the new public parameters Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Add T6-T9, T11-T14 and the fabtoken -> ZKAT-SNARK upgrade scenarios (T17 burn-and-re-issue, T18 in place) to the fabricx ZKAT-SNARK suite, with Makefile targets, CI matrix entries (T14 kept disabled until the boolpolicy audit-info deserializer fix lands) and docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
adecaro
force-pushed
the
zkatsnark/integration
branch
from
October 30, 2026 15:54
40d3e2d to
a467299
Compare
MaliciousTransfer gets a first transaction endorsed and then asks for a second, different token request to be endorsed under the same transaction id. With FSC-based endorsement the endorser already filed a validation record for that id and refuses a second one (unique tx_id), so the attack is stopped at endorsement and never reaches the ledger. The test expected the transaction to be committed and then marked Deleted, which only holds when there are no FSC endorsers. When the network has FSC endorsers, expect the endorsement failure and check that no tokens moved. Networks without endorsers (dlog on Fabric) keep the existing ledger-status checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
… count 2900b2e made TestMaliciousTransactions expect the malicious transfer to be rejected at FSC endorsement whenever the network has endorser nodes. That guard is too broad: the EVM suites (evm, evmfabtoken, evmgw, evmgwfabtoken) also run FSC endorsers, but the EVM endorsement responder keeps no per-tx-id validation record, so the second token request under the same tx id is endorsed, ordered, and marked Deleted by the ledger ("token requests do not match"). As a result evm-t9, evm-fabtoken-t9, evm-gateway-t9 and evm-gateway-fabtoken-t9 regressed with "Expected an error to have occurred. Got: nil" in MaliciousTransferCash. Only the Fabric-family FSC endorsement service (fabric and fabricx backends; fsc/responder.go AppendValidationRecord with a unique tx_id) refuses tx-id reuse at endorsement. Select the endorsement-rejection branch only when the default TMS has FSC endorsement enabled and its backend topology type is exactly "fabric" or "fabricx" (the EVM gateway type is "fabricx-evm" and must not match). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
adecaro
added a commit
that referenced
this pull request
Nov 2, 2026
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of a series of parity PRs against
feature/zkat-snark-driver(#2590, #2591, #2592 and others) that close the gaps between thezkatsnarkdriver andzkatdlog. This PR covers the integration gap.Before this PR, the fabricx ZKAT-SNARK suite (
integration/token/fungible/zkatsnark) ran only T1-T5. The fabtoken -> ZKAT-SNARK upgrade from #2551 was covered only by unit and regression tests. This PR brings the suite in line with the fabricx ZKAT-DLOG suite (integration/token/fungible/dlogx) and adds fabtoken -> ZKAT-SNARK upgrade suites.What changed
Commit 1:
test(integration): support fabtoken upgrade scenarios on fabricx(test plumbing only, no production code)Backend.PrepareNamespaceandBackend.InstallPublicParams(integration/nwo/token/fabricx/factory.go) now return early fortms.Transient, as the Fabric chaincode backend (tcc.go) already does. Without this, the extra TMS fails with "missing orgs", and its public params get installed at bring-up, before the fabtoken phase runs. Unit tests added.fsc_endorsementblock. Unit tests cover endorsement on and off.fzkatsnarkSDK registers the fabtoken token and validator drivers, which the upgrade suites need. This has no effect on pure zkatsnark networks.TestTokensUpgradeWithAlias/TestLocalTokensUpgradeWithAliasinintegration/token/fungible/tests.go. The existingTestTokensUpgrade/TestLocalTokensUpgradeare now thin wrappers that pass"dlog-32bits", so the Fabric update suite works as before.Commit 2:
test(zkatsnark): mirror dlogx scenarios and add fabtoken upgrade suitesintegration/token/fungible/zkatsnark/zkatsnark_test.goadds:newSuite/newUpgradeTestSuite.fabricx.mk: targetsintegration-tests-fabricx-zkatsnark-t6through-t18..github/workflows/tests.yml: enables t6, t7, t8, t9, t11, t12, t13, t17 and t18. t14 is in the matrix but commented out until the boolpolicy audit-info deserializer fix (feat(zkatsnark): honour resource limits, add circuit breaker, fix boolpolicy audit info deserializer #2591) is merged.docs/drivers/zkatsnark.md(test coverage),docs/development/testing.md,docs/development/debug-integration-tests.md.How it was tested
The integration scenarios were NOT run locally, by instruction. CI validates them. Locally, the new specs were only compile-checked.
Commands run (all passing):
Scenarios with dependencies or runtime risk
&boolpolicy.AuditInfoDeserializer{}with a nil inner deserializer). Its CI entry stays commented out until feat(zkatsnark): honour resource limits, add circuit breaker, fix boolpolicy audit info deserializer #2591 merges.Out of scope / follow-ups
TestDLogTokensUpgrade(Pedersen generator regeneration) applies only to DLog, so there is no zkatsnark equivalent.