-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Quorum Store] Implementation of quorum store components #6055
Changes from 250 commits
c97f66f
3c0adf5
4baff03
cd664e3
04422a9
e5d0eb8
6202909
91d16a0
016677e
351a062
aca53f9
b0308eb
487975d
cd0cb7f
4e3cc5e
e108bed
32c0c7d
6f01d67
bbffe5f
abed4b3
66b5720
785759a
a89fcdf
801393f
9a21bb5
68659b0
775494a
04d23b7
d4313ff
36e0818
e91acf4
c8ec6f0
8196c4b
e2f7e11
bd0ea25
99dafd1
1248ed0
246ad6b
eb480f8
9b29b08
41ecafc
7b21541
229d7ff
1adfaa1
f68c225
9da55f4
acf8353
27acb22
6877ffe
79c6795
d6cc33f
d4d13f9
f9e85c3
bf1b8d3
9158b56
1271079
d3223fd
0fd6982
c34ba26
20e36ca
6393490
2add524
1776f4e
04a4163
dacd451
b7a1556
a501ca5
84bd1d0
5777f9c
08c2cf0
ad5321c
09dfa09
f4267ad
0cc5e17
083d991
754cedf
c0825b7
1c749da
0e51891
5395b63
dccb79c
bf7dc6f
b92c31f
a7e60a5
e6d8dee
7420196
58295f3
9b01f70
6a92694
31cd140
000168b
50fcff8
31a80af
dbb5c59
13e0bd7
ec9374f
4b9a698
cd3cb36
2390ad1
c25d57c
9df8890
47c7555
2245d13
2f5ad01
fee7830
848eee4
a82ada8
63c4cc5
b1fe287
b9fec28
19ac30b
c19335e
a487d47
e2ffd17
a90e084
0edf8ce
6d6f7dc
625a180
521ae2f
dfb0d9a
11a4b2a
b7406cc
9669e3d
56c554c
f1d8277
97b1c38
7361084
1cea780
d349092
f410f0a
98de606
3ddbee5
1eed335
d2d0970
840b284
383d24a
9f80aad
7b51c8c
75bb8f1
13e04e5
57d0b8c
fd327fe
eff2ab4
896dab0
0883f49
8778191
939ab4e
b566128
ac49162
1e3cbc0
680ecfd
8d1d229
47dc97e
c4a87db
7b28b21
8a10655
9934587
2b4a1c5
50ee113
de2ac8c
919cb36
b311017
230f1f1
38b8457
e119a8e
ee299cc
0461cc3
a8dd235
8f92f8f
a00a8df
c811c30
b32207b
64205c4
ed0ab40
3bf4bad
7966ffa
88d0ffb
d1310de
e4e322c
09eb646
a6f238f
fc3a00e
2b8b839
52e4aa3
8365fd2
9d6bfea
74c0764
d7fb5d9
aeed10a
b931d4b
efed7f5
95aca26
8da5f9a
1004508
98f8b16
7e3b8e1
5c366af
6d01626
e87a9bb
2a1eaa6
cc9eedc
5297114
6e926bd
bc7f367
50ba3fd
acb5413
531cc99
f6d1234
ad45f86
e52b39b
2e64ad8
ea60749
e6d225e
c0d9a3b
801e53a
400e9ce
401ae3b
0901934
19b6cfd
c64fb6c
ba64b3d
7ed3102
44a87ad
f408413
7746750
d12abca
461628c
a551956
d3b5ef9
35118ba
ae160d8
97cf10f
aef1dab
6554cbb
95bd55a
4b6a3cb
088b8ce
795e8ca
278aca6
1e915b1
54bb290
24d4fba
e5cd3a2
976dfbf
4a2ad6f
ce2a170
940b5c5
fc60dc9
22d15ce
fc7cfc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) Aptos | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use aptos_types::block_info::Round; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] | ||
#[serde(default, deny_unknown_fields)] | ||
pub struct QuorumStoreConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add some more comments what are the constants and what are they referring to? for example what channel is "channel_size" here |
||
pub channel_size: usize, | ||
pub proof_timeout_ms: usize, | ||
pub batch_request_num_peers: usize, | ||
pub mempool_pulling_interval: usize, | ||
pub end_batch_ms: u128, | ||
pub max_batch_counts: usize, | ||
pub max_batch_bytes: usize, | ||
pub batch_request_timeout_ms: usize, | ||
/// Used when setting up the expiration time for the batch initation. | ||
pub batch_expiry_round_gap_when_init: Round, | ||
/// Batches may have expiry set for batch_expiry_rounds_gap rounds after the | ||
/// latest committed round, and it will not be cleared from storage for another | ||
/// so other batch_expiry_grace_rounds rounds, so the peers on the network | ||
/// can still fetch the data they fall behind (later, they would have to state-sync). | ||
/// Used when checking the expiration time of the received batch against current logical time to prevent DDoS. | ||
pub batch_expiry_round_gap_behind_latest_certified: Round, | ||
pub batch_expiry_round_gap_beyond_latest_certified: Round, | ||
pub batch_expiry_grace_rounds: Round, | ||
pub memory_quota: usize, | ||
pub db_quota: usize, | ||
pub mempool_txn_pull_max_count: u64, | ||
pub mempool_txn_pull_max_bytes: u64, | ||
pub back_pressure_local_batch_num: usize, | ||
pub num_workers_for_remote_fragments: usize, | ||
} | ||
|
||
impl Default for QuorumStoreConfig { | ||
fn default() -> QuorumStoreConfig { | ||
QuorumStoreConfig { | ||
channel_size: 1000, | ||
proof_timeout_ms: 10000, | ||
batch_request_num_peers: 2, | ||
mempool_pulling_interval: 100, | ||
end_batch_ms: 500, | ||
max_batch_counts: 300, | ||
max_batch_bytes: 1000000, | ||
batch_request_timeout_ms: 10000, | ||
batch_expiry_round_gap_when_init: 100, | ||
batch_expiry_round_gap_behind_latest_certified: 500, | ||
batch_expiry_round_gap_beyond_latest_certified: 500, | ||
batch_expiry_grace_rounds: 5, | ||
memory_quota: 100000000, | ||
db_quota: 10000000000, | ||
mempool_txn_pull_max_count: 300, | ||
mempool_txn_pull_max_bytes: 1000000, | ||
// QS will be backpressured if the remaining local batches is more than this number | ||
back_pressure_local_batch_num: 10, | ||
// number of batch coordinators to handle QS Fragment messages, should be >= 1 | ||
num_workers_for_remote_fragments: 2, | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,7 @@ use aptos_crypto::HashValue; | |
use futures::channel::oneshot; | ||
use std::{fmt, fmt::Formatter}; | ||
|
||
/// Message sent from Consensus to QuorumStore. | ||
pub enum PayloadRequest { | ||
pub enum BlockProposalCommand { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be "GetBlockProposalCommand" ? proposal generator issues this, and then it proposes there. this command prepares the proposal only? |
||
/// Request to pull block to submit to consensus. | ||
GetBlockRequest( | ||
Round, | ||
|
@@ -24,21 +23,30 @@ pub enum PayloadRequest { | |
// callback to respond to | ||
oneshot::Sender<Result<ConsensusResponse>>, | ||
), | ||
/// Request to clean quorum store at commit logical time | ||
CleanRequest(LogicalTime, Vec<HashValue>), | ||
} | ||
|
||
impl fmt::Display for PayloadRequest { | ||
impl fmt::Display for BlockProposalCommand { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { | ||
match self { | ||
PayloadRequest::GetBlockRequest(round, max_txns, max_bytes, excluded, _) => { | ||
BlockProposalCommand::GetBlockRequest(round, max_txns, max_bytes, excluded, _) => { | ||
write!( | ||
f, | ||
"GetBlockRequest [round: {}, max_txns: {}, max_bytes: {} excluded: {}]", | ||
round, max_txns, max_bytes, excluded | ||
) | ||
}, | ||
PayloadRequest::CleanRequest(logical_time, digests) => { | ||
} | ||
} | ||
} | ||
|
||
pub enum CleanCommand { | ||
CleanRequest(LogicalTime, Vec<HashValue>), | ||
} | ||
|
||
impl fmt::Display for CleanCommand { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { | ||
match self { | ||
CleanCommand::CleanRequest(logical_time, digests) => { | ||
write!( | ||
f, | ||
"CleanRequest [epoch: {}, round: {}, digests: {:?}]", | ||
|
@@ -51,6 +59,7 @@ impl fmt::Display for PayloadRequest { | |
} | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum ConsensusResponse { | ||
GetBlockResponse(Payload), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielxiangzl @sasha8 do we want these consensus changes when quorum store is enabled? @igor-aptos would it make sense to make these changes without quorum store at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need larger block size to fully utilize the potential of QS. We can tune these parameters after landing in testnet/production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, we cannot really change these now.
either :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should flip default value back before landing