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

chore: send partial witnesses faster #12640

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

chore: send partial witnesses faster #12640

wants to merge 4 commits into from

Conversation

stedfn
Copy link
Contributor

@stedfn stedfn commented Dec 18, 2024

This PR sends the partial witnesses to the corresponding peer immediately as they are created. Previously, sending only started after all of them were created

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.48%. Comparing base (859da4b) to head (7f8bb8f).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12640      +/-   ##
==========================================
- Coverage   70.50%   70.48%   -0.03%     
==========================================
  Files         845      845              
  Lines      172082   172243     +161     
  Branches   172082   172243     +161     
==========================================
+ Hits       121329   121403      +74     
- Misses      45645    45744      +99     
+ Partials     5108     5096      -12     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.36% <0.00%> (-0.01%) ⬇️
linux 69.35% <100.00%> (-0.05%) ⬇️
linux-nightly 70.08% <100.00%> (+0.04%) ⬆️
pytests 1.66% <0.00%> (-0.01%) ⬇️
sanity-checks 1.47% <0.00%> (-0.01%) ⬇️
unittests 70.31% <100.00%> (-0.03%) ⬇️
upgradability 0.20% <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.

@stedfn stedfn marked this pull request as ready for review December 18, 2024 15:13
@stedfn stedfn requested a review from a team as a code owner December 18, 2024 15:13
@akhi3030
Copy link
Collaborator

Please add links to supporting evidence that shows that this change has an improvement for posterity.

@akhi3030
Copy link
Collaborator

While reviewing this, I noticed some unnecessary results so I created #12645.

Copy link
Collaborator

@akhi3030 akhi3030 left a comment

Choose a reason for hiding this comment

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

LGTM but I think we should wait for @shreyan-gupta to approve before landing.

Copy link
Contributor

@shreyan-gupta shreyan-gupta left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

chain/network/src/types.rs Outdated Show resolved Hide resolved
&mut self,
epoch_id: EpochId,
chunk_header: &ShardChunkHeader,
witness_bytes: EncodedChunkStateWitness,
chunk_validators: &[AccountId],
signer: &ValidatorSigner,
) -> Result<Vec<(AccountId, PartialEncodedStateWitness)>, Error> {
) -> Result<(), Error> {
Copy link
Contributor

@shreyan-gupta shreyan-gupta Dec 18, 2024

Choose a reason for hiding this comment

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

you might have to wait for Akhi's PR to land

@@ -343,7 +347,7 @@ impl PartialWitnessActor {
let encode_timer = metrics::PARTIAL_WITNESS_ENCODE_TIME
Copy link
Contributor

Choose a reason for hiding this comment

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

PARTIAL_WITNESS_ENCODE_TIME metric no longer represents time to just encode. We can perhaps rename to PARTIAL_WITNESS_ENCODE_AND_SEND_TIME. Please quickly ping @pugachAG and let him know about this change in behavior.

Copy link
Contributor Author

@stedfn stedfn Dec 19, 2024

Choose a reason for hiding this comment

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

Is it worth specifying it? I guess it just adds a message to the channel on every iteration which should not be expensive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it can block if the channel is bounded and full but I am struggling to understand the macro to be sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants