Skip to content

Comments

feat: implement block downloader#9118

Merged
mattsse merged 6 commits intomatt/engine2from
fgimenez/implement-block-downloader
Jun 27, 2024
Merged

feat: implement block downloader#9118
mattsse merged 6 commits intomatt/engine2from
fgimenez/implement-block-downloader

Conversation

@fgimenez
Copy link
Member

Closes: #9011

Some changes compared to

pub(crate) struct EngineSyncController<DB, Client>
where
DB: Database,
Client: HeadersClient + BodiesClient,
{
to adhere to the BlockDownloader trait and be able to:

  • request to download a set of blocks
  • return DownloadOutcome with more than one downloaded block as a result of poll

Also modified DownloadRequest::Blocks to wrap a HashSet<B256> instead of a Vec<B256>, let me know wdyt.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this is great!

love the tests, left some nits and suggestions

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like this to accept Arc<dyn Consensus> so that we are independent of the consensus and can reuse this for OP

Copy link
Member Author

Choose a reason for hiding this comment

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

Arc<ChainSpec> should be valid for OP or am I missing something? I see that FullBlockClient receives a Consensus implementation, but it is already defined as Arc<dyn Consensus>?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, changed here 36730cf to use consensus as constructor arg instead of chainspec, ptal

@fgimenez fgimenez force-pushed the fgimenez/implement-block-downloader branch from 97eb334 to eceb543 Compare June 26, 2024 16:00
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice,
lgtm!

@mattsse mattsse merged commit 5330f5d into matt/engine2 Jun 27, 2024
@mattsse mattsse deleted the fgimenez/implement-block-downloader branch June 27, 2024 09:43
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.

2 participants