Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7f36a3b
feat(crypto): add Falcon-512 post-quantum signature support
Federico2014 May 10, 2026
4b45b4d
refactor(pqc): harden ALLOW_FN_DSA_512 proposal validation and PQ-onl…
Federico2014 May 10, 2026
c32015b
fix(crypto): address PQ review feedback
Federico2014 May 13, 2026
f8a0277
feat(net): support PQ signatures in HelloMessage
Federico2014 May 14, 2026
7c9715f
feat(consensus): support PQ signatures in PBFT messages
Federico2014 May 14, 2026
fe78125
feat(consensus): aggregate PQ commit signatures and verify on sync
Federico2014 May 14, 2026
2c4db1f
fix(consensus): count pbft quorum by unique signer address
Federico2014 May 14, 2026
26e37e3
fix: address PQ PR review feedback
Federico2014 May 14, 2026
6b7c139
feat(actuator): include pq signatures in getTransactionSignWeight
Federico2014 May 15, 2026
e32012b
style(chainbase): use Set/HashSet imports instead of FQCN
Little-Peony May 18, 2026
2e8a236
refactor(witness): bundle PQ priv/pub key lists into PqKeypair
Little-Peony May 18, 2026
38af8ea
refactor(actuator): gate PQ verify on isAnyPqSchemeAllowed in getTran…
Little-Peony May 18, 2026
bd79efc
refactor(block): gate PQ signature recognition behind isAnyPqSchemeAl…
Little-Peony May 18, 2026
5b946e9
fix move keypair
Little-Peony May 20, 2026
6f5054e
fix hasLegacy hasPq
Little-Peony May 20, 2026
edad7b3
fix build
Little-Peony May 20, 2026
befadeb
Merge pull request #28 from Little-Peony/pqc-falcon512
Federico2014 May 20, 2026
27f3ddc
revert(pbft): drop pq signature additions
Federico2014 May 20, 2026
8b5f3c1
fix review
Little-Peony May 20, 2026
1e71f42
Merge branch 'pqc-falcon512' of https://github.com/Federico2014/java-…
Little-Peony May 20, 2026
cc48428
fix
Little-Peony May 21, 2026
6084635
Merge pull request #31 from Little-Peony/pqc-falcon512
Federico2014 May 21, 2026
33f8e30
refactor(crypto): require explicit pq scheme tag
Federico2014 May 22, 2026
4ab20e2
feat(crypto): add ML-DSA-44 signature scheme
Federico2014 May 22, 2026
6285929
test(crypto): cover ml-dsa-44 in pq test programs
Federico2014 May 22, 2026
d43838c
feat(vm): add ml-dsa-44 precompiles 0x19/0x1a/0x1b
Federico2014 May 22, 2026
d30f94c
test(crypto): add ml-dsa-44 kat regression vectors
Federico2014 May 22, 2026
1f821af
fix(block): tighten hasWitnessSignature gate
Federico2014 May 23, 2026
3b53c37
feat(crypto): support pq witness signatures
Federico2014 May 23, 2026
c16cad8
refactor(crypto): express pq signature length as a range
Federico2014 May 24, 2026
ac3348f
feat(framework): pq witness + unify pq multi-sign
Federico2014 May 24, 2026
8de0873
fix: address pq signature review feedback
Federico2014 May 24, 2026
07aaf65
fix(vm): cancel pending pq batch verify futures on timeout
Federico2014 May 24, 2026
54235ac
fix(vm): cap precompile dynamic-array allocations
Federico2014 May 24, 2026
96c386f
fix(framework): split pq witness address and null-guard lookups
Federico2014 May 24, 2026
4a64aa1
feat(framework): accept priv-only key for pq witness ml-dsa-44
Federico2014 May 24, 2026
ae3df1b
refactor(framework): wrap pq miner identity and add 0x12 verifier
Federico2014 May 24, 2026
1d6068d
refactor(framework): wrap pq miner identity and add 0x12 verifier
Federico2014 May 24, 2026
fe995e9
fix(block): drop pq gate in hasWitnessSignature
Federico2014 May 25, 2026
e404357
Merge branch 'pqc-falcon512' of https://github.com/Federico2014/java-…
Little-Peony May 25, 2026
b8f20c3
feat(metrics): add tx_fetch_latency histogram
Little-Peony May 25, 2026
773c912
fix merge
Little-Peony May 25, 2026
e12b47f
fix merge
Little-Peony May 25, 2026
650d3d8
fix merge
Little-Peony May 25, 2026
72ef8ca
fix(metrics): observe tx_fetch_latency in processMessage, not handleT…
Little-Peony May 26, 2026
c546dd5
revert some
Little-Peony May 26, 2026
9cb41b9
add comment
Little-Peony May 26, 2026
b057cd3
Merge pull request #32 from Little-Peony/pqc-falcon512
Federico2014 May 26, 2026
ea3dc85
feature: add fastforward hello message latency metric
Little-Peony May 26, 2026
4c5720d
Merge pull request #33 from Little-Peony/pqc-falcon512
Federico2014 May 26, 2026
c1d7722
test(crypto): add ml-dsa-44 support to pqc demo programs
Federico2014 May 27, 2026
c437db7
fix(crypto): correct fn-dsa signature bounds
Federico2014 May 29, 2026
0c56c62
fix(framework): use locale for pq tps key
Federico2014 May 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ private boolean checkPermission(Permission permission) throws ContractValidateEx
long weightSum = 0;
List<ByteString> addressList = permission.getKeysList()
.stream()
.map(x -> x.getAddress())
.map(Key::getAddress)
.distinct()
.collect(toList());
if (addressList.size() != permission.getKeysList().size()) {
throw new ContractValidateException(
"address should be distinct in permission " + permission.getType());
}

for (Key key : permission.getKeysList()) {
if (!DecodeUtil.addressValid(key.getAddress().toByteArray())) {
throw new ContractValidateException("key is not a validate address");
Expand Down Expand Up @@ -237,4 +238,5 @@ public ByteString getOwnerAddress() throws InvalidProtocolBufferException {
public long calcFee() {
return chainBaseManager.getDynamicPropertiesStore().getUpdateAccountPermissionFee();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ private void create()

long thisTxCPULimitInUs = calculateCpuLimitInUs(isConstantCall,
rootRepository.getDynamicPropertiesStore().getMaxCpuTimeOfOneTx(),
getCpuLimitInUsRatio(), CommonParameter.getInstance().getConstantCallTimeoutMs());
getCpuLimitInUsRatio(),
CommonParameter.getInstance().getConstantCallTimeoutMs());
long vmStartInUs = System.nanoTime() / VMConstant.ONE_THOUSAND;
long vmShouldEndInUs = vmStartInUs + thisTxCPULimitInUs;
ProgramInvoke programInvoke = ProgramInvokeFactory
Expand Down
37 changes: 36 additions & 1 deletion actuator/src/main/java/org/tron/core/utils/ProposalUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,38 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore,
}
break;
}
case ALLOW_FN_DSA_512: {
if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_8_2)) {
throw new ContractValidateException(
"Bad chain parameter id [ALLOW_FN_DSA_512]");
}
if (value != 0 && value != 1) {
throw new ContractValidateException(
"This value[ALLOW_FN_DSA_512] is only allowed to be 0 or 1");
}
if (dynamicPropertiesStore.getAllowFnDsa512() == value) {
throw new ContractValidateException(
"[ALLOW_FN_DSA_512] has been set to " + value
+ ", no need to propose again");
}
break;
}
case ALLOW_ML_DSA_44: {
if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_8_2)) {
throw new ContractValidateException(
"Bad chain parameter id [ALLOW_ML_DSA_44]");
}
if (value != 0 && value != 1) {
throw new ContractValidateException(
"This value[ALLOW_ML_DSA_44] is only allowed to be 0 or 1");
}
if (dynamicPropertiesStore.getAllowMlDsa44() == value) {
throw new ContractValidateException(
"[ALLOW_ML_DSA_44] has been set to " + value
+ ", no need to propose again");
}
break;
}
default:
break;
}
Expand Down Expand Up @@ -1029,7 +1061,10 @@ public enum ProposalType { // current value, value range
ALLOW_TVM_PRAGUE(95), // 0, 1
ALLOW_TVM_OSAKA(96), // 0, 1
ALLOW_HARDEN_RESOURCE_CALCULATION(97), // 0, 1
ALLOW_HARDEN_EXCHANGE_CALCULATION(98); // 0, 1
ALLOW_HARDEN_EXCHANGE_CALCULATION(98), // 0, 1
ALLOW_FN_DSA_512(99), // 0, 1
ALLOW_ML_DSA_44(100); // 0, 1

private long code;

ProposalType(long code) {
Expand Down
25 changes: 20 additions & 5 deletions actuator/src/main/java/org/tron/core/utils/TransactionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.tron.api.GrpcAPI.TransactionExtention;
import org.tron.api.GrpcAPI.TransactionSignWeight;
import org.tron.api.GrpcAPI.TransactionSignWeight.Result;
import org.tron.common.math.StrictMathWrapper;
import org.tron.common.parameter.CommonParameter;
import org.tron.common.utils.Sha256Hash;
import org.tron.core.ChainBaseManager;
Expand Down Expand Up @@ -221,14 +222,28 @@ public TransactionSignWeight getTransactionSignWeight(Transaction trx) {
}
}
tswBuilder.setPermission(permission);
if (trx.getSignatureCount() > 0) {
List<ByteString> approveList = new ArrayList<>();
long currentWeight = TransactionCapsule.checkWeight(permission, trx.getSignatureList(),
long currentWeight = 0L;
List<ByteString> approveList = new ArrayList<>();
if (trx.getSignatureCount() > 0 ) {
currentWeight = TransactionCapsule.checkWeight(permission, trx.getSignatureList(),
Sha256Hash.hash(CommonParameter.getInstance()
.isECKeyCryptoEngine(), trx.getRawData().toByteArray()), approveList);
tswBuilder.addAllApprovedList(approveList);
tswBuilder.setCurrentWeight(currentWeight);
}
if (chainBaseManager.getDynamicPropertiesStore().isAnyPqSchemeAllowed()
&& trx.getPqAuthSigCount() > 0) {
try {
long pqWeight = TransactionCapsule.validatePQSignatureGetWeight(trx, permission,
chainBaseManager.getDynamicPropertiesStore(), approveList);
// sum all signature weight
currentWeight = StrictMathWrapper.addExact(currentWeight,pqWeight);
} catch (ArithmeticException e) {
throw new PermissionException("weight overflow");
}
}

tswBuilder.addAllApprovedList(approveList);
tswBuilder.setCurrentWeight(currentWeight);

if (tswBuilder.getCurrentWeight() >= permission.getThreshold()) {
resultBuilder.setCode(Result.response_code.ENOUGH_PERMISSION);
} else {
Expand Down
Loading
Loading