From 8e8d907fc3cf30558454e85fff5deba8db2f7990 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Mon, 15 Feb 2021 16:33:08 +1100 Subject: [PATCH] Change Istanbul64 to Istanbul99 (#1903) When interop testing between Besu and Quorum, it was found that Quorum's management of the ibft protocol had somewhat changed, and resulted in besu failing to peer with Quorum To overcome this, the version of the istanbul protocol in Besu was upgraded to 99 (matching Quorum's). Signed-off-by: Trent Mohay --- .../controller/IbftLegacyBesuControllerBuilder.java | 10 +++++----- ...tanbul64Protocol.java => Istanbul99Protocol.java} | 12 ++++++------ ...olManager.java => Istanbul99ProtocolManager.java} | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) rename consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/{Istanbul64Protocol.java => Istanbul99Protocol.java} (91%) rename consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/{Istanbul64ProtocolManager.java => Istanbul99ProtocolManager.java} (92%) diff --git a/besu/src/main/java/org/hyperledger/besu/controller/IbftLegacyBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/IbftLegacyBesuControllerBuilder.java index 944e96e288..51c917be77 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/IbftLegacyBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/IbftLegacyBesuControllerBuilder.java @@ -23,8 +23,8 @@ import org.hyperledger.besu.consensus.common.VoteTallyUpdater; import org.hyperledger.besu.consensus.common.bft.BftContext; import org.hyperledger.besu.consensus.ibftlegacy.IbftLegacyBlockInterface; import org.hyperledger.besu.consensus.ibftlegacy.IbftProtocolSchedule; -import org.hyperledger.besu.consensus.ibftlegacy.protocol.Istanbul64Protocol; -import org.hyperledger.besu.consensus.ibftlegacy.protocol.Istanbul64ProtocolManager; +import org.hyperledger.besu.consensus.ibftlegacy.protocol.Istanbul99Protocol; +import org.hyperledger.besu.consensus.ibftlegacy.protocol.Istanbul99ProtocolManager; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.NoopMiningCoordinator; @@ -58,7 +58,7 @@ public class IbftLegacyBesuControllerBuilder extends BesuControllerBuilder { protected SubProtocolConfiguration createSubProtocolConfiguration( final EthProtocolManager ethProtocolManager) { return new SubProtocolConfiguration() - .withSubProtocol(Istanbul64Protocol.get(), ethProtocolManager); + .withSubProtocol(Istanbul99Protocol.get(), ethProtocolManager); } @Override @@ -113,7 +113,7 @@ public class IbftLegacyBesuControllerBuilder extends BesuControllerBuilder { @Override protected String getSupportedProtocol() { - return Istanbul64Protocol.get().getName(); + return Istanbul99Protocol.get().getName(); } @Override @@ -128,7 +128,7 @@ public class IbftLegacyBesuControllerBuilder extends BesuControllerBuilder { final EthScheduler scheduler, final List peerValidators) { LOG.info("Operating on IBFT-1.0 network."); - return new Istanbul64ProtocolManager( + return new Istanbul99ProtocolManager( protocolContext.getBlockchain(), networkId, protocolContext.getWorldStateArchive(), diff --git a/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64Protocol.java b/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99Protocol.java similarity index 91% rename from consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64Protocol.java rename to consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99Protocol.java index 2924b8fa51..5ace5a8eb2 100644 --- a/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64Protocol.java +++ b/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99Protocol.java @@ -24,19 +24,19 @@ import java.util.Arrays; import java.util.List; /** - * Represents the istanbul/64 protocol as used by Quorum (effectively an extension of eth/63, which + * Represents the istanbul/64 protocol as used by Quorum (effectively an extension of eth/65, which * adds a single message type (0x11) to encapsulate all communications required for IBFT block * mining. */ -public class Istanbul64Protocol implements SubProtocol { +public class Istanbul99Protocol implements SubProtocol { private static final String NAME = "istanbul"; - private static final int VERSION = 64; + private static final int VERSION = 99; - static final Capability ISTANBUL64 = Capability.create(NAME, 64); + static final Capability ISTANBUL99 = Capability.create(NAME, 99); static final int INSTANBUL_MSG = 0x11; - private static final Istanbul64Protocol INSTANCE = new Istanbul64Protocol(); + private static final Istanbul99Protocol INSTANCE = new Istanbul99Protocol(); private static final List istanbul64Messages = Arrays.asList( @@ -115,7 +115,7 @@ public class Istanbul64Protocol implements SubProtocol { } } - public static Istanbul64Protocol get() { + public static Istanbul99Protocol get() { return INSTANCE; } } diff --git a/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64ProtocolManager.java b/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99ProtocolManager.java similarity index 92% rename from consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64ProtocolManager.java rename to consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99ProtocolManager.java index 369563d3d9..bf0a7a1799 100644 --- a/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul64ProtocolManager.java +++ b/consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/protocol/Istanbul99ProtocolManager.java @@ -32,9 +32,9 @@ import java.math.BigInteger; import java.util.List; /** This allows for interoperability with Quorum, but shouldn't be used otherwise. */ -public class Istanbul64ProtocolManager extends EthProtocolManager { +public class Istanbul99ProtocolManager extends EthProtocolManager { - public Istanbul64ProtocolManager( + public Istanbul99ProtocolManager( final Blockchain blockchain, final BigInteger networkId, final WorldStateArchive worldStateArchive, @@ -62,11 +62,11 @@ public class Istanbul64ProtocolManager extends EthProtocolManager { @Override public List getSupportedCapabilities() { - return singletonList(Istanbul64Protocol.ISTANBUL64); + return singletonList(Istanbul99Protocol.ISTANBUL99); } @Override public String getSupportedProtocol() { - return Istanbul64Protocol.get().getName(); + return Istanbul99Protocol.get().getName(); } }