You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently, the transfer app uses whatever error message is returned as acknowledgment (code), which makes the error message a part of consensus state, so the error message change will be a consensus breaking change, which may not align with people's intuition, making it easier to bring in consensus breaking changes in minor upgrades.
Hi @yihuang, thanks for opening this issue. The code which you link is calling types.NewErrorAcknowledgement(err) from the transfer types pkg. See here.
This function extracts the abci error code and then includes a static ack error string (string constant).
// NewErrorAcknowledgement returns a deterministic error string which may be used in
// the packet acknowledgement.
func NewErrorAcknowledgement(err error) channeltypes.Acknowledgement {
// the ABCI code is included in the abcitypes.ResponseDeliverTx hash
// constructed in Tendermint and is therefore deterministic
_, code, _ := sdkerrors.ABCIInfo(err, false) // discard non-determinstic codespace and log values
errorString := fmt.Sprintf("ABCI code: %d: %s", code, ackErrorString)
return channeltypes.NewErrorAcknowledgement(errorString)
}
I believe this is the desired behaviour which you propose. Please review this and feel free to close the issue or raise any other concerns. Many thanks!
Summary
currently, the transfer app uses whatever error message is returned as acknowledgment (code), which makes the error message a part of consensus state, so the error message change will be a consensus breaking change, which may not align with people's intuition, making it easier to bring in consensus breaking changes in minor upgrades.
Problem Definition
Proposal
Use static errors, suggested by @leejw51crypto
For Admin Use
The text was updated successfully, but these errors were encountered: