Skip to content
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

Expose detail revert message in event #1036

Closed
boundless-forest opened this issue Apr 4, 2023 · 1 comment · Fixed by #1040
Closed

Expose detail revert message in event #1036

boundless-forest opened this issue Apr 4, 2023 · 1 comment · Fixed by #1040
Labels
enhancement New feature or request

Comments

@boundless-forest
Copy link
Collaborator

Motivation

See the screenshot below, otherwise use the RPC pre-call before sending the transaction to the chain. This event is very useful to check the result of the transaction execution after sending, but it's hard to see the concrete revert info from this event. As more and more chains integrate with XCM, the evm transaction may come from this way instead of the RPC node. I

image

Suggested Solution

I think we can refine the current Executed event by adding another field extra_info: Vec<u8> or extra_info: [u8; max_len] to provide more execution information to the contract users. We can reuse the second param returned by the execute(...) to retrieve the revert detail data, and pass it to the extro_info field in the event.

fn apply_validated_transaction(
	source: H160,
	transaction: Transaction,
) -> DispatchResultWithPostInfo {
	let (to, _, info) = Self::execute(source, &transaction, None)?;
	...
}

@sorpaas @nanocryk @tgmichel @koushiro What do you think?

@boundless-forest boundless-forest added the enhancement New feature or request label Apr 4, 2023
@crystalin
Copy link
Contributor

While I see some benefits to it, I also think that most of the Ethereum developers are used to have their tools (or simply to query) for the transaction error details. The ones we are familiar with are not using polkadotJs (or the substrate API) at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants