-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add codespace into the determinsticExecTxResult value #844
Comments
Hi @colin-axner, thanks for submitting your proposal. The core idea you are presenting makes total sense. The reason we haven't done it yet is because of the breakages it would entail to existing chains: it breaks the block format. Let me explain more in detail.
An exception to this is a change in the method/algorithm to calculate the The block header contains field version:
The change proposed in this issue — adding codespace into the
In general, we need a more holistic solution for changing the block format so that other tools for the chain don't stop working: light clients, block explorers, IBC, etc. Even if the change proposed here could be done relatively cleanly by following the two bullets above, we are likely to tackle it together with more involved block-format-breaking changes. We are at the early stages of coming up with a holistic solution for block format changes, called "Soft Upgrades". You can check the progress here and here. |
I tend to disagree here. I believe errors and their code spaces should not be part of consensus and it was a mistake to do it in the first place. It attempts to solve a problem that doesnt exist. We have talked with a few users, osmosis is a major one, which recommend their developers to not use code spaces as it creates possible edge cases of consensus faults. If a module would like to get extra data into consensus i agree it should be done app side. |
Thanks for chiming in @tac0turtle
But code spaces are not part of |
Do you agree on the mental model that an error is identified by If yes, then shouldn't we either include both or none at all? Do you suggest removing |
Feature Request
Summary
Add
abci.ExecTxResult.Codespace
to thedeterministicExecTxResult
return valueProblem Definition
In IBC, information is passed into an acknowledgement when a chain is receiving a packet. The receiving chain is creating the acknowledgement. The acknowledgement is then relayed to the sending chain, where an IBC application can act upon the information within the acknowledgement. The receiving application may want to encode error information into the acknowledgement to indicate that the packet was unable to be successfully processed on the receiving side.
This is a very common occurrence within interchain accounts where a transaction is being executed on behalf of an actor on another chain. If a single transaction fails, the error should be relayed back to the sending chain.
One constraint is that the acknowledgement is written into state on the receiving side in order to be verified by the sender, thus non-determinsitic information must be stripped from the error before being encoded into the acknowledgement, otherwise a chain code reach consensus failure from diverging app hashes.
Currently tendermint/cometbft only include the following transaction information within the header result hash:
Thus in IBC error acknowledgement, only the executing code can be included. This results in confusing error messages:
The error message does not indicate what codespace the error came from, making the error string useless.
Furthermore, the original design of the
Code
field was to use it as a condensed version of the entire error string from which clients may lookup the full value, but I believe this creates for a poor developer environment particularly in a multichain world. For example, in IBC, the code comes from the counterparty chain requiring actors to query the counterparty chain to obtain the meaning of the error. This is likely impossible for on chain actors such as smart contracts. I'm not sure the original justification for this design is applicable given the actual usage of IBC:This is a problem for a larger issue so I do not propose that the code be replaced by a string in the determinstic tx result of the block, but I'd like to open the discussion up in order to find a way to support a better dev UX landscape.
This issue is applicable to the non-atomic transaction feature (if error information is to be returned in the transaction response)
Proposal
Include the
abci.ExecTxResult.Codespace
into the determinsticExecTxResult function return. This PR introduced theCode
into thedeterminsticExecTxResult
. This ADR seems to indicate that the codespace should be included:It seems like an oversight to me that it never was. Following the original design discussion, there is no justification for why the codespace wasn't included.
The text was updated successfully, but these errors were encountered: