patches 0001/0003/0004 regenerated from the production tree over the same file sets (section 4(b) notices); measured: a build from this recipe reproduces the fleet's consensus jars class by class

This commit is contained in:
Aere Network 2026-09-10 22:08:27 +03:00
parent 5aac751be5
commit bc8dc80946
4 changed files with 310 additions and 2797 deletions

View File

@ -156,7 +156,7 @@ measured heights of each run. **Revision note, 2026-09-05:** the anchor patch an
below were updated for the hybrid certificate and the interval schedule; the from-genesis import proof
has NOT yet been repeated against this revision (the last measured run is the one above, on the
previous revision). What is measured for this revision is that the same code follows the live tip on
the network's reading nodes, and validates every hybrid anchor there, since 2026-09-05.
the network's reading nodes, and validates every hybrid anchor there, since 2026-09-05. **Revision note, 2026-09-10:** patches `0001`, `0003` and `0004` were regenerated from the production tree over the same file sets (the source files now carry the Apache-2.0 section 4(b) modification notices that production carries; `0003` keeps its 169 files). Measured the same day: a build from this recipe reproduces the fleet's three consensus jars class by class, and `LondonFeeMarket` and the precompile classes byte for byte. What the recipe still does not ship is the fleet's parallel block processor (a separate package and one hunk in `MainnetProtocolSpecs`), which does not change consensus; it is listed by the comparison, not hidden.
---

View File

