Giter Club home page Giter Club logo

Comments (9)

rupam-04 avatar rupam-04 commented on June 19, 2024 1

great!

this doesn't require any offchain components, I think we can start with type bindings for the endpoint, then the trait function and then try to implement the described logic. the pr has a few test cases, we can use the objects to generate bindings: https://transform.tools/json-to-rust-serde

So do we end up with the following somewhere?

use serde_derive::Deserialize;
use serde_derive::Serialize;

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Root {
    pub jsonrpc: String,
    pub id: i64,
    pub method: String,
    pub params: (Params, String),
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Params {
    pub block_state_calls: Vec<BlockStateCall>,
    pub trace_transfers: bool,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BlockStateCall {
    pub state_overrides: StateOverrides,
    pub calls: Vec<Call>,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StateOverrides {
    #[serde(rename = "0xc000000000000000000000000000000000000000")]
    pub n0xc000000000000000000000000000000000000000: n0xc000000000000000000000000000000000000000,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct n0xc000000000000000000000000000000000000000 {
    pub balance: String,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Call {
    pub from: String,
    pub to: String,
    pub value: String,
}

from reth.

dhruvmalik007 avatar dhruvmalik007 commented on June 19, 2024 1

Apologies for delay as I had issues running reth on limited specs laptop and thanks @rupam-04 for reaching out.

This is a correct description of traits although what I also added is to develop the traits while taking also the pre implemented types (i.e reth_trie::StateRoot , so as to have consistent API ). if possible we can have a joint PR for this one and I will work on the side of writing the structures for the parameters along with the API method.

from reth.

KillariDev avatar KillariDev commented on June 19, 2024 1

hey, If you are interested in joining eth_simulatev1:s implementers call, we have a meeting every Monday. You can find the meeting in the Ethereum Protocol Calls calendar

from reth.

dhruvmalik007 avatar dhruvmalik007 commented on June 19, 2024

Hey, I am interested to try my luck creating PR on this issue . I wanted to understand various things :

  • in terms of the specification regarding the transaction batching and merging the arbitrary blocks : do we need to maintain the sliding window in order to manage the state of the n blocks which are parsed .

  • also the use of the ExEx executors for composing the transactions as the offchain hooks is required in this case ?

Thanks

from reth.

mattsse avatar mattsse commented on June 19, 2024

great!

this doesn't require any offchain components, I think we can start with type bindings for the endpoint, then the trait function and then try to implement the described logic.
the pr has a few test cases, we can use the objects to generate bindings: https://transform.tools/json-to-rust-serde

from reth.

rupam-04 avatar rupam-04 commented on June 19, 2024

Apologies for delay and thanks @rupam-04 for reaching out.

This is a correct description of traits although what I also added is to develop the traits while taking also the pre implemented types (i.e reth_trie::StateRoot , so as to have consistent API ). if possible we can have a joint PR for this one and I will work on the side of writing the structures for the parameters along with the API method.

feel free to continue your work on this, I just subscribed to this issue as it looked interesting to me. I am looking forward to how you implement the whole thing.

from reth.

dhruvmalik007 avatar dhruvmalik007 commented on June 19, 2024

Thanks @KillariDev I will be there to resolve my queries.

from reth.

Rjected avatar Rjected commented on June 19, 2024

Hey @dhruvmalik007 have you made any progress on this / do you have any questions?

from reth.

dhruvmalik007 avatar dhruvmalik007 commented on June 19, 2024

Hey @dhruvmalik007 have you made any progress on this / do you have any questions?

Hi , I am kind of stuck in the progress due to personal workload last 3 weeks and was just able to define the traits on personal branch dhruvmalik007/simulate_v1 till now.

on the side of questions its fine as already the eth_multicall group has answered the call during one of the monday call. I can try to put effort from this week to finish the methods simulate_many or else I will let people know to either implement their version or use my code.

from reth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.