Git Product home page Git Product logo

Comments (12)

armaniferrante avatar armaniferrante commented on June 26, 2024 1

@ArjunBhuptani I updated the repo to use the latest openethereum packages, since everything moved over from paritytech to a new org. You'll want to pull the latest changes.

from pure-evm.

ArjunBhuptani avatar ArjunBhuptani commented on June 26, 2024

If we were to implement this ourselves and PR it, how would this work?

from pure-evm.

ArjunBhuptani avatar ArjunBhuptani commented on June 26, 2024

So all we should need to do is to implement the following I think?

call(...) {
    fn call(
    &mut self,
    _gas: &U256,
    _sender_address: &Address,
    _receive_address: &Address,
    _value: Option<U256>,
    _data: &[u8],
    _code_address: &Address,
    _call_type: CallType,
    _trap: bool,
) -> ::std::result::Result<MessageCallResult, TrapKind> {
    if _receive_address == Address::hex!("0x1") {
        let d = // do ecrecover here
        Ok(MessageCallResult::Success(*gas, ReturnData::&*d))
    } else {
        unimplemented();
    }
}

from pure-evm.

armaniferrante avatar armaniferrante commented on June 26, 2024

@ArjunBhuptani that seems like a good place to start. You also need to keep track of the callstack depth and implement the depth externality--though you can probably just return a fake constant since it's only used on calls and creates.

from pure-evm.

ArjunBhuptani avatar ArjunBhuptani commented on June 26, 2024

Ah good tip, thanks!

from pure-evm.

LayneHaber avatar LayneHaber commented on June 26, 2024

Alright, so working on creating a test that will emulate this properly within our fork. Having a bit of trouble getting the regular node tests passing, are there specific instructions for running those?

from pure-evm.

LayneHaber avatar LayneHaber commented on June 26, 2024

Right now the workflow is:

  1. cargo build in root and in /wasm
  2. make build in /wasm
  3. yarn install && yarn test in /examples/node

but I seem to be messing things up along the way

from pure-evm.

LayneHaber avatar LayneHaber commented on June 26, 2024

I seem to be getting this error when trying to merge the browser and node packages:
sed: pkg-node/pure-evm_bg.js: No such file or directory

from pure-evm.

LayneHaber avatar LayneHaber commented on June 26, 2024

Yeah, as soon as I use the imports from ../pkg-node it starts to behave

from pure-evm.

armaniferrante avatar armaniferrante commented on June 26, 2024

You should only need steps 2 and 3, as listed above.

Maybe you don't have wasm-pack installed (or something else)? pkg-node shouldn't be there if the build was successful.

(To install wasm-pack, you can use the docker container with all the required deps or install it directly with this line https://github.com/armaniferrante/pure-evm/blob/master/.circleci/docker/Dockerfile#L18)

from pure-evm.

LayneHaber avatar LayneHaber commented on June 26, 2024

yeah there was a different error when I didn't have wasm installed. not sure what's off with my build step quite yet, but found a workaround so i'll probably come back to that later

from pure-evm.

ArjunBhuptani avatar ArjunBhuptani commented on June 26, 2024

PR: #13

from pure-evm.

Related Issues (7)

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.