Skip to content

feat: add evm call wrapper extrinsic to dispatcher pallet - #1067

Merged
mrq1911 merged 44 commits into
masterfrom
feat/batch-evm
Aug 15, 2025
Merged

feat: add evm call wrapper extrinsic to dispatcher pallet#1067
mrq1911 merged 44 commits into
masterfrom
feat/batch-evm

Conversation

@F3Joule

@F3Joule F3Joule commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Description

This PR introduces a new extrinsic in pallet_dispatcher to wrap a single EVM call. This is done in order to determine whether the EVM call exits successfully or either has a faulty exit status. This extrinsic is mostly going to be used in batch calls to revert state correctly (in case of batchAll); that's because EVM calls don’t fail when reverted, but return success with ExitStatus::Revert

Related Issue

Fixes #974

Motivation and Context

How Has This Been Tested?

Checklist:

  • I have updated the documentation if necessary.
  • I have added tests to cover my changes, regression test if fixing an issue.
  • This is a breaking change.

@F3Joule F3Joule self-assigned this Apr 11, 2025
@github-actions

github-actions Bot commented Apr 11, 2025

Copy link
Copy Markdown

Crate versions that have not been updated:

  • hydradx-runtime: v338.0.0

Crate versions that have been updated:

  • runtime-integration-tests: v1.50.0 -> v1.51.0
  • pallet-dispatcher: v1.1.1 -> v1.2.0
  • hydradx-traits: v4.0.0 -> v4.1.0

Runtime version has not been increased.

@F3Joule F3Joule changed the title feat: add "all or nothing" batch extrinsic for evm transactions feat: add evm call wrapper extrinsic to dispatcher pallet May 2, 2025
Comment thread pallets/dispatcher/src/lib.rs Outdated
@F3Joule
F3Joule marked this pull request as ready for review May 19, 2025 14:33
@F3Joule
F3Joule requested a review from mrq1911 May 19, 2025 15:30
Comment thread pallets/dispatcher/src/lib.rs Outdated
Comment thread runtime/hydradx/src/governance/mod.rs Outdated
Comment thread pallets/dispatcher/src/lib.rs
Comment thread pallets/dispatcher/src/lib.rs
Comment thread pallets/dispatcher/src/lib.rs
Comment thread pallets/dispatcher/src/lib.rs Outdated
@F3Joule
F3Joule requested a review from enthusiastmartin June 13, 2025 07:48
Comment thread pallets/dispatcher/src/lib.rs Outdated
Comment thread pallets/dispatcher/src/lib.rs Outdated
@enthusiastmartin

Copy link
Copy Markdown
Member

build is failiing, some tests, so i guess it still needs some work

Comment thread pallets/dispatcher/src/lib.rs Outdated

@mrq1911 mrq1911 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure that evm wallet can dispatch this as well unlike regular evm::call

@F3Joule
F3Joule requested a review from enthusiastmartin July 4, 2025 11:31
@F3Joule
F3Joule requested a review from mrq1911 July 17, 2025 16:24
Comment thread runtime/hydradx/src/evm/mod.rs Outdated
fn try_address_origin(address: &sp_core::H160, origin: OuterOrigin) -> Result<AccountId32, OuterOrigin> {
origin.into().and_then(|o| match o {
RawOrigin::Signed(who)
if who == M::into_account_id(*address) || AsRef::<[u8; 32]>::as_ref(&who)[0..20] == address[0..20] =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potencially only truncated_account_id(address) would be needed here, bound accounts should be already covered

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also would be nice to have some test for this case

@mrq1911
mrq1911 merged commit 6ddd821 into master Aug 15, 2025
6 of 7 checks passed
@github-actions

Copy link
Copy Markdown

Quick benchmark at commit 25d0583 has been executed successfully.
View results

@F3Joule
F3Joule deleted the feat/batch-evm branch March 9, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create method that fails for reverted evm calls

3 participants