-
Notifications
You must be signed in to change notification settings - Fork 676
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
[stateless_validation] Add testing for handling state witness and chunk endorsements #10504
[stateless_validation] Add testing for handling state witness and chunk endorsements #10504
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #10504 +/- ##
==========================================
+ Coverage 71.97% 72.00% +0.03%
==========================================
Files 720 720
Lines 146260 146265 +5
Branches 146260 146265 +5
==========================================
+ Hits 105264 105322 +58
+ Misses 36163 36117 -46
+ Partials 4833 4826 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
) = msg | ||
{ | ||
chunk_hashes.remove(endorsement.chunk_hash()); | ||
for network_adapter in network_adapters.iter() { |
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.
nit: you can replace network_adapters.iter() with &network_adapters
&mut self, | ||
mut chunk_hashes: HashMap<ChunkHash, (BlockHeight, ShardId)>, | ||
chunk_hash_to_account_ids: &mut HashMap<ChunkHash, HashSet<AccountId>>, |
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.
do you need this to be a &mut? Could you take the whole object by ownership?
) { | ||
let _span = tracing::debug_span!(target: "test", "get_all_chunk_endorsements").entered(); | ||
let network_adapters = self.network_adapters.clone(); |
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.
Do we actually need to clone this?
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.
Yes as otherwise we would hold a mut reference to self within the loop. rustc wasn't happy
…10507) This PR uncomments two checks - We now filter chunks based on whether they have enough stake endorsed or not. - We validate chunk endorsements in block header. Enabling this breaks a bunch of tests mainly for two reasons - Some tests are handled by mocking out parts/doing manual block production which doesn't take care of chunk endorsement signatures - A number of tests that work with multiple validators don't have the appropriate network request handlers for chunk endorsement and state witness processing. These tests are impossible to explore and fix in a single PR and I've created a task list to help with this here: #10506 Note that we need to merge in the changes from #10501 , #10503 and #10504 before we can merge this. Till then probably the tests would keep failing Tip: Probably a good idea to review PR commit by commit
This PR improves the testing infrastructure for stateless validation to handle cases of network message propagation of
ChunkStateWitness
andChunkEndorsement
.With the changes in validation of signature in chunk header, we need to handle
ChunkEndorsement
messages at the time of block production.