Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
f6ebdd1 to
ed0f8a4
Compare
12b36b8 to
d61943a
Compare
c1c3e38 to
bba9b87
Compare
bba9b87 to
e423a60
Compare
542f044 to
b7a6d83
Compare
There was a problem hiding this comment.
Pull request overview
This PR integrates pallet-revive into the Polymesh runtimes to enable PVM/EVM smart contracts and introduces a new eth-rpc workspace crate that exposes an Ethereum JSON-RPC server backed by the Revive runtime APIs.
Changes:
- Add Revive pallet to develop/testnet/mainnet runtimes (plus runtime APIs / extrinsic format changes) and adjust signed extensions accordingly.
- Update transaction fee calculation wiring (WeightToFee / multiplier) and update runtime tests to match the new fee behavior.
- Add a new
eth-rpccrate (server, client, storage/receipt indexing, CLI, examples, migrations, CI support) and adjust node CLI entrypoints to support programmatic argument passing.
Reviewed changes
Copilot reviewed 51 out of 62 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/service.rs | Update test extrinsic construction to match new signed extension shape and Revive origin extension. |
| src/command.rs | Replace run() with run_with_args(Vec<String>) for programmatic node startup. |
| src/bin/main.rs | Collect CLI args and call run_with_args. |
| src/chain_spec/develop_runtime.rs | Add dev accounts intended for ETH/EVM testing. |
| src/benchmarking.rs | Update benchmark extrinsic creation to match new extension/extrinsic types. |
| rust-toolchain.toml | Adjust pinned nightly and add rust-src component. |
| pallets/runtime/tests/src/transaction_payment_test.rs | Update fee-related assertions for new fee mapping/multiplier behavior. |
| pallets/runtime/tests/src/storage.rs | Add Revive pallet to the test runtime and update signed extra/extrinsic construction. |
| pallets/runtime/tests/src/signed_extra.rs | Include Revive origin extension and update priority expectations. |
| pallets/runtime/tests/Cargo.toml | Add pallet-revive dependency and feature wiring. |
| pallets/runtime/testnet/src/runtime.rs | Add Revive pallet to testnet runtime. |
| pallets/runtime/testnet/Cargo.toml | Add pallet-revive dependency + std/bench features. |
| pallets/runtime/mainnet/src/runtime.rs | Add Revive pallet to mainnet runtime. |
| pallets/runtime/mainnet/Cargo.toml | Add pallet-revive dependency + std/bench features. |
| pallets/runtime/develop/src/runtime.rs | Add Revive pallet and benchmarks hook in develop runtime. |
| pallets/runtime/develop/Cargo.toml | Add pallet-revive dependency + std/bench features. |
| pallets/runtime/common/src/runtime.rs | Wire Revive config into runtime macro and update TxExtension / extrinsic/runtime APIs integration. |
| pallets/runtime/common/src/lib.rs | Add fee multiplier / child trie deposit / max eth weight parameters and required imports. |
| pallets/runtime/common/Cargo.toml | Add pallet-transaction-payment dependency for fee multiplier types. |
| eth-rpc/src/main.rs | Add eth-rpc binary entrypoint. |
| eth-rpc/src/lib.rs | Implement the Eth JSON-RPC server wrapper around a Substrate-backed client. |
| eth-rpc/src/cli.rs | Implement CLI and server startup, including block subscription/indexing tasks. |
| eth-rpc/src/client.rs | Implement node connectivity, block subscription, receipt/log indexing, and RPC-facing helpers. |
| eth-rpc/src/client/runtime_api.rs | Implement runtime-api calls used by the RPC server (dry-run, balance, block, traces, etc.). |
| eth-rpc/src/client/storage_api.rs | Implement storage queries needed for contract info/trie access. |
| eth-rpc/src/receipt_extractor.rs | Extract receipts/logs from Revive extrinsics/events. |
| eth-rpc/src/fee_history_provider.rs | Implement fee-history caching and response assembly. |
| eth-rpc/src/block_info_provider.rs | Implement block lookup + latest/best/finalized tracking. |
| eth-rpc/src/subxt_client.rs | Add generated subxt client bindings for a Revive-enabled chain. |
| eth-rpc/src/example.rs | Add Rust helper utilities for building/sending EVM transactions in examples/tests. |
| eth-rpc/src/apis.rs | Module wiring for RPC namespaces. |
| eth-rpc/src/apis/execution_apis.rs | Define Ethereum execution RPC traits (eth_* methods). |
| eth-rpc/src/apis/debug_apis.rs | Define debug_* RPC traits and implementations. |
| eth-rpc/src/apis/health_api.rs | Add system health + net_peerCount RPC surface. |
| eth-rpc/src/tests.rs | Add integration-style RPC tests that spin up a node + RPC server. |
| eth-rpc/migrations/0001_create_transaction_hashes.sql | Add DB schema for tx hash indexing. |
| eth-rpc/migrations/0002_create_log_table.sql | Add DB schema for log indexing. |
| eth-rpc/migrations/0003_create_eth_substrate_block_mapping.sql | Add DB schema for eth<->substrate block mapping. |
| eth-rpc/examples/README.md | Add usage docs for node + RPC server + zombienet. |
| eth-rpc/examples/deploy.rs | Example: deploy/call via RPC. |
| eth-rpc/examples/transfer.rs | Example: ETH transfer via RPC. |
| eth-rpc/examples/rpc-playground.rs | Example: basic RPC queries. |
| eth-rpc/examples/extrinsic.rs | Example: submit Revive extrinsic via subxt. |
| eth-rpc/examples/remark-extrinsic.rs | Example: submit System.remark via subxt. |
| eth-rpc/examples/eth-remark-call.rs | Example: call a runtime pallet via EVM “runtime pallets addr”. |
| eth-rpc/examples/eth-rpc-tester.rs | Example/test harness for running against a dockerized RPC server. |
| eth-rpc/examples/westend_local_network.toml | Zombienet config for local Westend Asset Hub testing. |
| eth-rpc/build.rs | Build script generating git revision env vars + subxt metadata file. |
| eth-rpc/Cargo.toml | New crate manifest for pallet-revive-eth-rpc. |
| eth-rpc/.sqlx/query-*.json | Add sqlx prepared-query artifacts for offline builds. |
| Cargo.toml | Add eth-rpc to workspace members and introduce revive-related workspace deps. |
| .circleci/config.yml | Update CI image version and add tooling download steps for benchmark build. |
Files not reviewed (9)
- eth-rpc/.sqlx/query-2348bd412ca114197996e4395fd68c427245f94b80d37ec3aef04cd96fb36298.json: Language not supported
- eth-rpc/.sqlx/query-29af64347f700919dc2ee12463f332be50096d4e37be04ed8b6f46ac5c242043.json: Language not supported
- eth-rpc/.sqlx/query-2fcbf357b3993c0065141859e5ad8c11bd7800e3e6d22e8383ab9ac8bbec25b1.json: Language not supported
- eth-rpc/.sqlx/query-3de332f45edf5ee4592bd0061956305983861ccaea79eec44518e1bca5233920.json: Language not supported
- eth-rpc/.sqlx/query-47b830cef6768ed5b119c74037482baef86a7c3d3469873a205805ef342ba031.json: Language not supported
- eth-rpc/.sqlx/query-5c0ea8efbd2591e3ede3833acfcadf2d552140a20d84edbf90583da4619bcf2a.json: Language not supported
- eth-rpc/.sqlx/query-7e5be81ad6f5d96bc6dbf62098cbd61d257d1ffad222317634327e12be403ab2.json: Language not supported
- eth-rpc/.sqlx/query-cf515b47790a2ac4b3802c29e36a07ace0c67849e5b20c92532d7a77861ebf80.json: Language not supported
- eth-rpc/.sqlx/query-e712acbeb712c0a61fc2a47f966abae1ae43ffba0920a9d209d01dcfce44c5e0.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type FeeInfo = pallet_revive::evm::fees::Info<Address, polymesh_primitives::Signature, EthExtraImpl>; | ||
| type MaxEthExtrinsicWeight = polymesh_runtime_common::MaxEthExtrinsicWeight; | ||
| type DebugEnabled = frame_support::traits::ConstBool<false>; | ||
| type GasScale = frame_support::traits::ConstU32<1>; |
There was a problem hiding this comment.
I see Kusama Asset Hub uses GasScale = 100_000 (source). The reason Kusama is using 100_000 could be because their weight parameters and token decimals (KSM=12 vs POLYX=6) likely produce much lower base gas estimates.
However, I did a quick test for a simple transfer using our current GasScale = 1 config and the gas was around 8x higher (168k) than Ethereum (21k), which seems reasonable and should work well with EVM tooling. If we copied Kusama’s GasScale = 100_000, the same transfer would show 168k × 100,000 = 16.8 billion gas, which would be unreasonably high.
We should probably still keep that in mind and do more gas testing.
| type InstantiateOrigin = frame_system::EnsureSigned<Self::AccountId>; | ||
| type RuntimeHoldReason = RuntimeHoldReason; | ||
| type CodeHashLockupDepositPercent = polymesh_runtime_common::CodeHashLockupDepositPercent; | ||
| type ChainId = frame_support::traits::ConstU64<420_420_420>; |
There was a problem hiding this comment.
Currently ChainId = 420_420_420 is hardcoded and shared across all networks (develop, testnet, mainnet). Probably we should make ChainId network-specific by defining it in each runtime’s parameter_types! block as EvmChainId, then update here to reference EvmChainId instead of the hardcoded value.
There was a problem hiding this comment.
We need to request our own chain id (one for mainnet and maybe another for testnet). Our Staging and Testnet networks use the same runtime testnet so they will need to share the same chain id, since they are both "test networks" that will be fine. For our dev runtime we can maybe still use this generic 420_420_420 id.
There was a problem hiding this comment.
Added EvmChainId in the other Revive PR: #1902
b7a6d83 to
c7a8c11
Compare
f2a0cad to
d2e3192
Compare
c7a8c11 to
662b6ea
Compare
Give ETH dev keys some POLYX on dev chain.
662b6ea to
cf771eb
Compare
|
Using PR #1902 instead. |
changelog
new features
eth-rpcthe start of an ETH -> Substrate gateway.