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

fix(mock-consensus): 🍰 fix two height bugs in mock consensus tests #4028

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Mar 15, 2024

fixes #4005.

4002dff feat(mock-consensus): ➰ record height in inner span

this tweaks the fast-forward facilities (#3933, #4002) so that we record
the height as a span field per-loop iteration, not as a field in the
encompassing #[instrument] span.

see #4005 for an example of the misleading height: 0 logs this would
generate.

c5118f1 feat(mock-consensus): 🍰 EndBlock abci request height increases

this patches the mock consensus TestNode::end_block method so that the
height of these requests does not stay at 1.

this is needed for staking tests, see #3995.

this patches the mock consensus `TestNode::end_block` method so that the
height of these requests does not stay at 1.

this is needed for staking tests, see #3995.

* #3588
* #4001
* #3995
* #3840
this tweaks the fast-forward facilities (#3933, #4002) so that we record
the height as a span field per-loop iteration, not as a field in the
encompassing `#[instrument]` span.

see #4005 for an example of the misleading `height: 0` logs this would
generate.
@cratelyn cratelyn added C-bug Category: a bug A-mock-consensus Area: Relates to the mock consensus engine labels Mar 15, 2024
@cratelyn cratelyn added this to the Sprint 2 milestone Mar 15, 2024
@cratelyn cratelyn self-assigned this Mar 15, 2024
@cratelyn
Copy link
Contributor Author

one of these is a "bug", to be clear! i knew a hard-coded height would eventually become an issue, i just wanted to wait until changes in e.g. #4001 got far enough along to give me an error that related to this.

this is good πŸ™‚

@cratelyn
Copy link
Contributor Author

@cratelyn cratelyn merged commit fe81763 into main Mar 15, 2024
6 checks passed
@cratelyn cratelyn deleted the kate/mock-consensus-end-block-height-increases branch March 15, 2024 16:25
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-mock-consensus Area: Relates to the mock consensus engine C-bug Category: a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

tests: πŸ˜… mock consensus height of 0 is recorded in fast forward span
1 participant