diff --git a/build.gradle b/build.gradle
index 8a005a4338f..f96be58e959 100644
--- a/build.gradle
+++ b/build.gradle
@@ -117,12 +117,13 @@ allprojects {
repositories {
maven {
- name = "GitHubPackages"
- url = uri("https://maven.pkg.github.com/lacchain/liboqs-java/")
+ url 'https://maven.pkg.github.com/lacchain/liboqs-java'
+ content { includeGroupByRegex('org\\.openquantumsafe(\\..*)?') }
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
+ }
maven {
url 'https://hyperledger.jfrog.io/hyperledger/besu-maven'
content { includeGroupByRegex('org\\.hyperledger\\..*') }
@@ -739,8 +740,6 @@ task testDocker {
}
task dockerUpload {
- dependsOn distDocker
- def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}"
def imageName = "ghcr.io/lacchain/besu"
def azureImageName = "hyperledger.azurecr.io/besu"
def image = "${imageName}:${dockerBuildVersion}"
@@ -750,6 +749,10 @@ task dockerUpload {
additionalTags.add('develop')
}
+ if (!isInterimBuild(dockerBuildVersion)) {
+ additionalTags.add(dockerBuildVersion.split(/\./)[0..1].join('.'))
+ }
+
doLast {
for (def variant in dockerVariants) {
def variantImage = "${image}-${variant}"
diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
index 8dde977b4dc..6a8a3568a4a 100644
--- a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
+++ b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
@@ -368,6 +368,9 @@ public OptionalLong getThanosBlockNumber() {
@Override
public OptionalLong getLacchainPostQuantumBlockNumber() {
return getOptionalLong("lacchainpqblock");
+ }
+
+ @Override
public OptionalLong getMagnetoBlockNumber() {
return getOptionalLong("magnetoblock");
}
diff --git a/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java
index affb9ecae40..3b7135d56de 100644
--- a/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java
+++ b/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java
@@ -306,6 +306,8 @@ public OptionalLong getThanosBlockNumber() {
public OptionalLong getLacchainPostQuantumBlockNumber() {
return lacchainPostQuantumBlockNumber;
}
+
+ @Override
public OptionalLong getMagnetoBlockNumber() {
return magnetoBlockNumber;
}
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 8862d9461e2..c68058e9796 100644
--- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
+++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/Address.java
@@ -70,6 +70,8 @@ public class Address extends DelegatingBytes {
public static final Address BLS12_MAP_FP_TO_G1 = Address.precompiled(0x11);
/** The constant BLS12_MAP_FP2_TO_G2. */
public static final Address BLS12_MAP_FP2_TO_G2 = Address.precompiled(0x12);
+ /** Constant for Precompiled Falcon verification signature. */
+ public static final Address LACCHAIN_FALCON = Address.precompiled(0x13);
/** The constant KZG_POINT_EVAL. */
public static final Address KZG_POINT_EVAL = Address.precompiled(0x14);
/** The constant ZERO. */
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Address.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Address.java
deleted file mode 100644
index 7cda9e04a68..00000000000
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Address.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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
- */
-package org.hyperledger.besu.ethereum.core;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import org.hyperledger.besu.crypto.SECP256K1.PublicKey;
-import org.hyperledger.besu.ethereum.rlp.RLP;
-import org.hyperledger.besu.ethereum.rlp.RLPException;
-import org.hyperledger.besu.ethereum.rlp.RLPInput;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import org.apache.tuweni.bytes.Bytes;
-import org.apache.tuweni.bytes.DelegatingBytes;
-
-/** A 160-bits account address. */
-public class Address extends DelegatingBytes implements org.hyperledger.besu.plugin.data.Address {
-
- public static final int SIZE = 20;
-
- /** Specific addresses of the "precompiled" contracts. */
- public static final Address ECREC = Address.precompiled(0x01);
-
- public static final Address SHA256 = Address.precompiled(0x02);
- public static final Address RIPEMD160 = Address.precompiled(0x03);
- public static final Address ID = Address.precompiled(0x04);
- public static final Address MODEXP = Address.precompiled(0x05);
- public static final Address ALTBN128_ADD = Address.precompiled(0x06);
- public static final Address ALTBN128_MUL = Address.precompiled(0x07);
- public static final Address ALTBN128_PAIRING = Address.precompiled(0x08);
- public static final Address BLAKE2B_F_COMPRESSION = Address.precompiled(0x09);
- public static final Address BLS12_G1ADD = Address.precompiled(0xA);
- public static final Address BLS12_G1MUL = Address.precompiled(0xB);
- public static final Address BLS12_G1MULTIEXP = Address.precompiled(0xC);
- public static final Address BLS12_G2ADD = Address.precompiled(0xD);
- public static final Address BLS12_G2MUL = Address.precompiled(0xE);
- public static final Address BLS12_G2MULTIEXP = Address.precompiled(0xF);
- public static final Address BLS12_PAIRING = Address.precompiled(0x10);
- public static final Address BLS12_MAP_FP_TO_G1 = Address.precompiled(0x11);
- public static final Address BLS12_MAP_FP2_TO_G2 = Address.precompiled(0x12);
- public static final Address LACCHAIN_FALCON = Address.precompiled(0x13);
-
- // Last address that can be generated for a pre-compiled contract
- public static final Integer PRIVACY = Byte.MAX_VALUE - 1;
- public static final Address DEFAULT_PRIVACY = Address.precompiled(PRIVACY);
- public static final Address ONCHAIN_PRIVACY = Address.precompiled(PRIVACY - 1);
-
- // Onchain privacy management contracts (injected in private state)
- public static final Address ONCHAIN_PRIVACY_PROXY = Address.precompiled(PRIVACY - 2);
- public static final Address DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT = Address.precompiled(PRIVACY - 3);
-
- public static final Address ZERO = Address.fromHexString("0x0");
-
- protected Address(final Bytes bytes) {
- super(bytes);
- }
-
- public static Address wrap(final Bytes value) {
- checkArgument(
- value.size() == SIZE,
- "An account address must be %s bytes long, got %s",
- SIZE,
- value.size());
- return new Address(value);
- }
-
- /**
- * Creates an address from the given RLP-encoded input.
- *
- * @param input The input to read from
- * @return the input's corresponding address
- */
- public static Address readFrom(final RLPInput input) {
- final Bytes bytes = input.readBytes();
- if (bytes.size() != SIZE) {
- throw new RLPException(
- String.format("Address unexpected size of %s (needs %s)", bytes.size(), SIZE));
- }
- return Address.wrap(bytes);
- }
-
- /**
- * Extracts an address from a ECDSARECOVER result hash.
- *
- * @param hash A hash that has been obtained through hashing the return of the ECDSARECOVER
- *
function from Appendix F (Signing Transactions) of the Ethereum Yellow Paper.
- * @return The ethereum address from the provided hash.
- */
- public static Address extract(final Hash hash) {
- return wrap(hash.slice(12, 20));
- }
-
- public static Address extract(final PublicKey publicKey) {
- return Address.extract(Hash.hash(publicKey.getEncodedBytes()));
- }
-
- /**
- * Parse an hexadecimal string representing an account address.
- *
- * @param str An hexadecimal string (with or without the leading '0x') representing a valid
- * account address.
- * @return The parsed address: {@code null} if the provided string is {@code null}.
- * @throws IllegalArgumentException if the string is either not hexadecimal, or not the valid
- * representation of an address.
- */
- @JsonCreator
- public static Address fromHexString(final String str) {
- if (str == null) return null;
- return wrap(Bytes.fromHexStringLenient(str, SIZE));
- }
-
- /**
- * Parse an hexadecimal string representing an account address.
- *
- * @param str An hexadecimal string representing a valid account address (strictly 20 bytes).
- * @return The parsed address.
- * @throws IllegalArgumentException if the provided string is {@code null}.
- * @throws IllegalArgumentException if the string is either not hexadecimal, or not the valid
- * representation of a 20 byte address.
- */
- public static Address fromHexStringStrict(final String str) {
- checkArgument(str != null);
- final Bytes value = Bytes.fromHexString(str);
- checkArgument(
- value.size() == SIZE,
- "An account address must be be %s bytes long, got %s",
- SIZE,
- value.size());
- return new Address(value);
- }
-
- private static Address precompiled(final int value) {
- // Keep it simple while we don't need precompiled above 127.
- checkArgument(value < Byte.MAX_VALUE);
- final byte[] address = new byte[SIZE];
- address[SIZE - 1] = (byte) value;
- return new Address(Bytes.wrap(address));
- }
-
- public static Address privacyPrecompiled(final int value) {
- return precompiled(value);
- }
-
- /**
- * Address of the created contract.
- *
- *
This implement equation (86) in Section 7 of the Yellow Paper (rev. a91c29c).
- *
- * @param senderAddress the address of the transaction sender.
- * @param nonce the nonce of this transaction.
- * @return The generated address of the created contract.
- */
- public static Address contractAddress(final Address senderAddress, final long nonce) {
- return Address.extract(
- Hash.hash(
- RLP.encode(
- out -> {
- out.startList();
- out.writeBytes(senderAddress);
- out.writeLongScalar(nonce);
- out.endList();
- })));
- }
-
- /**
- * Address of the created private contract.
- *
- * @param senderAddress the address of the transaction sender.
- * @param nonce the nonce of this transaction.
- * @param privacyGroupId hash of participants list ordered from Enclave response.
- * @return The generated address of the created private contract.
- */
- public static Address privateContractAddress(
- final Address senderAddress, final long nonce, final Bytes privacyGroupId) {
- return Address.extract(
- Hash.hash(
- RLP.encode(
- out -> {
- out.startList();
- out.writeBytes(senderAddress);
- out.writeLongScalar(nonce);
- out.writeBytes(privacyGroupId);
- out.endList();
- })));
- }
-
- public static Address fromPlugin(final org.hyperledger.besu.plugin.data.Address logger) {
- return logger instanceof Address ? (Address) logger : wrap(logger.copy());
- }
-}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LacchainProtocolSpecs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LacchainProtocolSpecs.java
index e0cd009fe0d..0dcfe11129d 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LacchainProtocolSpecs.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LacchainProtocolSpecs.java
@@ -14,9 +14,10 @@
*/
package org.hyperledger.besu.ethereum.mainnet;
-import org.hyperledger.besu.ethereum.core.Account;
-import org.hyperledger.besu.ethereum.core.Address;
-import org.hyperledger.besu.ethereum.mainnet.precompiles.FalconPrecompiledContract;
+import org.hyperledger.besu.datatypes.Address;
+import org.hyperledger.besu.evm.internal.EvmConfiguration;
+import org.hyperledger.besu.evm.precompile.FalconPrecompiledContract;
+import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry;
import java.math.BigInteger;
import java.util.Optional;
@@ -27,21 +28,19 @@ public static ProtocolSpecBuilder postQuantumDefinition(
final Optional