-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement measuring of network round-trip time for sending stat…
…e witness and receiving the ack (#10824) 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 add `ChunkStateWitnessTracker` to the `Client`) 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 by `statelessnet_protocol`) and may want to add a compile flag later before releasing `statelessnet_protocol` in mainnet. Note that we make the assumption that the messages are directly sent between nodes (no intermediary hop node). --------- Co-authored-by: Akhilesh Singhania <akhi@near.org> Co-authored-by: Simonas Kazlauskas <github@kazlauskas.me>
- Loading branch information
1 parent
21fba5b
commit f2f6ed0
Showing
18 changed files
with
361 additions
and
14 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
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
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
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.