-
Notifications
You must be signed in to change notification settings - Fork 667
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 #5953
base: pg/revive-rpc-fixes-v2
Are you sure you want to change the base?
Conversation
d80a5ce
to
d931a80
Compare
Depends on #5866
ebb0b36
to
de0b0ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great that it works with vanilla ether.js now. This is how it should have been.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a better name than just "demo". Maybe "rpc_demo".
#[subxt::subxt( | ||
runtime_metadata_path = "kitchensink.scale", | ||
substitute_type( | ||
path = "pallet_revive::primitives::EthContractResult<A>", | ||
with = "::subxt::utils::Static<::pallet_revive::EthContractResult<A>>" | ||
), | ||
substitute_type( | ||
path = "pallet_revive::primitives::EthTransactKind", | ||
with = "::subxt::utils::Static<::pallet_revive::EthTransactKind>" | ||
), | ||
substitute_type( | ||
path = "sp_weights::weight_v2::Weight", | ||
with = "::subxt::utils::Static<::sp_weights::Weight>" | ||
) | ||
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to use the dynamic API of subxt here. Otherwise the pallet ids and so on will be hardcoded to whatever kitchensink is using, right?
Or how do we make sure that this will be compatible across different runtimes (westend ah, kusama ah, polkadot ah)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes correct, the only thing that can break I believe is the encoding of the dispatchable, since the index will differ for each runtime, I was planning to go with feature flag to start with, until I find a more suitable solution, will look into their dynamic API as well.
pub extern "C" fn call() { | ||
input!(128, data: [u8],); | ||
api::deposit_event(&[], data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert the selector here? ether.js should derive a selector from the provided ABI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right yes it does, might be easier to add the assert in the js code directly, since that's where we define the "fake ABI"
No description provided.