-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stateless_validation] Include chunk_endorsement signatures in block …
…body (#10469) ## Chunk endorsements signatures in block This PR writes the logic to include chunk endorsement signatures in block. We tap into the logic in chunk_inclusion_tracker to filter out chunks that don't have enough endorsed signatures. In case of missing chunk, just like we borrow chunk headers from previous block, we also borrow the chunk endorsement signatures corresponding to the chunk from the previous block. ## Changes to ChunkInclusionTracker Updated the ChunkInclusionTracker module to have an LRU cache for `prev_block_to_chunk_headers_ready_for_inclusion` + HashMap for chunk hash to random info associated with the chunk. This is a two step indirection, and we handle cleaning up the `chunk_hash_to_chunk_info` during cache eviction. Additionally, call to `get_chunk_headers_ready_for_inclusion` now returns just the chunk hash instead of all the random details for the chunk and we can make subsequent calls to chunk_inclusion_tracker to get the other chunk related info like header, signatures, time included etc. Added filter `chunk_validator.get_chunk_endorsement_signature(&chunk_info.chunk_header)` to reject chunks that don't have enough chunk endorsements. Note that this is behind a feature flag. ## Getting chunk endorsement signatures Added `get_chunk_endorsement_signature` function to chunk validator module. We use the cached chunk endorsements stored in calls to `process_chunk_endorsement` to get the set of signatures. If we don't have enough stake endorsed, we return None, else we return the signature array. TODO: Update/fix tests.
- Loading branch information
Shreyan Gupta
authored
Jan 24, 2024
1 parent
1367881
commit 3b3b54b
Showing
9 changed files
with
274 additions
and
84 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.