diff --git a/.changelog/unreleased/bug-fixes/752-fix-require-latest-height.md b/.changelog/unreleased/bug-fixes/752-fix-require-latest-height.md new file mode 100644 index 0000000000..a784de188b --- /dev/null +++ b/.changelog/unreleased/bug-fixes/752-fix-require-latest-height.md @@ -0,0 +1,2 @@ +- require_latest_height should skip requests with height 0 + ([#752](https://github.com/anoma/namada/pull/752)) \ No newline at end of file diff --git a/shared/src/ledger/queries/mod.rs b/shared/src/ledger/queries/mod.rs index 22364daf49..8d7b5e0274 100644 --- a/shared/src/ledger/queries/mod.rs +++ b/shared/src/ledger/queries/mod.rs @@ -10,6 +10,7 @@ pub use types::{ use super::storage::{DBIter, StorageHasher, DB}; use super::storage_api; +use crate::types::storage::BlockHeight; #[macro_use] mod router; @@ -47,7 +48,9 @@ where D: 'static + DB + for<'iter> DBIter<'iter> + Sync, H: 'static + StorageHasher + Sync, { - if request.height != ctx.storage.last_height { + if request.height != BlockHeight(0) + && request.height != ctx.storage.last_height + { return Err(storage_api::Error::new_const( "This query doesn't support arbitrary block heights, only the \ latest committed block height ('0' can be used as a special \