-
Notifications
You must be signed in to change notification settings - Fork 296
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
Conversation
a54b5af
to
e95eeca
Compare
e95eeca
to
baf55e2
Compare
baf55e2
to
b6090a9
Compare
b6090a9
to
f3d5f27
Compare
f3d5f27
to
2508230
Compare
2508230
to
197154c
Compare
197154c
to
d3bb5ac
Compare
d3bb5ac
to
eff63a7
Compare
eff63a7
to
f4fe7e0
Compare
f4fe7e0
to
5f0b44b
Compare
5f0b44b
to
702c3cf
Compare
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.
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 { |
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.
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, |
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.
Thank you for the liberal commenting throughout. 🙏
.unwrap(), | ||
}; | ||
let canonical = tendermint::vote::CanonicalVote { | ||
// The mock consensus engine ONLY has precommit votes right now |
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.
👍
@@ -112,7 +127,7 @@ impl<C> TestNode<C> { | |||
&self.last_app_hash | |||
} | |||
|
|||
/// Returns the last `timestamp` value. | |||
/// Returns the most recent `timestamp` value. |
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.
👍
/// 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 { |
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.
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}; |
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.
The addition of exporting MarklePrefixExt
via the penumbra-ibc crate is the only non-test change in the PR, and looks fine.
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: