stacks-core
stacks-core copied to clipboard
Feat: Nakamoto p2p block support
Description
Add support for Nakamoto blocks in p2p code
This is a work in progress. I'm marking it as ready for review even though I don't have tests written in order to get feedback
Applicable issues
- fixes #4069
Additional info (benefits, drawbacks, caveats)
Issue Checklist
- [x] Nakamoto block wire format
- [x] Contains a
ConsensusHashthat identifies the tenure, and aVec<NakamotoBlock>for the blocks themselves - [x] New
StacksMessageIDvalue andStacksMessageTypevariant - [x] New codec for the block message
- [x] Contains a
- [x] Updating stackslib/src/net/chat.rs to handle incoming Nakamoto blocks
- [ ] Only if the current epoch is epoch 3.0 (I will add this once #3710 gets merged with
DeserializeWithEpochtrait) - [ ] The block message's consensus hash should be in our burnchain history; otherwise the message is dropped
- [x] The message needs to count towards that remote peer's bandwidth metering
- [ ] Only if the current epoch is epoch 3.0 (I will add this once #3710 gets merged with
- [x] Updating
NetworkResultto store received and validated Nakamoto blocks, and report that there is data to store - [x] Updating
Relayer::process_network_result()to accept new Nakamoto blocks viaRelayer::process_new_nakamoto_block()
Standard Checklist
- [ ] Test coverage for new or modified code paths
- [ ] Changelog is updated
- [ ] Required documentation changes (e.g.,
docs/rpc/openapi.yamlandrpc-endpoints.mdfor v2 endpoints,event-dispatcher.mdfor new events) - [ ] New clarity functions have corresponding PR in
clarity-benchmarkingrepo - [ ] New integration test(s) added to
bitcoin-tests.yml
Codecov Report
Attention: 265 lines in your changes are missing coverage. Please review.
Comparison is base (
3e21883) 82.91% compared to head (0e58dd6) 82.87%.
Additional details and impacted files
@@ Coverage Diff @@
## next #4202 +/- ##
==========================================
- Coverage 82.91% 82.87% -0.05%
==========================================
Files 429 429
Lines 302864 303328 +464
==========================================
+ Hits 251107 251368 +261
- Misses 51757 51960 +203
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hold off the merge until Network State machines are done
Hold off the merge until Network State machines are done
https://github.com/stacks-network/stacks-core/pull/4476
Was just checking through my PR review todos -- should this PR be revisited now?
Closing this, it's being handled part of the block push changes