Skip to content

Commit a9ce46b

Browse files
committed
Merge remote-tracking branch 'origin/main' into bohdan/p2p-metrics
2 parents aeaa971 + 8963dcf commit a9ce46b

17 files changed

Lines changed: 2644 additions & 51 deletions

File tree

.githooks/pre-push

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
#!/bin/sh
2-
set -e
1+
#!/usr/bin/env bash
32

4-
# Dependency sorting
5-
if ! cargo sort --workspace --check; then
6-
echo "❌ Dependencies should be sorted (run 'cargo sort --workspace')"
7-
exit 1
8-
fi
3+
set -e
94

105
# Dependency audit
116
if ! cargo deny check; then
@@ -19,12 +14,6 @@ if ! cargo +nightly fmt --all -- --check; then
1914
exit 3
2015
fi
2116

22-
# Typo check
23-
if ! typos; then
24-
echo "❌ Spelling mistakes found (run 'typos --write-changes')"
25-
exit 4
26-
fi
27-
2817
# Linting
2918
if ! cargo clippy --all-targets --all-features -- -D warnings; then
3019
echo "❌ Clippy violations (check warnings above)"

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ git config commit.gpgsign true
1111
## Prerequisites
1212

1313
* [Rust](https://www.rust-lang.org/tools/install)
14+
* [Protobuf](https://protobuf.dev/installation/)
1415
* [cargo deny](https://github.com/EmbarkStudios/cargo-deny)
15-
* [typos](https://github.com/crate-ci/typos?tab=readme-ov-file#install)
16-
* [cargo sort](https://github.com/DevinR528/cargo-sort)
1716

1817
## Code quality assurance
1918

@@ -49,15 +48,15 @@ Criterion is still recommended for more rigorous statistical analysis, but Divan
4948
For performance, the profiling cycle is a 3-step process in which you need to first measure the resources consumed by your application, then isolate the most consuming ones, and finally optimize them.
5049
This cycle repeats until the performance goals are met.
5150
To carry out this optimization cycle, we recommend the following profiling tools, as they are powerful, general-purpose, and are either written or well integrated with Rust:
52-
* [Hyperfine](https://crates.io/crates/hyperfine): Provides a simple CLI interface that allows us to benchmark compiled binaries.
53-
* [Samply](https://crates.io/crates/samply): Generates a detailed graphic of the different operations and their time in the application. We recommend it over [FlameGraph](https://crates.io/crates/flamegraph) as it allows for filtering, and the webserver viewer provides a better experience than the `.svg` your get from Flamegraph.
51+
* [Hyperfine](https://crates.io/crates/hyperfine): Provides a simple CLI interface that allows us to benchmark compiled binaries.
52+
* [Samply](https://crates.io/crates/samply): Generates a detailed graphic of the different operations and their time in the application. We recommend it over [FlameGraph](https://crates.io/crates/flamegraph) as it allows for filtering, and the webserver viewer provides a better experience than the `.svg` your get from Flamegraph.
5453
* [Dhat](https://crates.io/crates/dhat): Measures memory allocations within the application.
5554

5655
### Hyperfine
5756

5857
Once [installed](https://github.com/sharkdp/hyperfine?tab=readme-ov-file#installation), we can simply run:
5958
```sh
60-
hyperfine 'TODO(template) update with your binary e.g. ./target/release/...'
59+
hyperfine 'TODO(template) update with your binary e.g. ./target/release/...'
6160
```
6261
### Samply
6362

@@ -84,7 +83,7 @@ Then, we can run:
8483
```sh
8584
samply record 'TODO(template) update with your binary e.g. ./target/release/...'
8685
```
87-
This command will open a browser page that contains a graphic representation of where the time is being spent in our application.
86+
This command will open a browser page that contains a graphic representation of where the time is being spent in our application.
8887

8988
### Dhat
9089
We can add Dhat as a dependency:
@@ -114,4 +113,4 @@ But these 3 should be enough for the average application to identify bottlenecks
114113

115114
For async-rust we also recommend: [Tracing](https://crates.io/crates/tracing), [Tokio-Console](https://crates.io/crates/tokio-console), and [Oha](https://crates.io/crates/oha).
116115
For Rayon-based parallel Rust code, we recommend Samply.
117-
It provides good profiling despite missing some multithreading details.
116+
It provides good profiling despite missing some multithreading details.

Cargo.lock

Lines changed: 52 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,28 @@ publish = false
2424

2525
[workspace.dependencies]
2626
axum = "0.8.6"
27+
blst = "0.3.13"
28+
cancellation = "0.1.0"
2729
chrono = { version = "0.4", features = ["serde"] }
30+
crossbeam = "0.8.4"
2831
hex = { version = "^0.4.3" }
29-
serde = { version = "1.0", features = ["derive"] }
30-
serde_json = { version = "^1.0" }
31-
tokio = { version = "1", features = ["full"] }
32-
libp2p = { version = "0.56", features = ["full", "secp256k1"] }
3332
prost = "0.14"
34-
prost-types = "0.14"
3533
prost-build = "0.14"
36-
blst = "0.3.13"
34+
prost-types = "0.14"
35+
rand = { version = "0.8", features = ["std_rng"] }
3736
rand_core = "0.6"
37+
serde = { version = "1.0", features = ["derive"] }
38+
serde_json = { version = "^1.0" }
3839
thiserror = "2.0.12"
39-
rand = {version = "0.8", features = ["std_rng"]}
40-
uuid = {version = "1.16", features = ["serde", "v4"] }
40+
tokio = { version = "1", features = ["full"] }
41+
libp2p = { version = "0.56", features = ["full", "secp256k1"] }
42+
uuid = { version = "1.16", features = ["serde", "v4"] }
4143
serde_with = { version = "3", features = ["hex", "base64"] }
4244
base64 = { version = "0.22.1" }
4345
sha3 = { version = "0.10.8" }
4446
k256 = { version = "0.13.4", features = ["ecdsa", "sha256"] }
4547
criterion = "0.7.0"
48+
tempfile = "3.10.0"
4649
tracing = "0.1.32"
4750
tracing-subscriber = { version = "0.3.9", features = ["env-filter"] }
4851
tracing-loki = "0.2.6"

crates/charon-core/Cargo.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,19 @@ license.workspace = true
77
publish.workspace = true
88

99
[dependencies]
10+
cancellation.workspace = true
11+
chrono.workspace = true
12+
crossbeam.workspace = true
13+
hex.workspace = true
1014
serde.workspace = true
1115
serde_json.workspace = true
16+
thiserror.workspace = true
17+
libp2p.workspace = true
18+
prost.workspace = true
19+
prost-types.workspace = true
20+
21+
[dev-dependencies]
22+
rand.workspace = true
1223
libp2p.workspace = true
1324
prost.workspace = true
1425
prost-types.workspace = true
@@ -19,4 +30,4 @@ chrono.workspace = true
1930
charon-build-proto.workspace = true
2031

2132
[lints]
22-
workspace = true
33+
workspace = true

crates/charon-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! This crate provides the fundamental building blocks, data structures, and
55
//! core algorithms used throughout the Charon system.
66
7+
pub mod qbft;
78
/// Types for the Charon core.
89
pub mod types;
910

0 commit comments

Comments
 (0)