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

comment overview - don't merge #1

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions mysticeti-core/src/block_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub struct BenchmarkFastPathBlockHandler {
consensus_only: bool,
}

// COMMENT Here the Block limitations are defined
// BenchmarkFastPathBlockHandler can push up to 2x of SOFT_MAX_PROPOSED_PER_BLOCK into block
// So the value here should be chosen so that 2*SOFT_MAX_PROPOSED_PER_BLOCK*TRANSACTION_SIZE
// is lower then the maximum allowed block size in the system
Expand All @@ -80,6 +81,7 @@ impl BenchmarkFastPathBlockHandler {
transaction_time: TransactionTimeMap,
) -> (Self, mpsc::Sender<Vec<Transaction>>) {
let (sender, receiver) = mpsc::channel(1024);
// COMMENT Here the transaction log is written
let transaction_log = TransactionLog::start(config.certified_transactions_log())
.expect("Failed to open certified transaction log for write");

Expand Down
1 change: 1 addition & 0 deletions mysticeti-core/src/commit_observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ impl<H: ProcessedTransactionHandler<TransactionLocator> + Send + Sync> CommitObs
}
}

// COMMENT observe commit events within the consensus system
pub struct SimpleCommitObserver {
#[allow(dead_code)] // will be used later during replay
block_store: BlockStore,
Expand Down
3 changes: 3 additions & 0 deletions mysticeti-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,14 @@ impl PrivateConfig {

impl Print for PrivateConfig {}

// COMMENT StorageDir is a wrapper around a path to a directory where the validator stores its data.
impl StorageDir {
// COMMENT for BenchmarkFastPathBlockHandler
pub fn certified_transactions_log(&self) -> PathBuf {
self.path.join("certified.txt")
}

// COMMENT for validator
pub fn committed_transactions_log(&self) -> PathBuf {
self.path.join("committed.txt")
}
Expand Down
1 change: 1 addition & 0 deletions mysticeti-core/src/consensus/linearizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl CommittedSubDag {
CommittedSubDag::new(*leader_block_ref, blocks, timestamp_ms, commit_data.height)
}

// COMMENT The current implementation uses key, which is not ideal. We can also let the anchor decide on the order.
/// Sort the blocks of the sub-dag by round number. Any deterministic algorithm works.
pub fn sort(&mut self) {
self.blocks.sort_by_key(|x| x.round());
Expand Down