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

[stateless_validation] Allow sending partial witness to self #12026

Merged

Conversation

shreyan-gupta
Copy link
Contributor

@shreyan-gupta shreyan-gupta commented Aug 30, 2024

Follow up on #12022

This PR removes the special case handling for sending partial witnesses to owners where we are one of the owners.

Before this we had special case handling storing and sending partial witness if we were the owner of a specific partial witness part.

@shreyan-gupta shreyan-gupta added the A-stateless-validation Area: stateless validation label Aug 31, 2024
@shreyan-gupta shreyan-gupta marked this pull request as ready for review August 31, 2024 00:05
@shreyan-gupta shreyan-gupta requested a review from a team as a code owner August 31, 2024 00:05
Copy link

codecov bot commented Aug 31, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 71.53%. Comparing base (e932751) to head (0aba6e0).
Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
...alidation/partial_witness/partial_witness_actor.rs 73.33% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12026      +/-   ##
==========================================
- Coverage   71.53%   71.53%   -0.01%     
==========================================
  Files         814      814              
  Lines      164514   164507       -7     
  Branches   164514   164507       -7     
==========================================
- Hits       117689   117677      -12     
- Misses      41659    41665       +6     
+ Partials     5166     5165       -1     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (+<0.01%) ⬆️
db-migration 0.17% <0.00%> (+<0.01%) ⬆️
genesis-check 1.28% <0.00%> (+<0.01%) ⬆️
integration-tests 38.58% <73.33%> (+<0.01%) ⬆️
linux 71.20% <73.33%> (-0.02%) ⬇️
linux-nightly 71.12% <73.33%> (+<0.01%) ⬆️
macos 54.19% <73.33%> (+0.01%) ⬆️
pytests 1.54% <0.00%> (+<0.01%) ⬆️
sanity-checks 1.34% <0.00%> (+<0.01%) ⬆️
unittests 65.48% <73.33%> (-0.01%) ⬇️
upgradability 0.21% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if validate_partial_encoded_state_witness(
self.epoch_manager.as_ref(),
&partial_witness,
&signer,
&self.store,
)? {
// Store the partial encoded state witness for self.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is no longer needed because we anticipate receiving via self-message instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

.store_partial_encoded_state_witness(partial_witness.clone())?;
// Forward the part to all the chunk validators.
self.forward_state_witness_part(partial_witness, &signer)?;
self.forward_state_witness_part(partial_witness)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any concern that we will forward the part twice (or even infinitely many times) because self-sending triggers it?

Copy link
Contributor Author

@shreyan-gupta shreyan-gupta Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that should be the case as we only call the forward function for handling PartialEncodedStateWitnessMessage (and not PartialEncodedStateWitnessForwardMessage).

Logically, it's a one way stream, PartialEncodedStateWitnessMessage -> forward -> PartialEncodedStateWitnessForwardMessage -> store

Base automatically changed from shreyan/stateless_validation/endorsement_to_self to master September 3, 2024 17:35
@saketh-are saketh-are self-requested a review September 9, 2024 20:47
@shreyan-gupta shreyan-gupta added this pull request to the merge queue Sep 9, 2024
Merged via the queue into master with commit 10f0d1e Sep 9, 2024
28 of 29 checks passed
@shreyan-gupta shreyan-gupta deleted the shreyan/stateless_validation/partial_witness_to_self branch September 9, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants