Skip to content

Commit 016f177

Browse files
cleanup
1 parent 177d567 commit 016f177

8 files changed

Lines changed: 468 additions & 322 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ license = "MIT OR Apache-2.0"
2020
alto-chain = { version = "2026.3.0", path = "chain" }
2121
alto-client = { version = "2026.3.0", path = "client" }
2222
alto-types = { version = "2026.3.0", path = "types" }
23-
commonware-actor = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
24-
commonware-broadcast = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
25-
commonware-codec = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
26-
commonware-consensus = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
27-
commonware-cryptography = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
28-
commonware-deployer = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124", default-features = false }
29-
commonware-formatting = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
30-
commonware-macros = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
31-
commonware-p2p = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
32-
commonware-resolver = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
33-
commonware-runtime = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
34-
commonware-storage = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
35-
commonware-stream = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
36-
commonware-utils = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
37-
commonware-math = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
38-
commonware-parallel = { git = "https://github.com/commonwarexyz/monorepo", rev = "86f9be7c6339339b37a420eed7ef640164999124" }
23+
commonware-actor = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
24+
commonware-broadcast = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
25+
commonware-codec = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
26+
commonware-consensus = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
27+
commonware-cryptography = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
28+
commonware-deployer = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985", default-features = false }
29+
commonware-formatting = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
30+
commonware-macros = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
31+
commonware-p2p = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
32+
commonware-resolver = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
33+
commonware-runtime = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
34+
commonware-storage = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
35+
commonware-stream = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
36+
commonware-utils = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
37+
commonware-math = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
38+
commonware-parallel = { git = "https://github.com/commonwarexyz/monorepo", rev = "325c42c643b8a43ee2d14387d8bc9771d7a40985" }
3939
thiserror = "2.0.12"
4040
bytes = "1.7.1"
4141
rand = "0.8.5"

chain/src/application.rs

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -155,42 +155,8 @@ impl<E: Clock + Storage + Metrics + Spawner> Reporter for Application<E> {
155155
#[cfg(test)]
156156
mod tests {
157157
use super::*;
158+
use commonware_consensus::marshal::ancestry;
158159
use commonware_runtime::{deterministic, Runner as _, Supervisor as _};
159-
use futures::Stream;
160-
use std::{
161-
collections::VecDeque,
162-
pin::Pin,
163-
task::{Context as TaskContext, Poll},
164-
};
165-
166-
struct TestAncestry {
167-
blocks: VecDeque<Block>,
168-
}
169-
170-
impl TestAncestry {
171-
fn new(blocks: impl IntoIterator<Item = Block>) -> Self {
172-
Self {
173-
blocks: blocks.into_iter().collect(),
174-
}
175-
}
176-
}
177-
178-
impl Stream for TestAncestry {
179-
type Item = Block;
180-
181-
fn poll_next(
182-
mut self: Pin<&mut Self>,
183-
_: &mut TaskContext<'_>,
184-
) -> Poll<Option<Self::Item>> {
185-
Poll::Ready(self.blocks.pop_front())
186-
}
187-
}
188-
189-
impl Ancestry<Block> for TestAncestry {
190-
fn peek(&self) -> Option<&Block> {
191-
self.blocks.front()
192-
}
193-
}
194160

195161
fn test_context(view: u64, parent: (View, sha256::Digest)) -> Context {
196162
Context {
@@ -212,7 +178,7 @@ mod tests {
212178
block: &Block,
213179
parent: &Block,
214180
) -> bool {
215-
let ancestry = TestAncestry::new([block.clone(), parent.clone()]);
181+
let ancestry = ancestry::from_iter([block.clone(), parent.clone()]);
216182
commonware_consensus::Application::verify(
217183
application,
218184
(context, block.context.clone()),
@@ -227,7 +193,7 @@ mod tests {
227193
child_context: Context,
228194
parent: &Block,
229195
) -> Block {
230-
let ancestry = TestAncestry::new([parent.clone()]);
196+
let ancestry = ancestry::from_iter([parent.clone()]);
231197
commonware_consensus::Application::propose(application, (context, child_context), ancestry)
232198
.await
233199
.expect("expected proposal")

chain/src/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ where
430430
// Start marshal
431431
let marshal_handle = self
432432
.marshal
433-
.start(self.marshaled, Some(self.buffer_mailbox), marshal);
433+
.start(self.marshaled, self.buffer_mailbox, marshal);
434434

435435
// Start draining queued block uploads before consensus so recovered work
436436
// resumes immediately on startup.

follower/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ description = "Run a follower node for alto."
88
[dependencies]
99
alto-client = { workspace = true }
1010
alto-types = { workspace = true }
11-
commonware-broadcast = { workspace = true }
1211
commonware-actor = { workspace = true }
1312
commonware-codec = { workspace = true }
1413
commonware-consensus = { workspace = true }
1514
commonware-cryptography = { workspace = true }
1615
commonware-formatting = { workspace = true }
1716
commonware-macros = { workspace = true }
1817
commonware-math = { workspace = true }
19-
commonware-p2p = { workspace = true }
2018
commonware-resolver = { workspace = true }
2119
commonware-runtime = { workspace = true }
2220
commonware-storage = { workspace = true }

follower/src/engine.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
resolver::Resolver,
77
};
88
use alto_types::{Block, Context, Scheme, EPOCH, EPOCH_LENGTH};
9-
use commonware_broadcast::buffered;
109
use commonware_consensus::{
1110
marshal::{
1211
self,
@@ -18,7 +17,7 @@ use commonware_consensus::{
1817
};
1918
use commonware_cryptography::{
2019
certificate::ConstantProvider,
21-
ed25519::{PrivateKey, PublicKey},
20+
ed25519::PrivateKey,
2221
sha256::{self, Digest, Sha256},
2322
Digest as _, Hasher, Signer,
2423
};
@@ -111,7 +110,11 @@ where
111110
max_repair: NonZero<usize>,
112111
strategy: T,
113112
pruning_depth: Option<u64>,
114-
) -> (Self, MarshalMailbox<Scheme, Standard<Block>>, Height) {
113+
) -> (
114+
Self,
115+
MarshalMailbox<Scheme, Standard<Block>>,
116+
Option<Height>,
117+
) {
115118
// Initialize the finalized certificate and block archives. Uses
116119
// prunable archives when pruning is enabled, immutable otherwise.
117120
let (finalizations_by_height, finalized_blocks, page_cache) =
@@ -171,11 +174,7 @@ where
171174
let app_handle = app.start();
172175

173176
// Start marshal
174-
let marshal_handle = self.marshal.start(
175-
mailbox,
176-
None::<buffered::Mailbox<PublicKey, Block>>,
177-
marshal,
178-
);
177+
let marshal_handle = self.marshal.start_unbuffered(mailbox, marshal);
179178

180179
// Wait for any actor to finish
181180
if let Err(e) = try_join_all(vec![marshal_handle, app_handle]).await {

follower/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fn main() {
209209
// On the first run (no previously synced data), optionally skip to the
210210
// latest finalized height so the follower starts near tip instead of
211211
// backfilling from genesis.
212-
if config.tip && last_processed_height == Height::zero() {
212+
if config.tip && last_processed_height.is_none_or(|height| height == Height::zero()) {
213213
match client.finalized_get(IndexQuery::Latest).await {
214214
Ok(finalized) => {
215215
assert!(

0 commit comments

Comments
 (0)