celestia-core
celestia-core copied to clipboard
Improve data commitment validation error message
[not blocking] this error message seems a bit confusing b/c now it's possible for the "last" block to be higher than the current chain height. "last" can be exactly one higher than the current chain height in which case the query result should include all the blocks including the most recent one. "last" can't be two higher than the current chain height because that means the query includes a block that doesn't exist yet.
The error message could be updated to say something like:
"end height %d is higher than current chain height + 1 %d so query includes a block that doesn't exist yet"
But I realize that's a mouthful so open to alternatives.
[nit] it would be nice if this function body consistently referred to one term "end" or "last" rather than mixing usage. Since other code in this PR appears to use "end", preference for that.
Originally posted by @rootulp in https://github.com/celestiaorg/celestia-core/pull/1058#discussion_r1289041911