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 Ethereum JSON-RPC server #6147

Open
wants to merge 193 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
4f4efcc
Add RPC integration
pgherveou Sep 30, 2024
43a7bf0
Add prdoc
pgherveou Sep 30, 2024
e74852d
Add missing license headers
pgherveou Sep 30, 2024
5b242f8
missing license header
pgherveou Sep 30, 2024
93f25dd
rm unwrap
pgherveou Oct 1, 2024
e4d6543
Add tests
pgherveou Oct 1, 2024
4a9ca42
fix docstr
pgherveou Oct 1, 2024
658f3ac
fix docstring
pgherveou Oct 1, 2024
b75fa99
rm log
pgherveou Oct 2, 2024
c2f4bee
Improve fee checking logic
pgherveou Oct 3, 2024
38fd681
Make tests pass again
pgherveou Oct 4, 2024
e8947bc
fixes
pgherveou Oct 4, 2024
a5f6f75
fixes
pgherveou Oct 4, 2024
2c5242a
Remove unused
pgherveou Oct 4, 2024
8c35821
Rm additional details from prdoc
pgherveou Oct 4, 2024
dd56741
prep kitchensink integration
pgherveou Oct 4, 2024
62ffb24
fix kitchensink
pgherveou Oct 4, 2024
0b5f646
use subxt-signer & eth feature
pgherveou Oct 4, 2024
ad3c0ee
Move rpc stuff to new PR
pgherveou Oct 7, 2024
74ba6dc
Merge branch 'master' into pg/revive-rpc-fixes-v2
athei Oct 7, 2024
5634757
Fixing compilation issues
pgherveou Oct 7, 2024
7f6a356
rustdoc fixes
pgherveou Oct 7, 2024
059f247
Fix doclink
pgherveou Oct 7, 2024
3893465
fix prdoc
pgherveou Oct 7, 2024
8ad166d
fix keyring
pgherveou Oct 7, 2024
766a6c8
fix
pgherveou Oct 7, 2024
2f22e12
add misssing dep
pgherveou Oct 7, 2024
b4fff28
fix lock
pgherveou Oct 7, 2024
f228f16
fix
pgherveou Oct 7, 2024
034420a
fix
pgherveou Oct 7, 2024
14e8eb6
fix
pgherveou Oct 7, 2024
acd95d8
fixes
pgherveou Oct 7, 2024
feaa973
fix tx-pool
pgherveou Oct 7, 2024
ff86aae
Merge branch 'pg/revive-rpc-fixes-v2' of https://github.com/paritytec…
pgherveou Oct 7, 2024
03bc881
fix
pgherveou Oct 7, 2024
ea0d57d
fix
pgherveou Oct 7, 2024
c69817c
tmp fix
pgherveou Oct 7, 2024
b401c60
fix nonce logic
pgherveou Oct 7, 2024
3cd7491
cleanup tests
pgherveou Oct 8, 2024
e93ef66
fix tests
pgherveou Oct 8, 2024
804f402
fix fee dispatch_call
pgherveou Oct 8, 2024
179c2e3
Fix fees
pgherveou Oct 8, 2024
0ac59c2
why not
pgherveou Oct 8, 2024
b9ce758
restore test as they were
pgherveou Oct 8, 2024
3783095
wip
pgherveou Oct 8, 2024
ab8d7db
fix comp issue
pgherveou Oct 8, 2024
741c366
fix
pgherveou Oct 8, 2024
b8840e7
fix test
pgherveou Oct 8, 2024
4b85368
fix rlp encoding
pgherveou Oct 9, 2024
3739e45
wip
pgherveou Oct 10, 2024
46166f8
PR review
pgherveou Oct 10, 2024
2e12a9d
reorg use / mod
pgherveou Oct 10, 2024
4d909c7
Merge branch 'master' into pg/revive-rpc-fixes-v2
pgherveou Oct 10, 2024
5100f67
merge fixes
pgherveou Oct 10, 2024
b44294f
fix license
pgherveou Oct 10, 2024
75ca3f9
Add pallet-revive Ethereum JSON-RPC
pgherveou Oct 7, 2024
19dbf4c
wip
pgherveou Oct 7, 2024
595e66a
fixes
pgherveou Oct 7, 2024
96fa31d
wip
pgherveou Oct 8, 2024
551cd3d
update rpc stuff
pgherveou Oct 8, 2024
2a90e9b
rlp encoding
pgherveou Oct 8, 2024
4dede9c
Update
pgherveou Oct 8, 2024
c2609fa
add js stuff
pgherveou Oct 9, 2024
444970b
update yarn.lock
pgherveou Oct 9, 2024
f10cf13
nit
pgherveou Oct 9, 2024
f0e21af
server fixes
pgherveou Oct 9, 2024
205d8ab
fix demo
pgherveou Oct 9, 2024
0011601
undo log
pgherveou Oct 9, 2024
ed4c0d0
wip
pgherveou Oct 9, 2024
de0b0ef
rpc updates
pgherveou Oct 10, 2024
a745fb0
fixes
pgherveou Oct 10, 2024
75d39a6
fix examples
pgherveou Oct 10, 2024
7fea557
fix examples
pgherveou Oct 10, 2024
8c7fc93
clean up
pgherveou Oct 10, 2024
865acc4
fixes
pgherveou Oct 10, 2024
9f6bc42
kitchensink node fixes
pgherveou Oct 10, 2024
e806110
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 10, 2024
c95a99f
Update substrate/frame/transaction-payment/Cargo.toml
pgherveou Oct 10, 2024
a4ca32b
fix cargo
pgherveou Oct 10, 2024
53c72c5
fixes
pgherveou Oct 10, 2024
511842f
fix
pgherveou Oct 10, 2024
c43a520
Add prdoc
pgherveou Oct 10, 2024
f7053f1
Fix lock
pgherveou Oct 10, 2024
a1c0ad1
Add missing licenses
pgherveou Oct 10, 2024
4341122
fix markdown
pgherveou Oct 10, 2024
87a84ed
fix
pgherveou Oct 10, 2024
d3f536b
fixes
pgherveou Oct 10, 2024
87a52d1
fix clippy
pgherveou Oct 10, 2024
ef0b614
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 10, 2024
026453f
fix examples lint
pgherveou Oct 11, 2024
71cc897
fix clippy
pgherveou Oct 11, 2024
0446289
CI fixes
pgherveou Oct 11, 2024
a6bad6d
fix lint
pgherveou Oct 11, 2024
91cb4d5
taplo
pgherveou Oct 11, 2024
2afd66b
use blob_length from cyril's branch
pgherveou Oct 11, 2024
e59e9f2
fix test
pgherveou Oct 11, 2024
f1e612b
make it safe
pgherveou Oct 11, 2024
1a6cbec
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 11, 2024
a82401f
use blob_length
pgherveou Oct 11, 2024
9a0b3c6
fix
pgherveou Oct 11, 2024
26abb73
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 11, 2024
3183d67
Fix tests
pgherveou Oct 11, 2024
9539434
Update generated types
pgherveou Oct 11, 2024
7527e9f
Add eth_syncing
pgherveou Oct 11, 2024
c06133d
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 11, 2024
21ff12c
Merge branch 'master' into pg/revive-rpc-fixes-v2
pgherveou Oct 11, 2024
5493d17
Refacor import
pgherveou Oct 11, 2024
222a557
PR review get rid of signed extension
pgherveou Oct 12, 2024
bcd5675
nit
pgherveou Oct 12, 2024
42393f4
fix taplo
pgherveou Oct 12, 2024
e695c13
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 14, 2024
02059a4
Use new polkavm release
pgherveou Oct 15, 2024
e04242b
Fix version
pgherveou Oct 16, 2024
4384b5c
update lock
pgherveou Oct 16, 2024
4be1916
fix bare_eth params
pgherveou Oct 16, 2024
ad463ed
PR review use refactor
pgherveou Oct 17, 2024
abe59ff
Get rid of EthTransactKind
pgherveou Oct 17, 2024
44cd6cc
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 17, 2024
680a83b
rpc rm transact_kind
pgherveou Oct 17, 2024
6b5a956
Get rid codegen in this PR
pgherveou Oct 17, 2024
565a367
Use generic parameter for unchecked extrinsic
pgherveou Oct 17, 2024
39d1fd4
Get rid of ethcontractresultdetails
pgherveou Oct 17, 2024
7bfff66
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 18, 2024
6d91b2e
fix rpc
pgherveou Oct 18, 2024
ab6591e
Add tip
pgherveou Oct 18, 2024
0ec05bf
better log
pgherveou Oct 18, 2024
6eddc80
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 18, 2024
a340467
Fix fees calculuation
pgherveou Oct 18, 2024
dcc72c5
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 18, 2024
87d2bf8
update client
pgherveou Oct 18, 2024
419c4dc
fixes
pgherveou Oct 18, 2024
71a2439
Merge branch 'pg/revive-rpc-fixes-v2' into pg/revive-rpc-server
pgherveou Oct 18, 2024
b359f32
wip
pgherveou Oct 18, 2024
5894fb5
Fix fee calculation
pgherveou Oct 18, 2024
da1ec2d
actual_fee_no_tip -> actual_fee
pgherveou Oct 18, 2024
c419f71
missing
pgherveou Oct 18, 2024
417fa32
fix bad merge
pgherveou Oct 19, 2024
f35e668
rm rpc
pgherveou Oct 19, 2024
f646c9e
Update substrate/frame/revive/src/primitives.rs
pgherveou Oct 19, 2024
50015cb
gas_limit pr review
pgherveou Oct 19, 2024
2c09850
Merge branch 'master' into pg/revive-rpc-fixes-v2
pgherveou Oct 20, 2024
483b638
Update substrate/bin/node/runtime/src/lib.rs
pgherveou Oct 20, 2024
6a58fa5
Add comment on GAS_PRICE constant
pgherveou Oct 20, 2024
13fed3d
rm demo.rs
pgherveou Oct 20, 2024
83c0a38
fix tests
pgherveou Oct 20, 2024
9d06cfe
fix
pgherveou Oct 21, 2024
9e98cbb
simplify
pgherveou Oct 21, 2024
07a6717
Rename things to match #3685
pgherveou Oct 21, 2024
58a6942
typo
pgherveou Oct 21, 2024
d1de70f
fix
pgherveou Oct 21, 2024
e3f3f4b
CI build fixes
pgherveou Oct 21, 2024
05688e2
Restore files from previous PR
pgherveou Oct 21, 2024
5f88ef1
mv prdoc
pgherveou Oct 21, 2024
2f3122f
fix-up Cargo.toml
pgherveou Oct 21, 2024
d5e132d
fix up cargo.toml
pgherveou Oct 21, 2024
d07c790
fixup
pgherveou Oct 21, 2024
744eef7
fix
pgherveou Oct 21, 2024
ba34153
Merge branch 'master' into pg/revive-rpc-server-2
pgherveou Oct 22, 2024
56748fc
wip
pgherveou Oct 22, 2024
3262d34
bump subxt
pgherveou Oct 22, 2024
8e51a2c
fix bump
pgherveou Oct 23, 2024
a812fb7
fix
pgherveou Oct 23, 2024
93da773
Fix hard coded gas estimate in tests
pgherveou Oct 23, 2024
7999974
Update from pgherveou running command 'prdoc --audience runtime_dev -…
actions-user Oct 23, 2024
b435073
Update prdoc/pr_6192.prdoc
pgherveou Oct 23, 2024
d71a0a0
fixes
pgherveou Oct 23, 2024
570da46
unpub
pgherveou Oct 23, 2024
8e8b692
fixup client
pgherveou Oct 23, 2024
7a217b9
fixes
pgherveou Oct 23, 2024
7efcbbd
Merge branch 'master' into pg/revive-rpc-server-2
pgherveou Oct 23, 2024
ac700fc
fix AH config with new runtime api
pgherveou Oct 23, 2024
80182e3
fix missing use
pgherveou Oct 23, 2024
bf00157
add test
pgherveou Oct 23, 2024
15b9c27
lint fixes
pgherveou Oct 23, 2024
52c7290
clean up
pgherveou Oct 23, 2024
a0deaf6
cleanup
pgherveou Oct 23, 2024
deb191c
fix ci
pgherveou Oct 24, 2024
8a4007c
Merge branch 'master' into pg/revive-rpc-server-2
pgherveou Oct 24, 2024
81956a0
fix umbrella
pgherveou Oct 24, 2024
f1ea594
Merge branch 'master' into pg/fix-hardcoded-gas
pgherveou Oct 24, 2024
069c21c
Merge branch 'pg/fix-hardcoded-gas' into pg/revive-rpc-server-2
pgherveou Oct 24, 2024
8bb9db2
fix prdoc
pgherveou Oct 24, 2024
2efc281
update deploy
pgherveou Oct 24, 2024
7f88f8e
revive_api should use usable balance instead of free_balance
pgherveou Oct 24, 2024
22eef3a
Tweak tests
pgherveou Oct 24, 2024
82b4ca2
fix test
pgherveou Oct 24, 2024
67db7c4
fix test
pgherveou Oct 24, 2024
072734f
fix test
pgherveou Oct 24, 2024
83f6686
fix ;
pgherveou Oct 24, 2024
a0c7970
fix log message
pgherveou Oct 24, 2024
f0fe2b9
PR review
pgherveou Oct 24, 2024
552c547
rm Misc
pgherveou Oct 24, 2024
acd84d8
fix ci check
pgherveou Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 163 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ members = [
"substrate/frame/revive/fixtures",
"substrate/frame/revive/mock-network",
"substrate/frame/revive/proc-macro",
"substrate/frame/revive/rpc",
"substrate/frame/revive/uapi",
"substrate/frame/root-offences",
"substrate/frame/root-testing",
Expand Down Expand Up @@ -967,6 +968,7 @@ pallet-recovery = { path = "substrate/frame/recovery", default-features = false
pallet-referenda = { path = "substrate/frame/referenda", default-features = false }
pallet-remark = { default-features = false, path = "substrate/frame/remark" }
pallet-revive = { path = "substrate/frame/revive", default-features = false }
pallet-revive-eth-rpc = { path = "substrate/frame/revive/rpc", default-features = false }
pallet-revive-fixtures = { path = "substrate/frame/revive/fixtures", default-features = false }
pallet-revive-mock-network = { default-features = false, path = "substrate/frame/revive/mock-network" }
pallet-revive-proc-macro = { path = "substrate/frame/revive/proc-macro", default-features = false }
Expand Down
13 changes: 11 additions & 2 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use frame_system::{
};
use pallet_asset_conversion_tx_payment::SwapAssetAdapter;
use pallet_nfts::{DestroyWitness, PalletFeatures};
use pallet_revive::evm::runtime::EthExtra;
use pallet_revive::{evm::runtime::EthExtra, AddressMapper};
use parachains_common::{
impls::DealWithFees, message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance,
BlockNumber, CollectionId, Hash, Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
Expand Down Expand Up @@ -2069,8 +2069,17 @@ impl_runtime_apis! {
}
}

impl pallet_revive::ReviveApi<Block, AccountId, Balance, BlockNumber, EventRecord> for Runtime
impl pallet_revive::ReviveApi<Block, AccountId, Balance, Nonce, BlockNumber, EventRecord> for Runtime
{
fn balance(address: H160) -> Balance {
let account = <Runtime as pallet_revive::Config>::AddressMapper::to_account_id(&address);
Balances::usable_balance(account)
}

fn nonce(address: H160) -> Nonce {
let account = <Runtime as pallet_revive::Config>::AddressMapper::to_account_id(&address);
System::account_nonce(account)
}
fn eth_transact(
from: H160,
dest: Option<H160>,
Expand Down
17 changes: 17 additions & 0 deletions prdoc/pr_6147.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "[pallet-revive] Ethereum JSON-RPC"

doc:
- audience: Runtime Dev
description: |
Add a new Ethereum JSON-RPC server that can be used a substrate chain configured with pallet-revive
crates:
- name: pallet-revive
bump: patch
- name: asset-hub-westend-runtime
bump: patch
- name: pallet-revive-eth-rpc
bump: patch
- name: pallet-revive-fixtures
bump: patch
- name: polkadot-sdk
bump: patch
14 changes: 12 additions & 2 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ use pallet_identity::legacy::IdentityInfo;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_nfts::PalletFeatures;
use pallet_nis::WithMaximumOf;
use pallet_revive::evm::runtime::EthExtra;
use pallet_revive::{evm::runtime::EthExtra, AddressMapper};
use pallet_session::historical as pallet_session_historical;
// Can't use `FungibleAdapter` here until Treasury pallet migrates to fungibles
// <https://github.com/paritytech/polkadot-sdk/issues/226>
Expand Down Expand Up @@ -3157,8 +3157,18 @@ impl_runtime_apis! {
}
}

impl pallet_revive::ReviveApi<Block, AccountId, Balance, BlockNumber, EventRecord> for Runtime
impl pallet_revive::ReviveApi<Block, AccountId, Balance, Nonce, BlockNumber, EventRecord> for Runtime
{
fn balance(address: H160) -> Balance {
let account = <Runtime as pallet_revive::Config>::AddressMapper::to_account_id(&address);
Balances::usable_balance(account)
}

fn nonce(address: H160) -> Nonce {
let account = <Runtime as pallet_revive::Config>::AddressMapper::to_account_id(&address);
System::account_nonce(account)
}

fn eth_transact(
from: H160,
dest: Option<H160>,
Expand Down
Loading
Loading