Skip to content

Etcm 1030#1069

Merged
AurelienRichez merged 4 commits intodevelopfrom
ETCM-1030
Jul 30, 2021
Merged

Etcm 1030#1069
AurelienRichez merged 4 commits intodevelopfrom
ETCM-1030

Conversation

@AnastasiiaL
Copy link
Copy Markdown
Contributor

@AnastasiiaL AnastasiiaL commented Jul 16, 2021

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

Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/regular/ExecutionSync.scala Outdated
Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/regular/ExecutionSync.scala Outdated
Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala Outdated
Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/regular/HeadersFetcher.scala Outdated

//not used atm, a part of the future ExecutionSync
class FetcherService(validator: BlockValidator, blockchainReader: BlockchainReader, syncConfig: SyncConfig) {
val batchSize = syncConfig.blockHeadersPerRequest
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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🤔

Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala Outdated
Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/regular/FetcherService.scala Outdated
val endNumber: Option[BigInt] =
fetchUntilBlock.fold(Some(_), blockchainReader.getBlockHeaderByHash(_).map(_.number))
val startNumber: Option[BigInt] =
startFromBlock.fold(Some(_), blockchainReader.getBlockHeaderByHash(_).map(_.number))
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

@dzajkowski dzajkowski left a 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?

Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala Outdated
Comment thread src/main/scala/io/iohk/ethereum/blockchain/sync/PeersClient.scala Outdated
@AnastasiiaL AnastasiiaL force-pushed the ETCM-1030 branch 3 times, most recently from f8dcd4e to a51b6c8 Compare July 27, 2021 12:40
@AurelienRichez AurelienRichez merged commit 4db8224 into develop Jul 30, 2021
@AurelienRichez AurelienRichez deleted the ETCM-1030 branch July 30, 2021 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants