-
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
[execution window] blocks support a window, along with block storage and sync #14076
base: main
Are you sure you want to change the base?
Conversation
1aa6615
to
f4d9e6a
Compare
f4d9e6a
to
900d4d3
Compare
900d4d3
to
8cf4526
Compare
8cf4526
to
4301028
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3bf2da1
to
bd733dd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a17b775
to
be71569
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
be71569
to
7a3647b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7a3647b
to
c1891f5
Compare
6c62b13
to
d9fa122
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
BlockRetrievalRequest: | ||
ENUM: | ||
0: | ||
V1: | ||
NEWTYPE: | ||
TYPENAME: BlockRetrievalRequestV1 | ||
1: | ||
V2: | ||
NEWTYPE: | ||
TYPENAME: BlockRetrievalRequestV2 | ||
BlockRetrievalRequestV1: | ||
STRUCT: | ||
- block_id: | ||
TYPENAME: HashValue | ||
- num_blocks: U64 | ||
- target_block_id: | ||
OPTION: | ||
TYPENAME: HashValue | ||
BlockRetrievalRequestV2: | ||
STRUCT: | ||
- block_id: | ||
TYPENAME: HashValue | ||
- num_blocks: U64 | ||
- target_epoch_and_round: | ||
OPTION: | ||
TUPLEARRAY: | ||
CONTENT: U64 | ||
SIZE: 2 |
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.
TODO Double check if this is OK
d9fa122
to
5579de6
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Did a first pass. I will take another pass.
alg: ConsensusAlgorithmConfig, | ||
vtxn: ValidatorTxnConfig, | ||
// Execution pool block window | ||
window_size: usize, |
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.
Shouldn't this be part of OnchainExecutionConfig
?
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 suppose there's a semantic argument for whether it should be in the OnChainConsensusConfig
or the OnchainExecutionConfig
. Ultimately the BlockStore
needs to get access to the window_size
, and the BlockStore
is used in Consensus. So putting it in OnChainConsensusConfig
makes sense.
Cc @bchocho
let root_block = blocks.remove(root_idx); | ||
.position(|block| block.id() == latest_commit_id) | ||
.ok_or_else(|| format_err!("unable to find root: {}", latest_commit_id))?; | ||
let commit_block = blocks[latest_commit_idx].clone(); | ||
let root_quorum_cert = quorum_certs |
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.
let root_quorum_cert = quorum_certs | |
let commit_blk_quorum_cert = quorum_certs |
let mut id_to_blocks = HashMap::new(); | ||
blocks.iter().for_each(|block| { | ||
id_to_blocks.insert(block.id(), block); | ||
}); |
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.
let mut id_to_blocks = HashMap::new(); | |
blocks.iter().for_each(|block| { | |
id_to_blocks.insert(block.id(), block); | |
}); | |
let id_to_blocks: HashMap<_, _> = blocks.iter().map(|block| (block.id(), block)).collect(); |
root_commit_cert, | ||
)) | ||
|
||
let window_start_round = blocks[latest_commit_idx] |
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.
This round may not necessarily exist right? Probably timed out. Also, some blocks between can be missing too. So, this may not be the actual start round?
Do we calculate the window based on consecutive round numbers? or do we calculate based on successful blocks?
@@ -576,22 +629,23 @@ impl BlockRetriever { | |||
.boxed(), | |||
) | |||
} | |||
let request = BlockRetrievalRequest::new_with_target_block_id( | |||
let request = BlockRetrievalRequest::new_with_target_round( |
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 cannot make this change until we have rolled out the new BlockRetievalRequestV2 handling logic in a release. This should go in a future release after that one.
…store and persistent_liveness_storage. Also adds OrderedBlockWindow into PipelinedBlock. Actual execution of the block will be added to a separate PR.
## Description This PR includes a set of unit tests and test utilities for the execution window changes covered in [`brian/exec-window-base`](#14076)
…date consensus.yaml for target_block_and_round
5579de6
to
375c1d4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
375c1d4
to
5132e5c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5132e5c
to
aad1f51
Compare
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
Description
The main purpose of this PR is to enhance block retrieval and pipeline execution by adding a window of blocks (
OrderedBlockWindow
) to thePipelinedBlock
. It also refines the block retrieval mechanism by introducingtarget_epoch_and_round
fields for better compatibility and logging improvements.The recent changes in this PR are:
consensus/consensus-types/src/block_retrieval.rs
:target_epoch_and_round
field and corresponding methods toBlockRetrievalRequest
.Updated
BlockRetrievalResponse
to usetarget_epoch_and_round
instead oftarget_block_id
.consensus/consensus-types/src/pipelined_block.rs
:OrderedBlockWindow
struct.block_window
field toPipelinedBlock
.block_window
.Test Plan
BlockStore
andblock_window
during pruning and other operations.OnChainConsensusConfig
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Key Areas to Review
Checklist