10000 [consensus] Add `consensus::aggregation` by BrendanChou · Pull Request #974 · commonwarexyz/monorepo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[consensus] Add consensus::aggregation #974

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

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits 8000
Show all changes
41 commits
Select commit Hold shift + click to select a range
eba14b1
impl
BrendanChou Jun 10, 2025
6c2f5dd
add mocks
BrendanChou Jun 10, 2025
92257a9
add test
BrendanChou Jun 10, 2025
4c6d10e
more tests
BrendanChou Jun 10, 2025
694e21c
more tests
BrendanChou Jun 11, 2025
69cba6c
tests
BrendanChou Jun 11, 2025
c10b8d1
comments
BrendanChou Jun 11, 2025
77fcdf7
comments
BrendanChou Jun 11, 2025
57cf847
lint
BrendanChou Jun 17, 2025
7725111
more tests
BrendanChou Jun 17, 2025
294911b
comments
BrendanChou Jun 17, 2025
663dd96
tweaks
BrendanChou Jun 17, 2025
2a44b10
tests
BrendanChou Jun 17, 2025
7275266
code review 1
BrendanChou Jun 17, 2025
9a44044
replay fix
BrendanChou Jun 17, 2025
c4a0f13
block
BrendanChou Jun 17, 2025
ca48e31
nz
BrendanChou Jun 17, 2025
f5d54cc
nz duration
BrendanChou Jun 17, 2025
56e2570
comment about threshold
BrendanChou Jun 17, 2025
893edae
test cleanup
BrendanChou Jun 18, 2025
863ee94
fix test
BrendanChou Jun 26, 2025
5b6234e
remove
BrendanChou Jun 27, 2025
e1fbe36
fix sig verification
BrendanChou Jun 27, 2025
a762dc0
update
BrendanChou Jun 27, 2025
e0872c8
remove unused validator mocks
BrendanChou Jun 27, 2025
0dc81e0
fix insufficient_validators test
BrendanChou Jun 27, 2025
9015fc5
better conflicter
BrendanChou Jun 27, 2025
b123f01
need longer index
BrendanChou Jun 27, 2025
b0ae063
contiguous fix?
BrendanChou Jun 27, 2025
4e5c982
bugfix: react
BrendanChou Jun 27, 2025
bcf2f6d
fix off-by-one and pruning issues
BrendanChou Jun 30, 2025
391d000
fix test ordering
BrendanChou Jun 30, 2025
9412346
fix mocks/tests for slow/lossy
BrendanChou Jun 30, 2025
840e00f
Lock -> Recovered
BrendanChou Jun 30, 2025
cab3d46
renames
BrendanChou Jun 30, 2025
ce19814
update docs
BrendanChou Jun 30, 2025
240b42e
update tests
BrendanChou Jun 30, 2025
4a12128
nits
BrendanChou Jul 2, 2025
c2dd57c
fix unclean shutdown test
BrendanChou Jul 2, 2025
a14e04d
fix lint
BrendanChou Jul 2, 2025
921acd6
remove unused function
BrendanChou Jul 3, 2025
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
74 changes: 74 additions & 0 deletions consensus/src/aggregation/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
use super::types::{Activity, Epoch, Index};
use crate::{Automaton, Monitor, Reporter, ThresholdSupervisor};
use commonware_cryptography::{bls12381::primitives::variant::Variant, Digest};
use commonware_p2p::Blocker;
use commonware_utils::{Array, NonZeroDuration};
use std::num::{NonZeroU64, NonZeroUsize};

/// Configuration for the [Engine](super::Engine).
pub struct Config<
P: Array,
V: Variant,
D: Digest,
A: Automaton<Context = Index, Digest = D>,
Z: Reporter<Activity = Activity<V, D>>,
M: Monitor<Index = Epoch>,
B: Blocker<PublicKey = P>,
TSu: ThresholdSupervisor<Index = Epoch, PublicKey = P>,
> {
/// Tracks the current state of consensus (to determine which participants should
/// be involved in the current broadcast attempt).
pub monitor: M,

/// Manages the set of validators and the group identity.
/// Also manages the cryptographic partial share if the engine is a validator.
pub validators: TSu,

/// Proposes and verifies digests.
pub automaton: A,

/// Notified when a chunk receives a threshold of acks.
pub reporter: Z,

/// Blocker for the network.
///
/// Blocking is handled by [commonware_p2p].
pub blocker: B,

/// The application namespace used to sign over different types of messages.
/// Used to prevent replay attacks on other applications.
pub namespace: Vec<u8>,

/// Whether acks are sent as priority.
pub priority_acks: bool,

/// How often an ack is rebroadcast to all validators if no threshold is reached.
pub rebroadcast_timeout: NonZeroDuration,

/// A tuple representing the epochs to keep in memory.
/// The first element is the number of old epochs to keep.
/// The second element is the number of future epochs to accept.
///
/// For example, if the current epoch is 10, and the bounds are (1, 2), then
/// epochs 9, 10, 11, and 12 are kept (and accepted);
/// all others are pruned or rejected.
pub epoch_bounds: (u64, u64),

/// The concurrent number of chunks to process.
pub window: NonZeroU64,

/// Partition for the journal.
pub partition: String,

/// The size of the write buffer to use for each blob in the journal.
pub journal_write_buffer: NonZeroUsize,

/// Number of bytes to buffer when replaying a journal.
pub journal_replay_buffer: NonZeroUsize,

/// The number of entries to keep per journal section.
pub journal_heights_per_section: NonZeroU64,

/// Compression level for the journal.
pub journal_compression: Option<u8>,
}
Loading
Loading
0