-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Etcm 1030 #1069
Etcm 1030 #1069
Conversation
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/ExecutionSync.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/ExecutionSync.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockImporterService.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/HeadersFetcher.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala
Show resolved
Hide resolved
|
||
//not used atm, a part of the future ExecutionSync | ||
class FetcherService(validator: BlockValidator, blockchainReader: BlockchainReader, syncConfig: SyncConfig) { | ||
val batchSize = syncConfig.blockHeadersPerRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is an unfortunate pattern. the class does not depend on the whole sysconfig class - it depends on one field from that class. how can we better express such dependencies?
if it's one field perhaps a tagged number would be good enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I know what's a tagged number🤔
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala
Outdated
Show resolved
Hide resolved
val endNumber: Option[BigInt] = | ||
fetchUntilBlock.fold(Some(_), blockchainReader.getBlockHeaderByHash(_).map(_.number)) | ||
val startNumber: Option[BigInt] = | ||
startFromBlock.fold(Some(_), blockchainReader.getBlockHeaderByHash(_).map(_.number)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct me if I'm wrong but wouldn't it be beneficial to request a block by hash from a peer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually thinking more on that - we wouldn't know the hash of the block we want to fetch from the peer if we don't have that block ourselves. And the point of fetching from multiple peers is exactly to get alternative chains, so we do need to fetch by number here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this one merits some discussion. maybe we can address it on the synch meeting?
src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala
Outdated
Show resolved
Hide resolved
f8dcd4e
to
a51b6c8
Compare
Description
ExecutionSync is gonna be orchestrating the whole regular sync process and is gonna replace current RegularSync class.
Note: tests will be added in a separate PR