@ -1,92 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aere Network <node@aere.network>
Date: Mon, 20 Jul 2026 10:05:53 +0300
Date: Thu, 10 Sep 2026 21:47:55 +0300
Subject: [PATCH] Aere Network: post-quantum signature verification precompiles
(mainnet 0x0ae1-0x0ae5)
Adds five native precompiled contracts exposing post-quantum signature
verification to the EVM, and registers them in populateForFutureEIPs so they
activate by fork timestamp rather than at genesis.
0x0ae1 Falcon-512 verify NIST Falcon round 3
0x0ae2 Falcon-1024 verify NIST Falcon round 3
0x0ae3 ML-DSA-44 verify FIPS 204
0x0ae4 SLH-DSA-SHA2-128s verify FIPS 205
0x0ae5 SHAKE256 XOF FIPS 202
Live on Aere Network chain 2800 from block 9,189,161.
Scope: these precompiles verify post-quantum signatures inside the EVM. They
do not change consensus. Block sealing and validator identity on chain 2800
remain classical secp256k1 ECDSA QBFT.
populateForFutureEIPs is additionally repointed from populateForCancun to
populateForOsaka, so the fork carries the full Osaka precompile set.
No build file change is required: bcprov-jdk18on is already exposed to the evm
module as an api dependency of crypto:algorithms, and jakarta.validation-api is
a global subproject dependency.
Modified upstream files. Two files touched by this patch are modified copies
of Hyperledger Besu sources, not new work by Aere Network:
datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java
Aere Network changed both, against upstream commit
d2032017bb3b8cb215a97303980a1e4a643f7180. Both keep their original
"Copyright contributors to Hyperledger Besu" headers unchanged, which is what
Apache License 2.0 section 4(c) requires, and this patch adds to each a
separate "Modifications Copyright" block naming exactly what was changed. That
in-file block is the notice required by Apache License 2.0 section 4(b). It
travels inside the diff, so a tree with this patch applied carries the notice
whether you used git am or git apply. Every other file this patch touches is
new and was written by Aere Network, and each carries its own Apache-2.0
header.
---
.../hyperledger/besu/datatypes/Address.java | 30 ++++++
.../evm/precompile/AereFalconSupport.java | 94 +++++++++++++++++++
.../Falcon1024PrecompiledContract.java | 62 ++++++++++++
.../Falcon512PrecompiledContract.java | 62 ++++++++++++
.../MLDSA44PrecompiledContract.java | 84 +++++++++++++++++
.../MainnetPrecompiledContracts.java | 25 ++++-
.../SHAKE256PrecompiledContract.java | 93 ++++++++++++++++++
.../SLHDSA128sPrecompiledContract.java | 84 +++++++++++++++++
8 files changed, 533 insertions(+), 1 deletion(-)
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/AereFalconSupport.java
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon1024PrecompiledContract.java
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon512PrecompiledContract.java
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/MLDSA44PrecompiledContract.java
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/SHAKE256PrecompiledContract.java
create mode 100644 evm/src/main/java/org/hyperledger/besu/evm/precompile/SLHDSA128sPrecompiledContract.java
Regenerated 2026-09-10 from the production tree (overlay applied) over the same file set.
diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
index 950cd59e3..51397dc38 100644
index 950cd59e3..0f486dfcf 100644
--- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
+++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
@@ -12,6 +12,21 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
+
+/*
+ * Modifications Copyright 2026 Aere Network.
+ *
+ * This file was changed by Aere Network: five post-quantum precompile address
+ * constants were added (AERE_FALCON512, AERE_FALCON1024, AERE_MLDSA44,
+ * AERE_SLHDSA128S, AERE_SHAKE256, at 0x0ae1 through 0x0ae5). Nothing upstream
+ * was removed or rewritten.
+ *
+ * The unmodified original is Hyperledger Besu commit
+ * d2032017bb3b8cb215a97303980a1e4a643f7180. The upstream copyright header above is
+ * left exactly as it was found.
+ *
+ * This notice is required by Apache License 2.0 section 4(b).
+ */
package org.hyperledger.besu.datatypes;
import static com.google.common.base.Preconditions.checkArgument;
@@ -91,6 +106,21 @@ public class Address extends BytesHolder {
@@ -91,6 +91,21 @@ public class Address extends BytesHolder {
/** Precompile address for P256_VERIFY. */
public static final Address P256_VERIFY = Address.precompiled(0x0100);
@ -110,12 +33,12 @@ index 950cd59e3..51397dc38 100644
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AereFalconSupport.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AereFalconSupport.java
new file mode 100644
index 000000000..011fc2164
index 000000000..1dbb2b85c
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AereFalconSupport.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
@ -210,12 +133,12 @@ index 000000000..011fc2164
+}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon1024PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon1024PrecompiledContract.java
new file mode 100644
index 000000000..e383b1f8f
index 000000000..80aca574d
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon1024PrecompiledContract.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
@ -278,12 +201,12 @@ index 000000000..e383b1f8f
+}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon512PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon512PrecompiledContract.java
new file mode 100644
index 000000000..8c0a07ee6
index 000000000..5df074ceb
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/Falcon512PrecompiledContract.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
@ -346,12 +269,12 @@ index 000000000..8c0a07ee6
+}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MLDSA44PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MLDSA44PrecompiledContract.java
new file mode 100644
index 000000000..8c41a2fb1
index 000000000..f25be641f
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MLDSA44PrecompiledContract.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
@ -435,31 +358,10 @@ index 000000000..8c41a2fb1
+ }
+}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java
index 28d84abf1..d75afaf57 100644
index 28d84abf1..43d9fb73a 100644
--- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/MainnetPrecompiledContracts.java
@@ -12,6 +12,20 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
+
+/*
+ * Modifications Copyright 2026 Aere Network.
+ *
+ * This file was changed by Aere Network: populateForFutureEIPs was repointed
+ * from populateForCancun to populateForOsaka, and five post-quantum precompiles
+ * were registered in it (0x0ae1 through 0x0ae5). Nothing upstream was removed.
+ *
+ * The unmodified original is Hyperledger Besu commit
+ * d2032017bb3b8cb215a97303980a1e4a643f7180. The upstream copyright header above is
+ * left exactly as it was found.
+ *
+ * This notice is required by Apache License 2.0 section 4(b).
+ */
package org.hyperledger.besu.evm.precompile;
import static org.hyperledger.besu.datatypes.Address.P256_VERIFY;
@@ -226,6 +240,15 @@ public interface MainnetPrecompiledContracts {
@@ -226,6 +226,15 @@ public interface MainnetPrecompiledContracts {
*/
static void populateForFutureEIPs(
final PrecompileContractRegistry registry, final GasCalculator gasCalculator) {
@ -468,7 +370,7 @@ index 28d84abf1..d75afaf57 100644
+ // Activated on a running chain via genesis config "futureEipsTime"; no re-genesis needed.
+ populateForOsaka(registry, gasCalculator);
+
+ // Native post-quantum precompiles (Bouncy Castle BCPQC verifiers).
+ // Native post-quantum precompiles (audited Bouncy Castle BCPQC verifiers).
+ registry.put(Address.AERE_FALCON512, new Falcon512PrecompiledContract(gasCalculator));
+ registry.put(Address.AERE_FALCON1024, new Falcon1024PrecompiledContract(gasCalculator));
+ registry.put(Address.AERE_MLDSA44, new MLDSA44PrecompiledContract(gasCalculator));
@ -478,12 +380,12 @@ index 28d84abf1..d75afaf57 100644
}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHAKE256PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHAKE256PrecompiledContract.java
new file mode 100644
index 000000000..fe0f0cf32
index 000000000..0c20e6a66
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHAKE256PrecompiledContract.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
@ -512,7 +414,7 @@ index 000000000..fe0f0cf32
+ * Output: exactly {@code outLen} bytes of SHAKE256(data).
+ *
+ * <p>SHAKE256 is the hashing bottleneck inside Falcon, ML-DSA and SLH-DSA; exposing it natively lets
+ * on-chain PQC flows offload the hot path to Bouncy Castle rather than hand-rolled Solidity.
+ * on-chain PQC flows offload the hot path to audited Bouncy Castle rather than hand-rolled Solidity.
+ */
+public class SHAKE256PrecompiledContract extends AbstractPrecompiledContract {
+
@ -577,12 +479,12 @@ index 000000000..fe0f0cf32
+}
diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/SLHDSA128sPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SLHDSA128sPrecompiledContract.java
new file mode 100644
index 000000000..5e7527aab
index 000000000..2666602f4
--- /dev/null
+++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SLHDSA128sPrecompiledContract.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright contributors to the Aere Network.
+ * Copyright contributors to the AERE Network.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aere Network <node@aere.network>
Date: Sat, 05 Sep 2026 09:53:25 +0000
Date: Thu, 10 Sep 2026 21:47:56 +0300
Subject: [PATCH] Aere Network: base-fee floor for chain 2800 (production form)
Apache License 2.0, section 4(b): the files this patch modifies are the work of
Hyperledger Besu and carry its copyright notice; the modifications are by
contributors to the Aere Network under the same licence.
Regenerated 2026-09-10 from the production tree (overlay applied) over the same file set.
Regenerated 2026-09-05 from the production tree, so that the public recipe
reproduces the live binary class for class: the floor and its fork height are
read from the system properties aere.basefee.floor.forkBlock and
aere.basefee.floor.value (or the AERE_BASEFEE_FLOOR_* environment variables),
absent = disarmed, exactly as RUN-A-NODE.md tells an operator to set them.
The previous revision of this patch hard-coded both as constants, so the
operator's property was dead on a node built from the public recipe (found
2026-09-05 by comparing the fleet's jars with the public build class by class).
---
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarket.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarket.java
index 0ee4f74..72913d4 100644
index 0ee4f7409..558076166 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarket.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarket.java
@@ -1,136 +1,252 @@
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
+ *
+ * Modifications Copyright contributors to the Aere Network.
+ *
+ * This file was modified by contributors to the Aere Network, as required by section 4(b) of the
+ * Apache License 2.0. The copyright header above is the upstream one and is left exactly as it was
+ * found, as section 4(c) requires. The change is the chain 2800 base-fee floor below, armed only
+ * by the aere.basefee.floor.* properties; with them absent this file behaves exactly as upstream.
*/
package org.hyperledger.besu.ethereum.mainnet.feemarket;
import org.hyperledger.besu.config.GenesisConfig;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.feemarket.TransactionPriceCalculator;
import java.util.Optional;
import org.apache.tuweni.units.bigints.UInt256s;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LondonFeeMarket implements BaseFeeMarket {
private static final Logger LOG = LoggerFactory.getLogger(LondonFeeMarket.class);
static final Wei DEFAULT_BASEFEE_INITIAL_VALUE = GenesisConfig.BASEFEE_AT_GENESIS_DEFAULT_VALUE;
static final long DEFAULT_BASEFEE_MAX_CHANGE_DENOMINATOR = 8L;
static final long DEFAULT_SLACK_COEFFICIENT = 2L;
@@ -34,11 +34,36 @@ public class LondonFeeMarket implements BaseFeeMarket {
private static final Wei DEFAULT_BASEFEE_FLOOR = Wei.of(7L);
@ -97,8 +46,7 @@ index 0ee4f74..72913d4 100644
LondonFeeMarket(final long londonForkBlockNumber, final Optional<Wei> baseFeePerGasOverride) {
this(TransactionPriceCalculator.eip1559(), londonForkBlockNumber, baseFeePerGasOverride);
}
LondonFeeMarket(
@@ -47,10 +72,94 @@ public class LondonFeeMarket implements BaseFeeMarket {
final TransactionPriceCalculator txPriceCalculator,
final long londonForkBlockNumber,
final Optional<Wei> baseFeePerGasOverride) {
@ -193,28 +141,7 @@ index 0ee4f74..72913d4 100644
}
@Override
public long getBasefeeMaxChangeDenominator() {
return DEFAULT_BASEFEE_MAX_CHANGE_DENOMINATOR;
}
@Override
public Wei getInitialBasefee() {
return baseFeeInitialValue;
}
@Override
public long getSlackCoefficient() {
return DEFAULT_SLACK_COEFFICIENT;
}
@Override
public TransactionPriceCalculator getTransactionPriceCalculator() {
return txPriceCalculator;
}
@Override
public boolean satisfiesFloorTxFee(final Transaction txn) {
// ensure effective baseFee is at least above floor
@@ -79,7 +188,7 @@ public class LondonFeeMarket implements BaseFeeMarket {
return txn.getGasPrice()
.map(Optional::of)
.orElse(txn.getMaxFeePerGas())
@ -223,10 +150,7 @@ index 0ee4f74..72913d4 100644
.isPresent();
}
@Override
public Wei computeBaseFee(
final long blockNumber,
final Wei parentBaseFee,
@@ -90,13 +199,13 @@ public class LondonFeeMarket implements BaseFeeMarket {
final long parentBlockGasUsed,
final long targetGasUsed) {
if (londonForkBlockNumber == blockNumber) {
@ -242,20 +166,7 @@ index 0ee4f74..72913d4 100644
} else if (parentBlockGasUsed > targetGasUsed) {
gasDelta = parentBlockGasUsed - targetGasUsed;
final long denominator = getBasefeeMaxChangeDenominator();
feeDelta =
UInt256s.max(
parentBaseFee.multiply(gasDelta).divide(targetGasUsed).divide(denominator), Wei.ONE);
baseFee = parentBaseFee.add(feeDelta);
} else {
gasDelta = targetGasUsed - parentBlockGasUsed;
final long denominator = getBasefeeMaxChangeDenominator();
feeDelta = parentBaseFee.multiply(gasDelta).divide(targetGasUsed).divide(denominator);
baseFee = parentBaseFee.subtract(feeDelta);
}
LOG.trace(
"block #{} parentBaseFee: {} parentGasUsed: {} parentGasTarget: {} baseFee: {}",
blockNumber,
parentBaseFee,
@@ -117,7 +226,7 @@ public class LondonFeeMarket implements BaseFeeMarket {
parentBlockGasUsed,
targetGasUsed,
baseFee);
@ -264,16 +175,3 @@ index 0ee4f74..72913d4 100644
}
@Override
public ValidationMode baseFeeValidationMode(final long blockNumber) {
return londonForkBlockNumber == blockNumber ? ValidationMode.INITIAL : ValidationMode.ONGOING;
}
@Override
public ValidationMode gasLimitValidationMode(final long blockNumber) {
return londonForkBlockNumber == blockNumber ? ValidationMode.INITIAL : ValidationMode.ONGOING;
}
@Override
public boolean isBeforeForkBlock(final long blockNumber) {
return londonForkBlockNumber > blockNumber;
}