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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
25f8470
feat(code): Add dummy `BlockSync` actor
romac Oct 1, 2024
f3f612a
Add `/block_sync` pubsub channel
romac Oct 3, 2024
9b807db
Rename `broadcast` to `publish`
romac Oct 4, 2024
69cd269
Use `eyre` instead of boxed `Error`
romac Oct 4, 2024
c4e7846
Have peers publish their status every time they move to a new height/…
romac Oct 4, 2024
b2f8070
Fix bug where `StartRound` effect was performed twice
romac Oct 4, 2024
a88935f
Move status handling into BlockSync actor
romac Oct 4, 2024
a26ad5c
Less noise
romac Oct 4, 2024
d40cae4
Move status update logic onto BlockSync actor
romac Oct 4, 2024
0a59ada
Decouple GossipConsensus actor from Consensus and BlockSync actors
romac Oct 4, 2024
ce9bb1c
Push latest hight from consensus to blocksync
ancazamfir Oct 6, 2024
bb16bb5
Revert "Decouple GossipConsensus actor from Consensus and BlockSync a…
romac Oct 7, 2024
494e878
Merge branch 'blocksync-mvp' into anca/blocksync_status
ancazamfir Oct 7, 2024
2568d79
Merge branch 'main' into blocksync-mvp
romac Oct 9, 2024
c8fb9e7
feat(code): BlockSync RPC (#457)
romac Oct 9, 2024
d0ff950
code(feat): Add block store (#458)
ancazamfir Oct 10, 2024
1bde08c
Update Cargo.lock
romac Oct 10, 2024
8923141
Add blocksync protocol initial implementation, wip
ancazamfir Oct 12, 2024
c9b3be3
Add config flag for maximum number of blocks in store
ancazamfir Oct 14, 2024
3dcac6b
Ask for the block only from peer at lower height.
ancazamfir Oct 14, 2024
8460044
Fix mistake in host, should return ReceivedProposedValue and not
ancazamfir Oct 14, 2024
faf7a6e
When processing the synced block use the on_ handlers instead of
ancazamfir Oct 14, 2024
d62969d
When storing the decision look for full proposal at proposal round and
ancazamfir Oct 14, 2024
5910da2
Change max_retain_blocks in config.toml to match the default.
ancazamfir Oct 14, 2024
919bbc0
Set voting power for all vals to 1 for easier debugging.
ancazamfir Oct 14, 2024
fc2e6f4
Use on_vote instead of apply_driver_input so our own commit is stored
ancazamfir Oct 14, 2024
9c8f447
Fix spelling.
ancazamfir Oct 14, 2024
f10126a
Remove lower number of peers (was used for testing).
ancazamfir Oct 15, 2024
615911a
Store the commits in a set to avoid duplicates.
ancazamfir Oct 15, 2024
b75576e
Return if proposal from non-proposer.
ancazamfir Oct 15, 2024
3875867
Add TODO for potential min block height in Status
ancazamfir Oct 15, 2024
7779510
Change max_retain_blocks default to 100.
ancazamfir Oct 15, 2024
1e36445
Small cleanup
romac Oct 16, 2024
907ee98
Work around libp2p bug where a node cannot publish to a topic if rest…
romac Oct 16, 2024
f8a550a
Cleanup
romac Oct 16, 2024
5312644
Ensure validator set is always sorted properly, even after being dese…
romac Oct 16, 2024
1e6671a
Update spawn.fish
romac Oct 16, 2024
fd1e4cd
Merge branch 'main' into blocksync-mvp
romac Oct 16, 2024
b875ae9
Move BlockSyncState to blocksync crate
romac Oct 16, 2024
89e4dff
Add batched request for blocks
romac Oct 16, 2024
0e58823
Fix bug where only a single block would be sent back
romac Oct 16, 2024
8f3b13b
Revert block batching
romac Oct 16, 2024
f908cb5
Merge branch 'main' into blocksync-mvp
romac Oct 16, 2024
b7d344a
Cleanup
romac Oct 16, 2024
3996d24
Remove outdated comment
romac Oct 17, 2024
032ac32
Merge branch 'main' into blocksync-mvp
romac Oct 22, 2024
368e95a
Post-merge fixes
romac Oct 22, 2024
450cae0
Merge branch 'main' into blocksync-mvp
romac Oct 22, 2024
d73904e
Post-merge fix
romac Oct 22, 2024
c519274
Cleanup
romac Oct 22, 2024
585bf5d
chore(code): Extract logic from `BlockSync` actor and into `blocksync…
romac Oct 23, 2024
856324a
Add timeouts to BlockSync requests (#490)
romac Oct 23, 2024
6e320ee
Randomize choice of peer to sync from (#492)
romac Oct 23, 2024
f3e64f6
Add basic integration test (#493)
romac Oct 23, 2024
cd136ba
Re-enable mempool in integration test
romac Oct 23, 2024
968ec63
Merge branch 'main' into blocksync-mvp
romac Oct 23, 2024
0099ef6
Add config option `blocksync.enabled`
romac Oct 24, 2024
93ffe6e
Send back actual block bytes instead of just the block hash
romac Oct 25, 2024
d4373b0
Merge branch 'main' into blocksync-mvp
romac Oct 25, 2024
13b9722
Fix example config file
romac Oct 25, 2024
11a525c
test(code/blocksync): Introduce small DSL for expressing test scenari…
romac Oct 28, 2024
2ea6122
Update MSRV to 1.82
romac Oct 28, 2024
6d657cb
feat(code/blocksync): Only request sync from peers which have the req…
romac Oct 28, 2024
87bbce0
Merge branch 'main' into blocksync-mvp
romac Oct 28, 2024
9309c18
Merge branch 'main' into blocksync-mvp
romac Oct 29, 2024
ecf855b
Update clippy msrv
romac Oct 29, 2024
5b86300
Merge branch 'main' into blocksync-mvp
romac Oct 30, 2024
fc531e8
Merge branch 'main' into blocksync-mvp
romac Oct 30, 2024
86fe96c
Add metrics
romac Oct 30, 2024
6e5ee02
Ensure Consensus and BlockSync actors never fail
romac Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ on:
- specs/quint/**
- .github/workflows/coverage.yml

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_RELEASE_DEBUG: 1
RUST_BACKTRACE: short
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10

jobs:
integration:
name: Integration
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -36,17 +43,16 @@ jobs:
with:
toolchain: nightly
components: llvm-tools-preview
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: |
cargo llvm-cov nextest \
cargo llvm-cov test \
--workspace \
--exclude malachite-test-mbt \
--ignore-filename-regex crates/cli \
--all-features \
--jobs 1 \
--ignore-run-fail \
--lcov \
--output-path lcov.info
Expand Down
37 changes: 33 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_RELEASE_DEBUG: 1
RUST_BACKTRACE: short
Expand All @@ -23,7 +24,7 @@ env:

jobs:
test:
name: Test
name: Unit Tests
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -47,10 +48,38 @@ jobs:
cache-workspaces: "code"
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Build code
run: cargo nextest run --workspace --all-features --no-run
- name: Run tests
run: cargo nextest run --workspace --all-features --no-fail-fast --failure-output final
run: cargo nextest run --workspace --all-features --no-fail-fast --failure-output final --test-threads 1 --exclude malachite-starknet-test --exclude malachite-discovery-test

integration:
name: Integration Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Quint
run: npm install -g @informalsystems/quint
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: "code"
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Run Starknet tests
run: cargo nextest run --all-features --no-fail-fast --failure-output final --test-threads 1 -p malachite-starknet-test
- name: Run Discovery tests
run: cargo nextest run --all-features --no-fail-fast --failure-output final --test-threads 1 -p malachite-discovery-test

clippy:
name: Clippy
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Code coverage][coverage-image]][coverage-link]
[![Apache 2.0 Licensed][license-image]][license-link]
![Rust Stable][rustc-image]
![Rust 1.74+][rustc-version]
![Rust 1.82+][rustc-version]
[![Quint 0.18][quint-version]][quint-repo]

Tendermint consensus in Rust
Expand All @@ -21,7 +21,7 @@ The repository is split in three areas, each covering one of the important areas

## Requirements

- Rust v1.74+ ([rustup.rs](https://rustup.rs))
- Rust v1.82+ ([rustup.rs](https://rustup.rs))
- Quint v0.18+ ([github.com](https://github.com/informalsystems/quint))

## License
Expand All @@ -46,6 +46,6 @@ Unless required by applicable law or agreed to in writing, software distributed
[license-image]: https://img.shields.io/badge/license-Apache_2.0-blue.svg
[license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE
[rustc-image]: https://img.shields.io/badge/Rust-stable-orange.svg
[rustc-version]: https://img.shields.io/badge/Rust-1.74+-orange.svg
[rustc-version]: https://img.shields.io/badge/Rust-1.82+-orange.svg
[quint-version]: https://img.shields.io/badge/Quint-0.18-purple.svg
[quint-repo]: https://github.com/informalsystems/quint
Loading
Loading