Pqc falcon512#31
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| int signatureCount = trx.getInstance().getSignatureCount(); | ||
| long sigOverhead = signatureCount * PER_SIGN_LENGTH; | ||
| if (trx.getInstance().getPqAuthSigCount() > 0) { | ||
| if (dynamicPropertiesStore.isAnyPqSchemeAllowed() && trx.getInstance().getPqAuthSigCount() > 0) { |
There was a problem hiding this comment.
这里 dynamicPropertiesStore.isAnyPqSchemeAllowed() 应该去掉
| } else { //transfer from shielded address | ||
| if (this.transaction.getSignatureCount() > 0 | ||
| || this.transaction.getPqAuthSigCount() > 0) { | ||
| || (dynamicPropertiesStore.isAnyPqSchemeAllowed() && this.transaction.getPqAuthSigCount() > 0)) { |
There was a problem hiding this comment.
dynamicPropertiesStore.isAnyPqSchemeAllowed() 去掉
| return true; | ||
| } | ||
| } | ||
| return false; |
There was a problem hiding this comment.
这里是否允许某个PQ 方案不应该是看提案是否开启了么
| if (getDynamicPropertiesStore().isAnyPqSchemeAllowed() && | ||
| miner.getType() != Param.MinerType.ECDSA) { | ||
| signBlockCapsuleWithPQ(blockCapsule, miner); | ||
| } else { |
There was a problem hiding this comment.
这里也不应该用else, 若是 pq 方案不允许,minerType 为PQ, 走ecdsa 签名就有问题。
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details
Summary by cubic
Enable post‑quantum signatures (Falcon‑512) across transaction validation, bandwidth accounting, and block production, with activation controlled by dynamic properties and a registry-driven scheme list. Simplifies miner config by using
Param.Miner.pqSchemeto select PQ signing and falling back to ECDSA when unset.DynamicPropertiesStore.isAnyPqSchemeAllowed()now iteratesPQSchemeRegistry.registeredSchemes()to detect activated schemes.BandwidthProcessoralways addsPQAuthSigbytes to signature overhead, regardless of whether PQ is enabled.pqScheme, sign with PQ keys; otherwise sign with ECDSA. Throws clear errors when the scheme is unregistered or not allowed.Written for commit cc48428. Summary will update on new commits. Review in cubic