Skip to content
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

feat: sync task engine for parlia(bsc) #16

Merged
merged 15 commits into from
Jun 21, 2024
Merged

Conversation

j75689
Copy link
Collaborator

@j75689 j75689 commented May 22, 2024

Description

Implement ParliaEngineTask and ParliaCleint

The purpose of these two structures is to process NewBlobk and NewBlockHash messages from p2p without using an external consensus node.

Give reth the ability to synchronize with the BSC network

Example

bsc-reth node --chain bsc

Changes

  1. implements NewBlobk and NewBlockHash handling from p2p messge

Notable changes:

  • add ParliaEngineTask and ParliaCleint into reth-bsc-consensus

Potential Impacts

  • no

@j75689 j75689 force-pushed the feat/parlia/fetcher branch 2 times, most recently from 68a4e7e to 61087bb Compare May 23, 2024 02:11
@j75689 j75689 changed the base branch from feat/bsc-node-builder to bsc_feature June 6, 2024 17:39
@pythonberg1997 pythonberg1997 force-pushed the bsc_feature branch 2 times, most recently from 903abfc to e34b99c Compare June 7, 2024 10:20
@j75689 j75689 force-pushed the feat/parlia/fetcher branch 3 times, most recently from f9524f0 to 31bb5ec Compare June 14, 2024 08:20
},
}
// skip if number is lower than best number
if info.block_number <= best_header.number {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if a bad peer broadcast a very large block_number which never exist, I guess it will block any other message from the correct peer.

Copy link
Collaborator Author

@j75689 j75689 Jun 21, 2024

Choose a reason for hiding this comment

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

It is a bit difficult to judge this situation here. In swan, if the fetch result is wrong, the peer will be automatically eliminated.

What can be done here is probably to pass in a timeout time to prevent it from being locked for too long?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add a TODO here.
Better solutions need to be considered.

Makefile Outdated Show resolved Hide resolved

this.start_block_event_listening();
this.start_fork_choice_update_notifier();
this
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this returned struct has never been used. Why we need it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Makefile Outdated Show resolved Hide resolved
@unclezoro unclezoro merged commit f37b938 into develop Jun 21, 2024
22 of 31 checks passed
@unclezoro unclezoro deleted the feat/parlia/fetcher branch June 27, 2024 06:39
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.

4 participants