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: get app_hash at proof_height instead of latest #59

Merged
merged 7 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions utils/tm-prover/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ async fn main() -> Result<()> {

let status = client.status().await?;
let latest_height = status.sync_info.latest_block_height;
let latest_app_hash = status.sync_info.latest_app_hash;

// `proof_height` is the height at which we want to query the blockchain's state
// This is one less than than the `latest_height` because we want to verify the merkle-proof for
Expand Down Expand Up @@ -228,9 +229,6 @@ async fn main() -> Result<()> {
)
.await?;

let status = client.status().await?;
let latest_app_hash = status.sync_info.latest_app_hash;

let path = WASM_STORE_KEY.to_owned();
let data = CwAbciKey::new(args.contract_address, args.storage_key, None);
let result = client
Expand All @@ -248,7 +246,7 @@ async fn main() -> Result<()> {
if let Some(trace_file) = args.trace_file {
// replace the last block in the trace (i.e. the (latest - 1) block) with the latest block
// we don't actually verify the latest block because it will be verified on the other side
let latest_block = primary.fetch_light_block(status.sync_info.latest_block_height)?;
let latest_block = primary.fetch_light_block(latest_height)?;
let _ = primary_trace.pop();
primary_trace.push(latest_block);

Expand Down
Loading