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

Generate block headers properly in tests #4823

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

zbuc
Copy link
Member

@zbuc zbuc commented Aug 20, 2024

Describe your changes

This updates the mock tendermint to properly perform block signing and header generation.

Tests should probably be added that the mock tendermint performs as expected.

Issue ticket number and link

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    tests only

@zbuc zbuc force-pushed the test_blockheader_generation branch from a54b5af to e95eeca Compare August 20, 2024 02:03
@zbuc zbuc force-pushed the test_blockheader_generation branch from e95eeca to baf55e2 Compare August 20, 2024 02:09
@zbuc zbuc force-pushed the test_blockheader_generation branch from baf55e2 to b6090a9 Compare August 20, 2024 02:12
@zbuc zbuc force-pushed the test_blockheader_generation branch from b6090a9 to f3d5f27 Compare August 20, 2024 17:14
@zbuc zbuc force-pushed the test_blockheader_generation branch from f3d5f27 to 2508230 Compare August 20, 2024 18:00
@zbuc zbuc force-pushed the test_blockheader_generation branch from 2508230 to 197154c Compare August 20, 2024 18:15
@zbuc zbuc force-pushed the test_blockheader_generation branch from 197154c to d3bb5ac Compare August 20, 2024 18:21
@zbuc zbuc marked this pull request as ready for review August 20, 2024 18:21
@zbuc zbuc requested a review from conorsch August 20, 2024 18:23
@zbuc zbuc force-pushed the test_blockheader_generation branch from d3bb5ac to eff63a7 Compare August 20, 2024 19:04
@zbuc zbuc force-pushed the test_blockheader_generation branch from eff63a7 to f4fe7e0 Compare August 20, 2024 19:17
@zbuc zbuc force-pushed the test_blockheader_generation branch from f4fe7e0 to 5f0b44b Compare August 20, 2024 20:24
@zbuc zbuc force-pushed the test_blockheader_generation branch from 5f0b44b to 702c3cf Compare August 20, 2024 20:30
Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

Big improvement. Nicely carves out some test harness improvements in support of the IBC state machine tests in #4797.

);

// TODO: these tests fail
if false {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to reader: see ongoing work in #4797 to get proof lookups working well.

.try_into()?,
),
// Address of the original proposer of the block. Validator must be in the current validatorSet.
proposer_address,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the liberal commenting throughout. 🙏

.unwrap(),
};
let canonical = tendermint::vote::CanonicalVote {
// The mock consensus engine ONLY has precommit votes right now
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -112,7 +127,7 @@ impl<C> TestNode<C> {
&self.last_app_hash
}

/// Returns the last `timestamp` value.
/// Returns the most recent `timestamp` value.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

/// Returns the latest block height.
fn latest_block_height(&self) -> tendermint::block::Height {
/// Returns the last committed block height.
fn last_block_height(&self) -> tendermint::block::Height {
Copy link
Contributor

Choose a reason for hiding this comment

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

Crucially the tendermint/cometbft module docs define last_block_height as "The latest block for which the app has called Commit" which tracks with how it's being used here.

@@ -18,7 +18,7 @@ pub mod params;
mod version;

mod prefix;
pub use prefix::{IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS, IBC_SUBSTORE_PREFIX};
pub use prefix::{MerklePrefixExt, IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS, IBC_SUBSTORE_PREFIX};
Copy link
Contributor

Choose a reason for hiding this comment

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

The addition of exporting MarklePrefixExt via the penumbra-ibc crate is the only non-test change in the PR, and looks fine.

@conorsch conorsch merged commit 0c5afd9 into main Aug 20, 2024
13 checks passed
@conorsch conorsch deleted the test_blockheader_generation branch August 20, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants