fix(framework): count pq_auth_sig in multisign fee and reverify checks
What does this PR do
Fixes three places where PQ multisig (pq_auth_sig) was not accounted for alongside ECDSA signatures, even though the existing permission/weight validation already treats the two as contributing independently to the same threshold:
Manager.consumeMultiSignFeeonly checkedgetSignatureCount() > 1, so PQ-only and hybrid ECDSA+PQ multisig transactions escaped the multisign fee entirely.Manager.isSameSig(used bygetVerifyTxsto skip re-verifying transactions already verified in the pending pool) compared only the ECDSA signature list. SincetxIdhashesraw_dataonly, a block transaction with a substitutedpq_auth_sigbut the sametxIdcould be wrongly markedverified=trueand skip real signature validation inprocessTransaction— a signature-verification bypass.Wallet.getTransactionApprovedListbuilt the approved list from ECDSA signatures only, missing thepq_auth_sigbranch already present in its siblingTransactionUtil.getTransactionSignWeight, so PQ signers never showed up in the approval status response.
Why required
These are correctness/security gaps introduced when PQ multisig support (pq_auth_sig) was added: the fee, re-verification optimization, and approval-status reporting paths weren't updated to match the combined ECDSA+PQ signature semantics used everywhere else (e.g. TransactionCapsule.validateSignature, TransactionUtil.getTransactionSignWeight).
Tests
ManagerTest:consumeMultiSignFeePqOnlyCharged,consumeMultiSignFeeHybridCharged,consumeMultiSignFeeSingleEcdsaNotCharged,consumeMultiSignFeeSinglePqNotCharged,getVerifyTxsPqAuthSigContentDifferRequiresReverify,getVerifyTxsPqAuthSigCountDifferRequiresReverify,getVerifyTxsPqAuthSigIdenticalSkipsReverifyWalletTest:testApprovedListPqOnlySigner,testApprovedListHybridEcdsaAndPq,testApprovedListPqNotActivated- All three suites pass locally (
ManagerTest42/42,WalletTest51/51 with 1 pre-existing unrelated skip,ProposalUtilTest5/5).
Follow up
None.
Extra details
Also wraps two pre-existing >100-character lines in ProposalUtilTest (unrelated to this fix) to keep checkstyleTest passing.
Summary by cubic
Count pq_auth_sig with ECDSA for multisign fee, re-verify checks, and approved lists. Fixes a verification bypass and makes PQ-only and hybrid multisig work as expected.
-
Bug Fixes
- Multi-sign fee: charge when total signatures (ECDSA + PQ) > 1 in
Manager.consumeMultiSignFee. - Re-verify:
Manager.isSameSigalso checks PQ signature count and content to avoid skipping verification whentxIdmatches butpq_auth_sigdiffers. - Approved list:
Wallet.getTransactionApprovedListmerges ECDSA and PQ signers and rejectspq_auth_sigwhen no PQ scheme is activated.
- Multi-sign fee: charge when total signatures (ECDSA + PQ) > 1 in
-
Refactors
- Tests: made
Manager.isSameSig@VisibleForTestingand added focused unit tests; consolidatedgetVerifyTxsPQ cases into a helper and hardened the inactive-PQ test by disabling all PQ schemes and asserting the global gate.
- Tests: made
Summary by CodeRabbit
-
New Features
- Added support for post-quantum cryptographic signatures in transactions alongside traditional signature types.
-
Bug Fixes
- Fixed multi-signature fee calculation to properly account for both cryptographic signature types.
- Improved transaction signature matching for mixed-signature scenarios.
-
Tests
- Added comprehensive test coverage for post-quantum signature validation, including single post-quantum, hybrid, and activation verification scenarios.