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

[pallet-revive] Add evm codegen #5926

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

[pallet-revive] Add evm codegen #5926

wants to merge 8 commits into from

Conversation

pgherveou
Copy link
Contributor

@pgherveou pgherveou commented Oct 4, 2024

Adds the code generator used to generate the types and methods of the JSON-RPC proxy

@pgherveou pgherveou changed the base branch from master to pg/revive-rpc-fixes-v2 October 4, 2024 13:37
@pgherveou pgherveou changed the base branch from pg/revive-rpc-fixes-v2 to pg/revive-rpc-server October 11, 2024 12:57
Base automatically changed from pg/revive-rpc-server to pg/revive-rpc-fixes-v2 October 18, 2024 21:53
github-merge-queue bot pushed a commit that referenced this pull request Oct 22, 2024
This PR introduces the necessary changes to pallet-revive for
integrating with our Ethereum JSON-RPC.
The RPC proxy itself will be added in a follow up.

## Changes

- A new pallet::call `Call::eth_transact`. This is used as a wrapper to
accept unsigned Ethereum transaction, valid call will be routed to
`Call::call` or `Call::instantiate_with_code`

- A custom UncheckedExtrinsic struct, that wraps the generic one usually
and add the ability to check eth_transact calls sent from an Ethereum
JSON-RPC proxy.
- Generated types and traits to support implementing a JSON-RPC Ethereum
proxy.

## Flow Overview:
- A user submits a transaction via MetaMask or another
Ethereum-compatible wallet.
- The proxy dry run the transaction and add metadata to the call (gas
limit in Weight, storage deposit limit, and length of bytecode and
constructor input for contract instantiation)
- The raw transaction, along with the additional metadata, is submitted
to the node as an unsigned extrinsic.
- On the runtime, our custom UncheckedExtrinsic define a custom
Checkable implementation that converts the unsigned extrinsics into
checked one
 - It recovers the signer
- validates the payload, and injects signed extensions, allowing the
system to increment the nonce and charge the appropriate fees.
- re-route the call to pallet-revive::Call::call or
pallet-revive::Call::instantiateWithCode

## Dependencies

- paritytech/polkavm#188

## Follow up PRs
- #5926  
- #6147 (previously #5953)
- #5502

---------

Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Cyrill Leutwiler <[email protected]>
Base automatically changed from pg/revive-rpc-fixes-v2 to master October 22, 2024 11:18
@pgherveou pgherveou marked this pull request as ready for review October 29, 2024 08:27
@pgherveou
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor

@pgherveou pgherveou added R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts. labels Oct 29, 2024
Copy link

Command "prdoc --audience runtime_dev --bump minor" has failed ❌! See logs here

@pgherveou pgherveou assigned pgherveou and xermicus and unassigned pgherveou Nov 12, 2024
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12032631779
Failed job name: test-linux-stable-no-try-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants