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: bsc p2p network #8061
feat: bsc p2p network #8061
Conversation
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.
nice, this is pretty cool!
a few nits
crates/ethereum-forks/src/forkid.rs
Outdated
/// Set the current fork id | ||
pub fn set_fork_id(&mut self, fork_id: ForkId) { | ||
self.cache.fork_id = fork_id; | ||
} | ||
|
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 don't think we're using this, right?
setting the forkid on network alone is sufficient, I suppose?
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 using it to set it manually because of the various forks the bsc has, I couldn't make a valid forkhash without
examples/bsc-p2p/src/chain_cfg.rs
Outdated
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.
rename to chainspec.rs
examples/bsc-p2p/src/main.rs
Outdated
.chain_spec(bsc_chain_spec()) | ||
.set_head(head()) | ||
.listener_addr(local_addr) | ||
.build(NoopProvider::default()); |
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.
there is
reth/crates/net/network/src/config.rs
Line 454 in 9eb7d96
pub fn build_with_noop_provider( |
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.
please also add the example to examples/readme.md
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.
this is great!
this results in a lot of disconnects due to useless peer disconnect message, unclear why, but we're able to connect at least.
So I'm merging this and maybe we can figure out why we get a ton of useless peer disconnects
Thank you! I will try to figure out why |
Fixes #7738
I had to add a method to set
ForkId
manually because of different bsc forks, let me know if there's a better way to do it