Skip to content

Commit dfe7f6a

Browse files
committed
[ETCM-197] Move all fast sync components to separate package
1 parent 057f84c commit dfe7f6a

24 files changed

+62
-51
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package io.iohk.ethereum.sync.util
33
import akka.util.ByteString
44
import cats.effect.Resource
55
import io.iohk.ethereum.Mocks.MockValidatorsAlwaysSucceed
6-
import io.iohk.ethereum.blockchain.sync.{FastSync, SyncProtocol}
7-
import io.iohk.ethereum.blockchain.sync.FastSync.SyncState
6+
import io.iohk.ethereum.blockchain.sync.SyncProtocol
7+
import io.iohk.ethereum.blockchain.sync.fast.FastSync
8+
import io.iohk.ethereum.blockchain.sync.fast.FastSync.SyncState
89
import io.iohk.ethereum.crypto.kec256
910
import io.iohk.ethereum.domain.Address
1011
import io.iohk.ethereum.mpt.{HashNode, MptNode, MptTraversals}

src/main/scala/io/iohk/ethereum/blockchain/sync/SyncController.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.iohk.ethereum.blockchain.sync
22

33
import akka.actor.{Actor, ActorLogging, ActorRef, PoisonPill, Props, Scheduler}
4+
import io.iohk.ethereum.blockchain.sync.fast.FastSync
45
import io.iohk.ethereum.blockchain.sync.regular.RegularSync
56
import io.iohk.ethereum.consensus.blocks.CheckpointBlockGenerator
67
import io.iohk.ethereum.consensus.validators.Validators

src/main/scala/io/iohk/ethereum/blockchain/sync/DownloaderState.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/DownloaderState.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import akka.util.ByteString
44
import cats.data.NonEmptyList
5-
import io.iohk.ethereum.blockchain.sync.SyncStateScheduler.SyncResponse
6-
import io.iohk.ethereum.blockchain.sync.SyncStateSchedulerActor.{
5+
import io.iohk.ethereum.blockchain.sync.fast.SyncStateScheduler.SyncResponse
6+
import io.iohk.ethereum.blockchain.sync.fast.SyncStateSchedulerActor.{
77
NoUsefulDataInResponse,
88
PeerRequest,
99
ResponseProcessingResult,
1010
UnrequestedResponse,
1111
UsefulData
1212
}
1313
import io.iohk.ethereum.crypto.kec256
14-
import io.iohk.ethereum.network.{Peer, PeerId}
1514
import io.iohk.ethereum.network.p2p.messages.PV63.NodeData
15+
import io.iohk.ethereum.network.{Peer, PeerId}
1616

1717
import scala.annotation.tailrec
1818

src/main/scala/io/iohk/ethereum/blockchain/sync/FastSync.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/FastSync.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import java.time.Instant
4+
45
import akka.actor._
56
import akka.util.ByteString
67
import cats.data.NonEmptyList
7-
import io.iohk.ethereum.blockchain.sync.FastSyncReceiptsValidator.ReceiptsValidationResult
88
import io.iohk.ethereum.blockchain.sync.PeerRequestHandler.ResponseReceived
9-
import io.iohk.ethereum.blockchain.sync.SyncBlocksValidator.BlockBodyValidationResult
109
import io.iohk.ethereum.blockchain.sync.SyncProtocol.Status.Progress
11-
import io.iohk.ethereum.blockchain.sync.SyncStateSchedulerActor.{
10+
import io.iohk.ethereum.blockchain.sync._
11+
import io.iohk.ethereum.blockchain.sync.fast.FastSyncReceiptsValidator.ReceiptsValidationResult
12+
import io.iohk.ethereum.blockchain.sync.fast.SyncBlocksValidator.BlockBodyValidationResult
13+
import io.iohk.ethereum.blockchain.sync.fast.SyncStateSchedulerActor.{
1214
RestartRequested,
1315
StartSyncingTo,
1416
StateSyncFinished,
@@ -25,6 +27,7 @@ import io.iohk.ethereum.network.p2p.messages.PV63._
2527
import io.iohk.ethereum.utils.ByteStringUtils
2628
import io.iohk.ethereum.utils.Config.SyncConfig
2729
import org.bouncycastle.util.encoders.Hex
30+
2831
import scala.annotation.tailrec
2932
import scala.concurrent.ExecutionContext.Implicits.global
3033
import scala.concurrent.duration._

src/main/scala/io/iohk/ethereum/blockchain/sync/FastSyncMetrics.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/FastSyncMetrics.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import java.util.concurrent.atomic.AtomicLong
44

5-
import io.iohk.ethereum.blockchain.sync.FastSync.SyncState
6-
import io.iohk.ethereum.metrics.MetricsContainer
75
import com.google.common.util.concurrent.AtomicDouble
6+
import io.iohk.ethereum.blockchain.sync.fast.FastSync.SyncState
7+
import io.iohk.ethereum.metrics.MetricsContainer
88

99
object FastSyncMetrics extends MetricsContainer {
1010

src/main/scala/io/iohk/ethereum/blockchain/sync/FastSyncReceiptsValidator.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/FastSyncReceiptsValidator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import akka.util.ByteString
44
import io.iohk.ethereum.consensus.validators.Validators
5-
import io.iohk.ethereum.domain.{Blockchain, Receipt}
65
import io.iohk.ethereum.consensus.validators.std.StdBlockValidator.BlockError
6+
import io.iohk.ethereum.domain.{Blockchain, Receipt}
77

88
trait FastSyncReceiptsValidator {
99

src/main/scala/io/iohk/ethereum/blockchain/sync/FastSyncStateStorageActor.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/FastSyncStateStorageActor.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import akka.actor.{Actor, ActorLogging}
44
import akka.pattern.pipe
5-
import io.iohk.ethereum.blockchain.sync.FastSync.SyncState
6-
import io.iohk.ethereum.blockchain.sync.FastSyncStateStorageActor.GetStorage
5+
import io.iohk.ethereum.blockchain.sync.fast.FastSync.SyncState
6+
import io.iohk.ethereum.blockchain.sync.fast.FastSyncStateStorageActor.GetStorage
77
import io.iohk.ethereum.db.storage.FastSyncStateStorage
88

99
import scala.concurrent.Future

src/main/scala/io/iohk/ethereum/blockchain/sync/LoadableBloomFilter.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/LoadableBloomFilter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import com.google.common.hash.{BloomFilter, Funnel}
4-
import io.iohk.ethereum.blockchain.sync.LoadableBloomFilter.BloomFilterLoadingResult
4+
import io.iohk.ethereum.blockchain.sync.fast.LoadableBloomFilter.BloomFilterLoadingResult
55
import io.iohk.ethereum.db.dataSource.RocksDbDataSource.IterationError
66
import monix.eval.Task
77
import monix.reactive.{Consumer, Observable}

src/main/scala/io/iohk/ethereum/blockchain/sync/PivotBlockSelector.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/PivotBlockSelector.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import akka.actor.{Actor, ActorLogging, ActorRef, Cancellable, Props, Scheduler}
44
import akka.util.ByteString
5+
import io.iohk.ethereum.blockchain.sync.{BlacklistSupport, PeerListSupport}
56
import io.iohk.ethereum.domain.BlockHeader
67
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
78
import io.iohk.ethereum.network.PeerEventBusActor.PeerEvent.MessageFromPeer
@@ -10,6 +11,7 @@ import io.iohk.ethereum.network.PeerEventBusActor.{PeerSelector, Subscribe, Unsu
1011
import io.iohk.ethereum.network.p2p.messages.PV62.{BlockHeaders, GetBlockHeaders}
1112
import io.iohk.ethereum.network.{EtcPeerManagerActor, Peer, PeerId}
1213
import io.iohk.ethereum.utils.Config.SyncConfig
14+
1315
import scala.concurrent.ExecutionContext.Implicits.global
1416
import scala.concurrent.duration.FiniteDuration
1517

src/main/scala/io/iohk/ethereum/blockchain/sync/SyncBlocksValidator.scala renamed to src/main/scala/io/iohk/ethereum/blockchain/sync/fast/SyncBlocksValidator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package io.iohk.ethereum.blockchain.sync
1+
package io.iohk.ethereum.blockchain.sync.fast
22

33
import akka.util.ByteString
44
import io.iohk.ethereum.consensus.validators.Validators
55
import io.iohk.ethereum.consensus.validators.std.StdBlockValidator
6-
import io.iohk.ethereum.domain.{BlockHeader, BlockBody, Blockchain}
76
import io.iohk.ethereum.consensus.validators.std.StdBlockValidator.BlockValid
7+
import io.iohk.ethereum.domain.{BlockBody, BlockHeader, Blockchain}
88

99
trait SyncBlocksValidator {
1010

0 commit comments

Comments
 (0)