Skip to content

Commit

Permalink
decrement astria endpoint resp height
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Nov 1, 2024
1 parent 058f8e1 commit f261aad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/relayer/src/chain/astria/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,12 @@ impl ChainEndpoint for AstriaEndpoint {
response.commitment,
Some((
proof,
Height::new(height.revision_number, height.revision_height)
// TODO: subtracting from the height is jank but due to penumbra incrementing the proof height
// in the response, and the caller of this method (`build_packet_proofs`) also incrementing the proof
// height. the cosmos endpoint doesn't increment the height in the response (i believe) so changing
// the caller to not increment is potentially more confusing.
// needs a better fix.
Height::new(height.revision_number, height.revision_height - 1)
.map_err(|e| Error::other(Box::new(e)))?,
)),
))
Expand Down Expand Up @@ -1226,7 +1231,7 @@ impl ChainEndpoint for AstriaEndpoint {
value,
Some((
proof,
Height::new(height.revision_number, height.revision_height)
Height::new(height.revision_number, height.revision_height - 1)
.map_err(|e| Error::other(Box::new(e)))?,
)),
))
Expand Down Expand Up @@ -1304,7 +1309,7 @@ impl ChainEndpoint for AstriaEndpoint {
response.acknowledgement,
Some((
proof,
Height::new(height.revision_number, height.revision_height)
Height::new(height.revision_number, height.revision_height - 1)
.map_err(|e| Error::other(Box::new(e)))?,
)),
))
Expand Down

0 comments on commit f261aad

Please sign in to comment.