-
Notifications
You must be signed in to change notification settings - Fork 677
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
feat: Implement measuring of network round-trip time for sending state witness and receiving the ack #10824
feat: Implement measuring of network round-trip time for sending state witness and receiving the ack #10824
Conversation
…ess and receiving the ack.
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.
overall LGTM, added a bunch of comments
chain/client/src/stateless_validation/state_witness_producer.rs
Outdated
Show resolved
Hide resolved
chain/client/src/stateless_validation/state_witness_producer.rs
Outdated
Show resolved
Hide resolved
chain/client/src/stateless_validation/state_witness_producer.rs
Outdated
Show resolved
Hide resolved
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.
LGTM!
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.
LGTM! Just some minor nits.
chain/client/src/stateless_validation/state_witness_producer.rs
Outdated
Show resolved
Hide resolved
chain/client/src/stateless_validation/state_witness_producer.rs
Outdated
Show resolved
Hide resolved
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.
Good stuff, just a few nits and comments from me!
How will 'send_state_witness_ack' work if we decide to implement multi-hop strategy? It will be great for us to outline assumptions we are making with the approach |
Co-authored-by: Akhilesh Singhania <akhi@near.org>
Co-authored-by: Akhilesh Singhania <akhi@near.org>
Co-authored-by: Akhilesh Singhania <akhi@near.org>
Co-authored-by: Simonas Kazlauskas <github@kazlauskas.me>
Co-authored-by: Simonas Kazlauskas <github@kazlauskas.me>
Co-authored-by: Simonas Kazlauskas <github@kazlauskas.me>
Co-authored-by: Simonas Kazlauskas <github@kazlauskas.me>
…lmas/nearcore into witness-roundtrip-metric
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10824 +/- ##
==========================================
- Coverage 71.43% 71.42% -0.01%
==========================================
Files 763 764 +1
Lines 153722 153894 +172
Branches 153722 153894 +172
==========================================
+ Hits 109807 109917 +110
- Misses 38919 38974 +55
- Partials 4996 5003 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The goal here is to measure the network time spent (see issue #10790)
1 when sending state-witness from chunk producers to validators and
2 when sending the endorsement message from chunk validators to block producers.
But, for (2), we send an ack message (
ChunkStateWitness
) from the validator back to the chunk producer. This is not fully accurate but should give us some picture of the duration. We do not change the state-witness time to record the sent-time. Instead we keep the sent-time in the chunk producer (for which we addChunkStateWitnessTracker
to theClient
) along with the hash of the chunk for which witness is created. Then upon receiving the ack message, we calculate the duration and store it in a metric in the chunk producer.Most of the logic is in
state_witness_tracker.rs
. Note that this implementation is for experimenting with network time estimates for now and, since we are not changing the witness messages, having ack messages is optional and we may remove it later when we have a stable implementation. We have not added a feature flag for it (though guarded bystatelessnet_protocol
) and may want to add a compile flag later before releasingstatelessnet_protocol
in mainnet.Note that we make the assumption that the messages are directly sent between nodes (no intermediary hop node).