Skip to content

Commit

Permalink
fix: check next validators hash in tendermint program (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhtyy authored Jan 28, 2025
1 parent 7670bc8 commit 2985b59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions operator/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fn main() {
"../program",
BuildArgs {
elf_name: Some("tendermint-light-client".to_string()),
output_directory: Some("../program/elf".to_string()),
..Default::default()
},
)
Expand Down
Binary file modified program/elf/tendermint-light-client
Binary file not shown.
7 changes: 7 additions & 0 deletions program/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ fn main() {
trusting_period: Duration::from_secs(14 * 24 * 60 * 60),
clock_drift: Default::default(),
};

// Verify update header doesn't check this property.
assert_eq!(
light_block_1.next_validators.hash(),
light_block_1.as_trusted_state().next_validators_hash
);

let verify_time = light_block_2.time() + Duration::from_secs(20);
let verdict = vp.verify_update_header(
light_block_2.as_untrusted_state(),
Expand Down

0 comments on commit 2985b59

Please sign in to comment.