-
Notifications
You must be signed in to change notification settings - Fork 305
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
refactor(staking): 🌹 hoist uptime tracking into ValidatorUptimeTracker
extension trait
#4099
Merged
cratelyn
merged 8 commits into
main
from
kate/staking-refactors-cherry-picked-from-validator-uptime-signatures
Mar 25, 2024
Merged
refactor(staking): 🌹 hoist uptime tracking into ValidatorUptimeTracker
extension trait
#4099
cratelyn
merged 8 commits into
main
from
kate/staking-refactors-cherry-picked-from-validator-uptime-signatures
Mar 25, 2024
Conversation
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
first, we put this in a standalone function. some type aliases help us do this so that the signature here is not too unruly. some comments are added to highlight the intent to perform these lookups in parallel.
we do so below this loop. let's do that here as well.
> This is used to model causal relationships such as when a single > future spawns several related background tasks, et cetera. \- https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.follows_from NB: this commit is best viewed using `-w` to ignore whitespace changes.
commit information identifies validators by a truncated sha256 hash of their consensus key. we perform this operation in a couple disparate places. this consolidates things so that we have a single `validator_address` function to do this.
like the validator information lookup before, we outline another phase of tracking uptime into a standalone function.
log votes received for the last block. used while debugging test cases. re: perf, i was mildly curious and dug up: tokio-rs/tracing#722 (comment) ..which indicates that tracing won't calculate attributes unless a subscriber is interested in an event. i'm happy to hear that this is the case!
cratelyn
added
A-staking
Area: Design and implementation of staking and delegation
A-mock-consensus
Area: Relates to the mock consensus engine
labels
Mar 25, 2024
This was referenced Mar 25, 2024
cratelyn
changed the title
refactor(staking): 🌹 minor changes to uptime tracker
refactor(staking): 🌹 hoist uptime tracking into Mar 25, 2024
ValidatorUptimeTracker
extension trait
merging eagerly to clear the way for #4070, if that's alright! |
cratelyn
deleted the
kate/staking-refactors-cherry-picked-from-validator-uptime-signatures
branch
March 25, 2024 21:34
erwanor
reviewed
Mar 25, 2024
crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs
Show resolved
Hide resolved
crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs
Show resolved
Hide resolved
cratelyn
added a commit
that referenced
this pull request
Mar 26, 2024
cratelyn
commented
Mar 26, 2024
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.
crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs
Show resolved
Hide resolved
crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs
Show resolved
Hide resolved
cratelyn
added a commit
that referenced
this pull request
Mar 26, 2024
in #4099, merging won a race with review. this applies suggestions from: * https://github.com/penumbra-zone/penumbra/pull/4099/files/6fbc35c26ced0ebf7b751aee076c342de94a5427#r1538264796 * https://github.com/penumbra-zone/penumbra/pull/4099/files/6fbc35c26ced0ebf7b751aee076c342de94a5427#r1538253529
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-mock-consensus
Area: Relates to the mock consensus engine
A-staking
Area: Design and implementation of staking and delegation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this is a small collection of noop refactors, cherry-picked out of #4070.
most importantly, this hoists
track_uptime
into a standalone extension trait. additionally, some improvements to telemetry helped make debugging tests in #4070 easier.