-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix(mining): Advertise mined blocks #9176
base: main
Are you sure you want to change the base?
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.
This looks great, thank you for these changes. It's more complicated than what I had in mind, but it makes it easy to now handle mined blocks differently and broadcast them to all ready peers instead of a third of them.
I opened a suggestion PR, #9183, for your review. Ideally this PR could advertise mined blocks immediately and return early from check_synced_to_tip()
on test networks, but I see no blockers to merging this as-is.
use crate::components::sync::PEER_GOSSIP_DELAY; | ||
|
||
// Custom in-memory writer to capture logs | ||
struct TestWriter(Arc<Mutex<Vec<u8>>>); |
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.
Could you leave a note about the conditional compilation issue or how this is used?
Motivation
When blocks are mined and we are not close to the tip the mined block do not get advertised to the network.
Close #8909
Solution
Introduce a channel with a sender part used by the rpc method submit block to add a signal when a block is submitted and accepted. The receiver part of the channel is used by the block gossip task to advertise the block.
Tests
submitblock_channel
was added to check the gossip task can receive mined blocks.nu6_funding_streams_and_coinbase_balance
to make sure the sender part of the channel is working.PR Author's Checklist
PR Reviewer's Checklist