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

refactor(staking): 😊 tracing telemetry for delegation changes #4009

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

cratelyn
Copy link
Contributor

this makes some small logging additions to the staking component. delegation changes will be logged at the trace level.

@cratelyn cratelyn added A-staking Area: Design and implementation of staking and delegation A-telemetry Area: Metrics, logging, and other observability-related features C-refactor Category: refactors and other related improvements labels Mar 12, 2024
@cratelyn cratelyn added this to the Sprint 2 milestone Mar 12, 2024
@cratelyn cratelyn self-assigned this Mar 12, 2024
@cratelyn
Copy link
Contributor Author

xref #4001, from which these changes came.

@cratelyn cratelyn marked this pull request as ready for review March 12, 2024 19:04
.height
.try_into()
.expect("should be able to convert i64 into block height"),
state.get_delegation_changes_tally().clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was also being cloned needlessly, see 838887d

@cratelyn cratelyn merged commit 2d88336 into main Mar 12, 2024
6 checks passed
@cratelyn cratelyn deleted the kate/some-staking-logs branch March 12, 2024 20:33
cratelyn added a commit that referenced this pull request Mar 13, 2024
this is a group of improvements to the telemetry in the staking
component, cherry-picked out of #4001. this improves the logs seen in
tests, and additionally takes the time to make some other small
gardening tweaks: consolidating imports, adding documentation comments,
etc. this is another branch in the spirit of #4009.

the changes here are itemized into distinct, small code transformations
to facilitate review, and demonstrate that these are noop changes. you
can start
[here](f7f78b9).

* f331964 - feat(staking): ❗ traces for invalid or missing parameters 
* d33598d - docs(staking): 🤝 add a doc comment 
* f6c60a8 - staking: 🙂 remove needless `Ok(_)` 
* fd4b8da - feat(staking): 💬 log when delegation changes are not found
* fe597ff - feat(staking): 🔍 trace-level spans for `StateReadExt`
methods
* 0447600 - refactor(staking): 🚡 use `self::` prefix in reexports 
* 67893c9 - refactor(staking): 🙂 remove import from reexports 
* 043222e - refactor(staking): 🎁 consolidate public submodules 
* 6376796 - refactor(staking): 🎁 consolidate submodules 
* b5bd240 - refactor(staking): 👯 component flag reexports
StateWriteExt
* d57beaa - chore(staking): 🥡 consolidate component reexports 
* aa52f6d - chore(staking): 🧹 tidy epoch_handler imports 
* 765ed75 - refactor(compact-block): 🧹 tidy imports 
* 7cb93f7 - feat(staking): 🌐 log why epoch ended 
* 081d041 - refactor(staking): add context to `state.end_epoch` call 
* 5701295 - feat(app): 🦠 tracing telemetry for `App::end_block` 
* f7f78b9 - docs(staking): 📕 add doc comment for `end_epoch`
cratelyn added a commit that referenced this pull request Mar 18, 2024
fixes #3966. fixes #3908. fixes _part of_ #3995.

this branch introduces the first steps towards mock consensus (#3588)
testing of the staking component (#3845).

this defines a validator after genesis, and then shows that it does
_not_ enter the consensus set. #3966 is addressed in this branch so that
the existing genesis validator correctly enters the consensus set, and
so that we can successfully progress to the second epoch.

subsequent changes will exercise delegating to this validator in the
`mock_consensus_can_define_and_delegate_to_a_validator`.

#### ✨ changes

* alters `with_penumbra_auto_app_state` so that it adds an allocation of
delegation tokens to the shielded pool component's genesis content.

* extends `generate_penumbra_validator` so that it generates a real
spend key, and returns an `Allocation` for the generated validator.
_(see #3966)_

* adds a new `mock_consensus_can_define_and_delegate_to_a_validator`
test that defines a post-genesis validator. _(see #3908)_

* defines a new `ConsensusIndexRead::get_consensus_set()` method, which
collects all of the identity keys returned by `consensus_set_stream`.

* lowers the events in
`penumbra_mock_consensus::block::Builder::execute()` to trace-level
events.

* `penumbra_mock_consensus::builder::Builder` will now log a warning if
values may be errantly rewritten by the builder methods.

* `TestNode::fast_forward` sets its `i` span field to `1..n`, rather
than `0..n-1`.

---

#### :link: related

* #4009
* #4010
* #4011
* #4017
* #4027
* #4028
* #4029
* #3966
* #3908
* #3588

---------

Co-authored-by: Henry de Valence <hdevalence@penumbralabs.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-staking Area: Design and implementation of staking and delegation A-telemetry Area: Metrics, logging, and other observability-related features C-refactor Category: refactors and other related improvements
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants