-
Notifications
You must be signed in to change notification settings - Fork 675
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
base: master
Are you sure you want to change the base?
Conversation
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.
Very nice! Definitively gonna fire up some of the examples to try it out
@@ -48,7 +48,7 @@ type CallOf<T> = <T as frame_system::Config>::RuntimeCall; | |||
/// We use a fixed value for the gas price. | |||
/// This let us calculate the gas estimate for a transaction with the formula: | |||
/// `estimate_gas = substrate_fee / gas_price`. | |||
pub const GAS_PRICE: u32 = 1_000u32; | |||
pub const GAS_PRICE: u32 = 1u32; |
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.
Is this intentional? Might also be worthwhile to explain the bases of the estimate in the comment
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.
Yeah I think either value is fine since they are constant
1 is nice since we can compute tx.gas = dry_run.fee / GAS_PRICE, there are no rest to the division
#[async_trait] | ||
impl MiscRpcServer for MiscRpcServerImpl { | ||
async fn healthcheck(&self) -> RpcResult<()> { | ||
Ok(()) |
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.
Is the idea here just to be able to ping the server?
Wondering why this is a trait, seems like if this is just to have a ping like check it seems superfluous to have a trait for it.
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.
Is the idea here just to be able to ping the server?
Yes, a trait for every other rpc.
I can probably remove this one for now,
with jsonrpsee crate you define your rpc on a trait with the #[rpc]
macro and then implement it on the server, the client trait is generated as well for you through this Macro.
Redo of #5953