-
Notifications
You must be signed in to change notification settings - Fork 84
[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
BrendanChou
wants to merge
41
commits into
main
Choose a base branch
from
bc/814-aggregation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
8000
Show all changes
41 commits
Select commit
Hold shift + click to select a range
eba14b1
impl
BrendanChou 6c2f5dd
add mocks
BrendanChou 92257a9
add test
BrendanChou 4c6d10e
more tests
BrendanChou 694e21c
more tests
BrendanChou 69cba6c
tests
BrendanChou c10b8d1
comments
BrendanChou 77fcdf7
comments
BrendanChou 57cf847
lint
BrendanChou 7725111
more tests
BrendanChou 294911b
comments
BrendanChou 663dd96
tweaks
BrendanChou 2a44b10
tests
BrendanChou 7275266
code review 1
BrendanChou 9a44044
replay fix
BrendanChou c4a0f13
block
BrendanChou ca48e31
nz
BrendanChou f5d54cc
nz duration
BrendanChou 56e2570
comment about threshold
BrendanChou 893edae
test cleanup
BrendanChou 863ee94
fix test
BrendanChou 5b6234e
remove
BrendanChou e1fbe36
fix sig verification
BrendanChou a762dc0
update
BrendanChou e0872c8
remove unused validator mocks
BrendanChou 0dc81e0
fix insufficient_validators test
BrendanChou 9015fc5
better conflicter
BrendanChou b123f01
need longer index
BrendanChou b0ae063
contiguous fix?
BrendanChou 4e5c982
bugfix: react
BrendanChou bcf2f6d
fix off-by-one and pruning issues
BrendanChou 391d000
fix test ordering
BrendanChou 9412346
fix mocks/tests for slow/lossy
BrendanChou 840e00f
Lock -> Recovered
BrendanChou cab3d46
renames
BrendanChou ce19814
update docs
BrendanChou 240b42e
update tests
BrendanChou 4a12128
nits
BrendanChou c2dd57c
fix unclean shutdown test
BrendanChou a14e04d
fix lint
BrendanChou 921acd6
remove unused function
BrendanChou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.