From 281720e36268073992ea933ff45628158d362908 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 31 Jan 2024 19:13:57 +0100 Subject: [PATCH] Add missing docs on IBCReceiveResponse.Acknowledgement changes --- docs/MIGRATING.md | 3 +++ types/ibc.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/MIGRATING.md b/docs/MIGRATING.md index aa699bdbf..cd85c293f 100644 --- a/docs/MIGRATING.md +++ b/docs/MIGRATING.md @@ -14,6 +14,9 @@ - The field `BlockInfo.Time` now uses a wrapper type `Uint64` instead of `uint64` to ensure string serialization. You can use `uint64(u)` to get the underlying value. +- The field `IBCReceiveResponse.Acknowledgement` can now be `nil`. In this case, + no acknowledgement must be written. Callers need to handle this case + separately from empty data. - CosmWasm gas values were reduced by a factor of 1000, so each instruction now consumes 150 CosmWasm gas instead of 150000. This should be taken into account when converting between CosmWasm gas and Cosmos SDK gas. diff --git a/types/ibc.go b/types/ibc.go index 6fc412f17..eba4d3e9f 100644 --- a/types/ibc.go +++ b/types/ibc.go @@ -256,7 +256,9 @@ type IBCReceiveResult struct { // and not inform the calling chain). // This is the counterpart of (IbcReceiveResponse)(https://github.com/CosmWasm/cosmwasm/blob/v0.15.0/packages/std/src/ibc.rs#L247-L267). type IBCReceiveResponse struct { - // binary encoded data to be returned to calling chain as the acknowledgement + // Acknowledgement is binary encoded data to be returned to calling chain as the acknowledgement. + // If this field is nil, no acknowledgement must be written. For contracts before CosmWasm 2.0, this + // was always a non-nil value. See also https://github.com/CosmWasm/cosmwasm/pull/1892. Acknowledgement []byte `json:"acknowledgement"` // Messages comes directly from the contract and is it's request for action. // If the ReplyOn value matches the result, the runtime will invoke this