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(code): BlockSync MVP #440

Merged
merged 70 commits into from
Oct 30, 2024
Merged

feat(code): BlockSync MVP #440

merged 70 commits into from
Oct 30, 2024

Conversation

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 85.73417% with 205 lines in your changes missing coverage. Please review.

Project coverage is 84.34%. Comparing base (b0107f3) to head (6e5ee02).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
code/crates/actors/src/block_sync.rs 82.90% 33 Missing ⚠️
code/crates/blocksync/src/handle.rs 80.60% 26 Missing ⚠️
code/crates/actors/src/consensus.rs 75.31% 20 Missing ⚠️
code/crates/gossip-consensus/src/lib.rs 83.05% 20 Missing ⚠️
code/crates/starknet/test/src/lib.rs 89.02% 19 Missing ⚠️
code/crates/actors/src/gossip_consensus.rs 79.75% 16 Missing ⚠️
code/crates/gossip-consensus/src/handle.rs 72.09% 12 Missing ⚠️
code/crates/blocksync/src/behaviour.rs 59.26% 11 Missing ⚠️
code/crates/starknet/p2p-types/src/block.rs 38.89% 11 Missing ⚠️
code/crates/blocksync/src/metrics.rs 89.80% 10 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
- Coverage   85.32%   84.34%   -0.97%     
==========================================
  Files         112      125      +13     
  Lines        7934     9128    +1194     
==========================================
+ Hits         6769     7699     +930     
- Misses       1165     1429     +264     
Flag Coverage Δ
integration 83.76% <85.73%> (-1.06%) ⬇️
mbt 46.14% <0.00%> (-0.82%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@romac romac mentioned this pull request Oct 2, 2024
6 tasks
@ancazamfir
Copy link
Collaborator

Great start! 👍 A few notes:

  • 0a59ada breaks consensus "discovery" in the sense that with > 10 nodes some consensus peers don't connect properly
  • blocksync should keep and broadcast decided heights and not active consensus heights. We can remove the Round from the Status
  • consensus can send decided message to blocksync.

I have changes for the last two points in anca/blocksync_status

romac added 14 commits October 22, 2024 14:26
…` crate (#487)

* chore(code): Extract BlockSync logic from actor and into `blocksync` crate

* Cleanup

* Fix doc

* Fix logs

* Use custom timeout per test
* feat(code/blocksync): Add timeouts to BlockSync requests

* Fix parsing of blocksync config
…os (#496)

* Introduce small DSL for expressing test scenarios

* Add basic integration test for BlockSync

* Update fish script

* Allow overriding the transport used in tests via a `MALACHITE_TRANSPORT` env variable

* Update test

* Add doc comments

* Use TCP by default in tests

Can be overriden locally with `MALACHITE_TRANSPORT=quic`

* Run integration tests sequentially

* Run integration tests in release mode

* Fix coverage job

* Try again

* Do not panic when tracing subscribers are set twice

* Enable basic optimizations in debug mode
Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

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

looks good!

romac added 3 commits October 28, 2024 15:38
…uested block in their store (#495)

* feat(code/blocksync): Only request sync from peers which have the requested block in their store

For this, we extend the status with the earliest block height available
in the store, to ensure we only request a block from peers which have
told us they have it.

* Remove `blocksync::State::random_peer_at_or_above()` method
code/crates/actors/src/host.rs Show resolved Hide resolved
code/crates/actors/src/host.rs Show resolved Hide resolved
code/crates/actors/src/host.rs Show resolved Hide resolved
code/crates/consensus/src/effect.rs Show resolved Hide resolved
@romac
Copy link
Member Author

romac commented Oct 29, 2024

Let's leave the naming questions for later. We can address those in a follow-up PR.

@romac romac marked this pull request as ready for review October 29, 2024 11:32
@romac romac requested a review from ancazamfir October 29, 2024 11:32
@romac romac merged commit aa8cd02 into main Oct 30, 2024
14 checks passed
@romac romac deleted the blocksync-mvp branch October 30, 2024 15:17
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.

code: MVP for Blocksync
2 participants