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
As for now, after submitting a transaction to a chain (either call, upload or instantiate) cargo contract listens for events and decodes them. In particular, every event that comes from any contract is decoded using the metadata file corresponding to the 'entry' contract. In case of any failure, the error is propagated up to the user, which cause the whole program to exit and fail.
Such a situation is easily reproducible with any pair of contracts A and B, such that:
A calls B
B emits an event E
E is not compatible with A's metadata (it is sufficient that A doesn't declare any events)
This happens often in any non-trivial dApp and thus makes using cargo-contract impossible to deploy and interact with more interesting examples.
In case of decoding failure, we should just log warning / info that the event couldn't have been properly decoded with provided metadata and just continue.
The text was updated successfully, but these errors were encountered:
Problem statement
As for now, after submitting a transaction to a chain (either call, upload or instantiate)
cargo contract
listens for events and decodes them. In particular, every event that comes from any contract is decoded using the metadata file corresponding to the 'entry' contract. In case of any failure, the error is propagated up to the user, which cause the whole program to exit and fail.Such a situation is easily reproducible with any pair of contracts
A
andB
, such that:A
callsB
B
emits an eventE
E
is not compatible withA
's metadata (it is sufficient thatA
doesn't declare any events)This happens often in any non-trivial dApp and thus makes using
cargo-contract
impossible to deploy and interact with more interesting examples.Relevant code
https://github.com/paritytech/cargo-contract/blob/master/crates/cargo-contract/src/cmd/extrinsics/events.rs#L110
Suggested solution
In case of decoding failure, we should just log warning / info that the event couldn't have been properly decoded with provided metadata and just continue.
The text was updated successfully, but these errors were encountered: