Skip to content

Commit cba4321

Browse files
authored
Revert "[ETCM-402] Decode messages with the correct protocol version" (#938)
1 parent e89e66d commit cba4321

File tree

66 files changed

+203
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+203
-355
lines changed

src/benchmark/scala/io/iohk/ethereum/rlp/RLPSpeedSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import akka.util.ByteString
44
import io.iohk.ethereum.ObjectGenerators
55
import io.iohk.ethereum.domain.Block._
66
import io.iohk.ethereum.domain._
7-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
7+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
88
import io.iohk.ethereum.utils.Logger
99
import io.iohk.ethereum.utils.Hex
1010
import org.scalacheck.Gen

src/ets/scala/io/iohk/ethereum/ets/blockchain/BlockchainTestConfig.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ object BlockchainTestConfig {
3030
difficultyBombRemovalBlockNumber = 5900000,
3131
chainId = 0x1.toByte,
3232
networkId = 1,
33-
protocolVersion = 63,
3433
customGenesisFileOpt = Some("test-genesis.json"),
3534
monetaryPolicyConfig =
3635
MonetaryPolicyConfig(5000000, 0.2, BigInt("5000000000000000000"), BigInt("3000000000000000000")),

src/it/scala/io/iohk/ethereum/sync/util/CommonFakePeer.scala

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
package io.iohk.ethereum.sync.util
22

3+
import java.nio.file.Files
4+
import java.time.Clock
5+
import java.util.concurrent.atomic.AtomicReference
6+
37
import akka.actor.{ActorRef, ActorSystem}
48
import akka.testkit.TestProbe
59
import akka.util.{ByteString, Timeout}
610
import io.iohk.ethereum.blockchain.sync.regular.BlockBroadcast.BlockToBroadcast
7-
import io.iohk.ethereum.blockchain.sync.regular.BlockBroadcasterActor.BroadcastBlock
811
import io.iohk.ethereum.blockchain.sync.regular.{BlockBroadcast, BlockBroadcasterActor}
12+
import io.iohk.ethereum.blockchain.sync.regular.BlockBroadcasterActor.BroadcastBlock
913
import io.iohk.ethereum.blockchain.sync.{BlockchainHostActor, TestSyncConfig}
1014
import io.iohk.ethereum.db.components.{RocksDbDataSourceComponent, Storages}
1115
import io.iohk.ethereum.db.dataSource.{RocksDbConfig, RocksDbDataSource}
1216
import io.iohk.ethereum.db.storage.pruning.{ArchivePruning, PruningMode}
1317
import io.iohk.ethereum.db.storage.{AppStateStorage, Namespaces}
1418
import io.iohk.ethereum.domain.{Block, Blockchain, BlockchainImpl, ChainWeight}
19+
import io.iohk.ethereum.security.SecureRandomBuilder
1520
import io.iohk.ethereum.ledger.InMemoryWorldStateProxy
1621
import io.iohk.ethereum.mpt.MerklePatriciaTrie
1722
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
@@ -20,13 +25,18 @@ import io.iohk.ethereum.network.discovery.PeerDiscoveryManager.DiscoveredNodesIn
2025
import io.iohk.ethereum.network.discovery.{DiscoveryConfig, Node}
2126
import io.iohk.ethereum.network.handshaker.{EtcHandshaker, EtcHandshakerConfiguration, Handshaker}
2227
import io.iohk.ethereum.network.p2p.EthereumMessageDecoder
23-
import io.iohk.ethereum.network.p2p.Message.Version
24-
import io.iohk.ethereum.network.p2p.messages.ProtocolNegotiator
2528
import io.iohk.ethereum.network.rlpx.AuthHandshaker
2629
import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration
27-
import io.iohk.ethereum.network.{EtcPeerManagerActor, ForkResolver, KnownNodesManager, PeerEventBusActor, PeerManagerActor, PeerStatisticsActor, ServerActor}
30+
import io.iohk.ethereum.network.{
31+
EtcPeerManagerActor,
32+
ForkResolver,
33+
KnownNodesManager,
34+
PeerEventBusActor,
35+
PeerManagerActor,
36+
PeerStatisticsActor,
37+
ServerActor
38+
}
2839
import io.iohk.ethereum.nodebuilder.PruningConfigBuilder
29-
import io.iohk.ethereum.security.SecureRandomBuilder
3040
import io.iohk.ethereum.sync.util.SyncCommonItSpec._
3141
import io.iohk.ethereum.sync.util.SyncCommonItSpecUtils._
3242
import io.iohk.ethereum.utils.ServerStatus.Listening
@@ -35,9 +45,6 @@ import io.iohk.ethereum.vm.EvmConfig
3545
import io.iohk.ethereum.{Fixtures, Timeouts}
3646
import monix.eval.Task
3747

38-
import java.nio.file.Files
39-
import java.time.Clock
40-
import java.util.concurrent.atomic.AtomicReference
4148
import scala.concurrent.duration.{FiniteDuration, _}
4249

4350
abstract class CommonFakePeer(peerName: String, fakePeerCustomConfig: FakePeerCustomConfig)
@@ -162,12 +169,10 @@ abstract class CommonFakePeer(peerName: String, fakePeerCustomConfig: FakePeerCu
162169
override val peerConfiguration: PeerConfiguration = peerConf
163170
override val blockchain: Blockchain = bl
164171
override val appStateStorage: AppStateStorage = storagesInstance.storages.appStateStorage
165-
override val protocolVersion: Version = blockchainConfig.protocolVersion
172+
override val protocolVersion: Int = Config.Network.protocolVersion
166173
}
167174

168-
val protocolNegotiator = new ProtocolNegotiator(handshakerConfiguration.protocolVersion)
169-
170-
lazy val handshaker: Handshaker[PeerInfo] = EtcHandshaker(handshakerConfiguration, protocolNegotiator)
175+
lazy val handshaker: Handshaker[PeerInfo] = EtcHandshaker(handshakerConfiguration)
171176

172177
lazy val authHandshaker: AuthHandshaker = AuthHandshaker(nodeKey, secureRandom)
173178

@@ -185,7 +190,7 @@ abstract class CommonFakePeer(peerName: String, fakePeerCustomConfig: FakePeerCu
185190
authHandshaker,
186191
EthereumMessageDecoder,
187192
discoveryConfig,
188-
protocolNegotiator
193+
Config.Network.protocolVersion
189194
),
190195
"peer-manager"
191196
)

src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class ECIP1017Test extends AnyFlatSpec with Matchers {
2222
maxCodeSize = None,
2323
chainId = 0x3d.toByte,
2424
networkId = 1,
25-
protocolVersion = 63,
2625
frontierBlockNumber = 0,
2726
homesteadBlockNumber = 1150000,
2827
eip106BlockNumber = Long.MaxValue,

src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ForksTest extends AnyFlatSpec with Matchers {
2727
// unused
2828
bootstrapNodes = Set(),
2929
networkId = 1,
30-
protocolVersion = 63,
3130
maxCodeSize = None,
3231
eip161BlockNumber = Long.MaxValue,
3332
customGenesisFileOpt = None,

src/it/scala/io/iohk/ethereum/txExecTest/util/DumpChainApp.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import io.iohk.ethereum.network.PeerStatisticsActor
2323
import io.iohk.ethereum.network.discovery.DiscoveryConfig
2424
import io.iohk.ethereum.network.handshaker.{EtcHandshaker, EtcHandshakerConfiguration, Handshaker}
2525
import io.iohk.ethereum.network.p2p.EthereumMessageDecoder
26-
import io.iohk.ethereum.network.p2p.Message.Version
27-
import io.iohk.ethereum.network.p2p.messages.ProtocolNegotiator
2826
import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration
2927
import io.iohk.ethereum.network.{ForkResolver, PeerEventBusActor, PeerManagerActor}
3028
import io.iohk.ethereum.nodebuilder.{AuthHandshakerBuilder, NodeKeyBuilder}
@@ -93,12 +91,10 @@ object DumpChainApp extends App with NodeKeyBuilder with SecureRandomBuilder wit
9391
override val peerConfiguration: PeerConfiguration = peerConfig
9492
override val blockchain: Blockchain = DumpChainApp.blockchain
9593
override val appStateStorage: AppStateStorage = storagesInstance.storages.appStateStorage
96-
override val protocolVersion: Version = blockchainConfig.protocolVersion
94+
override val protocolVersion: Int = Config.Network.protocolVersion
9795
}
9896

99-
val protocolNegotiator = new ProtocolNegotiator(handshakerConfiguration.protocolVersion)
100-
101-
lazy val handshaker: Handshaker[PeerInfo] = EtcHandshaker(handshakerConfiguration, protocolNegotiator)
97+
lazy val handshaker: Handshaker[PeerInfo] = EtcHandshaker(handshakerConfiguration)
10298

10399
val peerMessageBus = actorSystem.actorOf(PeerEventBusActor.props)
104100

@@ -115,7 +111,7 @@ object DumpChainApp extends App with NodeKeyBuilder with SecureRandomBuilder wit
115111
authHandshaker = authHandshaker,
116112
messageDecoder = EthereumMessageDecoder,
117113
discoveryConfig = discoveryConfig,
118-
protocolNegotiator = protocolNegotiator
114+
bestProtocolVersion = Config.Network.protocolVersion
119115
),
120116
"peer-manager"
121117
)

src/main/resources/application.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ mantis {
3434
}
3535

3636
network {
37+
# Ethereum protocol version
38+
# Supported versions:
39+
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
40+
protocol-version = 63
41+
3742
server-address {
3843
# Listening interface for Ethereum protocol connections
3944
interface = "0.0.0.0"

src/main/resources/chains/etc-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 1
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/eth-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 1
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/mordor-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 7
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/ropsten-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 3
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/test-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 7 - mordor
44
network-id = 1
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/testnet-internal-gac-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 42
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = null

src/main/resources/chains/testnet-internal-nomad-chain.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 42
55

6-
# Ethereum protocol version
7-
# Supported versions:
8-
# 63, 64 (experimental version which enables usage of messages with checkpointing information. In the future after ETCM-355, ETCM-356, it will be 66 probably)
9-
network.protocol-version = 63
10-
116
# Possibility to set Proof of Work target time for testing purposes.
127
# null means that the standard difficulty calculation rules are used
138
pow-target-time = 30 seconds

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockBroadcast.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import io.iohk.ethereum.domain.{Block, ChainWeight}
66
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
77
import io.iohk.ethereum.network.p2p.MessageSerializable
88
import io.iohk.ethereum.network.p2p.messages.PV62.BlockHash
9-
import io.iohk.ethereum.network.p2p.messages.{PV60, PV62, PV64, ProtocolVersions}
9+
import io.iohk.ethereum.network.p2p.messages.{CommonMessages, PV62, PV64, ProtocolVersions}
1010
import io.iohk.ethereum.network.{EtcPeerManagerActor, Peer}
1111

1212
import scala.util.Random
@@ -71,7 +71,7 @@ object BlockBroadcast {
7171
* (they are different versions of NewBlock msg)
7272
*/
7373
case class BlockToBroadcast(block: Block, chainWeight: ChainWeight) {
74-
def as63: PV60.NewBlock = PV60.NewBlock(block, chainWeight.totalDifficulty)
74+
def as63: CommonMessages.NewBlock = CommonMessages.NewBlock(block, chainWeight.totalDifficulty)
7575
def as64: PV64.NewBlock = PV64.NewBlock(block, chainWeight)
7676
}
7777
}

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcher.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import io.iohk.ethereum.network.PeerEventBusActor.PeerEvent.MessageFromPeer
2121
import io.iohk.ethereum.network.PeerEventBusActor.SubscriptionClassifier.MessageClassifier
2222
import io.iohk.ethereum.network.PeerEventBusActor.{PeerSelector, Subscribe, Unsubscribe}
2323
import io.iohk.ethereum.network.PeerId
24-
import io.iohk.ethereum.network.p2p.messages.{Codes, PV60, PV64}
24+
import io.iohk.ethereum.network.p2p.messages.{Codes, CommonMessages, PV64}
2525
import io.iohk.ethereum.network.p2p.messages.PV62._
2626
import io.iohk.ethereum.network.p2p.messages.PV63.{GetNodeData, NodeData}
2727
import io.iohk.ethereum.utils.ByteStringUtils
@@ -197,8 +197,7 @@ class BlockFetcher(
197197
}
198198
supervisor ! ProgressProtocol.GotNewBlock(newState.knownTop)
199199
fetchBlocks(newState)
200-
// Remember to always add match for every new version of NewBlock message
201-
case MessageFromPeer(PV60.NewBlock(block, _), peerId) =>
200+
case MessageFromPeer(CommonMessages.NewBlock(block, _), peerId) =>
202201
handleNewBlock(block, peerId, state)
203202
case MessageFromPeer(PV64.NewBlock(block, _), peerId) =>
204203
handleNewBlock(block, peerId, state)

src/main/scala/io/iohk/ethereum/domain/Block.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case class Block(header: BlockHeader, body: BlockBody) {
2929
object Block {
3030

3131
implicit class BlockEnc(val obj: Block) extends RLPSerializable {
32-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
32+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
3333

3434
override def toRLPEncodable: RLPEncodeable = RLPList(
3535
obj.header.toRLPEncodable,
@@ -39,7 +39,7 @@ object Block {
3939
}
4040

4141
implicit class BlockDec(val bytes: Array[Byte]) extends AnyVal {
42-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
42+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
4343
def toBlock: Block = rawDecode(bytes) match {
4444
case RLPList(header: RLPList, stx: RLPList, uncles: RLPList) =>
4545
Block(

src/main/scala/io/iohk/ethereum/domain/BlockBody.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object BlockBody {
3131

3232
implicit class BlockBodyEnc(msg: BlockBody) extends RLPSerializable {
3333
override def toRLPEncodable: RLPEncodeable = {
34-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
34+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
3535

3636
blockBodyToRlpEncodable(
3737
msg,
@@ -61,7 +61,7 @@ object BlockBody {
6161

6262
implicit class BlockBodyRLPEncodableDec(val rlpEncodeable: RLPEncodeable) {
6363
def toBlockBody: BlockBody = {
64-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
64+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
6565

6666
rlpEncodableToBlockBody(
6767
rlpEncodeable,

src/main/scala/io/iohk/ethereum/domain/SignedTransaction.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ import com.google.common.cache.{Cache, CacheBuilder}
55
import io.iohk.ethereum.crypto
66
import io.iohk.ethereum.crypto.{ECDSASignature, kec256}
77
import io.iohk.ethereum.mpt.ByteArraySerializable
8-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions._
8+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions._
99
import io.iohk.ethereum.rlp.RLPImplicitConversions._
1010
import io.iohk.ethereum.rlp.RLPImplicits._
1111
import io.iohk.ethereum.rlp.{encode => rlpEncode, _}
12+
import java.math.BigInteger
13+
import java.util.concurrent.Executors
1214
import monix.eval.Task
1315
import monix.execution.Scheduler
1416
import org.bouncycastle.crypto.AsymmetricCipherKeyPair
1517
import org.bouncycastle.util.encoders.Hex
16-
17-
import java.math.BigInteger
18-
import java.util.concurrent.Executors
1918
import scala.util.Try
2019

2120
object SignedTransaction {

src/main/scala/io/iohk/ethereum/faucet/jsonrpc/WalletService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import io.iohk.ethereum.faucet.FaucetConfig
77
import io.iohk.ethereum.jsonrpc.client.RpcClient.RpcError
88
import io.iohk.ethereum.keystore.KeyStore.KeyStoreError
99
import io.iohk.ethereum.keystore.{KeyStore, Wallet}
10-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions.SignedTransactionEnc
10+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.SignedTransactionEnc
1111
import io.iohk.ethereum.rlp
1212
import io.iohk.ethereum.utils.{ByteStringUtils, Logger}
1313
import monix.eval.Task

src/main/scala/io/iohk/ethereum/jsonrpc/EthTxService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class EthTxService(
168168
}
169169

170170
def sendRawTransaction(req: SendRawTransactionRequest): ServiceResponse[SendRawTransactionResponse] = {
171-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions.SignedTransactionDec
171+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.SignedTransactionDec
172172

173173
Try(req.data.toArray.toSignedTransaction) match {
174174
case Success(signedTransaction) =>

src/main/scala/io/iohk/ethereum/jsonrpc/RawTransactionCodec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.iohk.ethereum.jsonrpc
22

33
import akka.util.ByteString
44
import io.iohk.ethereum.domain.SignedTransaction
5-
import io.iohk.ethereum.network.p2p.messages.PV60.SignedTransactions.SignedTransactionEnc
5+
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.SignedTransactionEnc
66
import io.iohk.ethereum.rlp
77

88
object RawTransactionCodec {

src/main/scala/io/iohk/ethereum/network/EtcPeerManagerActor.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import io.iohk.ethereum.network.handshaker.Handshaker.HandshakeResult
1313
import io.iohk.ethereum.network.p2p.messages.PV62.{BlockHeaders, GetBlockHeaders, NewBlockHashes}
1414
import io.iohk.ethereum.network.p2p.messages.PV64.NewBlock
1515
import io.iohk.ethereum.network.p2p.messages.WireProtocol.Disconnect
16-
import io.iohk.ethereum.network.p2p.messages.{Codes, PV60, PV64}
16+
import io.iohk.ethereum.network.p2p.messages.{Codes, CommonMessages, PV64}
1717
import io.iohk.ethereum.network.p2p.{Message, MessageSerializable}
1818
import io.iohk.ethereum.utils.ByteStringUtils
1919

@@ -159,7 +159,7 @@ class EtcPeerManagerActor(
159159
*/
160160
private def updateChainWeight(message: Message)(initialPeerInfo: PeerInfo): PeerInfo =
161161
message match {
162-
case newBlock: PV60.NewBlock =>
162+
case newBlock: CommonMessages.NewBlock =>
163163
initialPeerInfo.copy(chainWeight = ChainWeight.totalDifficultyOnly(newBlock.totalDifficulty))
164164
case newBlock: PV64.NewBlock => initialPeerInfo.copy(chainWeight = newBlock.chainWeight)
165165
case _ => initialPeerInfo
@@ -220,7 +220,7 @@ class EtcPeerManagerActor(
220220
message match {
221221
case m: BlockHeaders =>
222222
update(m.headers.map(header => (header.number, header.hash)))
223-
case m: PV60.NewBlock =>
223+
case m: CommonMessages.NewBlock =>
224224
update(Seq((m.block.header.number, m.block.header.hash)))
225225
case m: NewBlock =>
226226
update(Seq((m.block.header.number, m.block.header.hash)))
@@ -263,7 +263,7 @@ object EtcPeerManagerActor {
263263
RemoteStatus(status.protocolVersion, status.networkId, status.chainWeight, status.bestHash, status.genesisHash)
264264
}
265265

266-
def apply(status: PV60.Status): RemoteStatus = {
266+
def apply(status: CommonMessages.Status): RemoteStatus = {
267267
RemoteStatus(
268268
status.protocolVersion,
269269
status.networkId,

0 commit comments

Comments
 (0)