by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 02 2018 10:49
    @holgerd77 banned @johnny_musk_twitter
Gabriel Rocheleau
@gabrocheleau
Hi everyone!
I'm trying to learn more about Ethereum's underlying technology. I'm now studying Merkle Patricia Trees, and would like to test my knowledge by building and playing with actual Merkle Patricia Trees. I'm most familiar with JS, so I figured I'd use the Merkle Patricia Trees library from EthereumJS. However I'm getting several errors when trying to run the examples in the documentation. Is this library still up-to-date?
Ryan Ghods
@ryanio
Hey @gabrocheleau - which examples are you having problems with? I’ve heard geth has been changing their db format so a leveldb file from them might not work exactly
also we haven’t released 4.0 on npm yet which is what the examples on master branch would be referencing
Gabriel Rocheleau
@gabrocheleau
Hey @ryanio ! Thanks for the prompt reply. I'm trying to run the first code block under "Initialization and Basic Usage". I'm running into issues of the "level" module not being available, the "await" usage being invalid.
Ryan Ghods
@ryanio
You’ll need to install the level module
What version of mpt are you using?
await usage (only MPT v4) would need to be in a async function
Gabriel Rocheleau
@gabrocheleau
I've initially installed it using "npm install merkle-patricia-tree" so I assume that'd be version 3.0. I've also tried cloning the github repo and working with that, but then I need to adjust the examples and am not yet comfortable enough with the library to know what to modify.
Ryan Ghods
@ryanio
and no problem, welcome ☺️
Gabriel Rocheleau
@gabrocheleau

await usage (only MPT v4) would need to be in a async function

I can see that, but I'm wondering what I'm missing here. Where should the code written under "Initialization and Basic Usage" be run for it to work without returning errors?

I'll be happy to help with clarifying the documentation if I can understand the proper setup required.
Ryan Ghods
@ryanio
@gabrocheleau ok you might be on 2.3.2 then, see the rearme and docs here https://github.com/ethereumjs/merkle-patricia-tree/tree/v2.3.2
We are planning to do our 4.0 release on npm this week or early next week. If you want to build from source for 4.0 just pull the 4.0 tag and run “npm install” then “npm run build” and import tries from the “dist” directory
Gabriel Rocheleau
@gabrocheleau
@ryanio Thank you! I'll try that this afternoon.
Ryan Ghods
@ryanio
👍
Gabriel Rocheleau
@gabrocheleau
Great, I was able to get it to work with version 2.3.2 docs. I'm thinking about re-writing the outdated and often-referenced Merkle Patricia Tree tutorial (https://easythereentropy.wordpress.com/2014/06/04/understanding-the-ethereum-trie/) with new exercises that would use the JS library. Is that something that you think would be useful to the community?
Ryan Ghods
@ryanio
great. yeah that would be pretty cool! we link to that article from our readme so would be nice if there was an updated version.
Gabriel Rocheleau
@gabrocheleau
Cool I'll look into this, a good way to learn and keep myself accountable too.
Ryan Ghods
@ryanio
maybe you could use mpt v4 for the examples? should be a lot cleaner with async/await syntax
Gabriel Rocheleau
@gabrocheleau
Yes good idea.
Gabriel Rocheleau
@gabrocheleau
Quick question: why isn't the "level" library not included by default in package.json?
Gabriel Rocheleau
@gabrocheleau
It seems like I should instead use the "level-mem" library, which bundles level-up and memdown
Holger Drewes
@holgerd77
Just published v3.0.0 or our devp2p library ethereumjs-devp2pon npm. This is the first official TypeScript release of the library. Special thanks to @dryajov for this huge rewrite (everything: sources , examples, tests) ❤️ 🎉 as well as @PhilippLgh and @ryanio for their follow-up integration work!
Gabriel Rocheleau
@gabrocheleau
Awesome, good to hear.
Are you planning on releasing v4.0.0 also? @ryanio mentioned that the 4.0 npm release was planned for this week.
Oh nvm, I thought you were talking about the Merkle Patricia Tree library
Ryan Ghods
@ryanio
@gabrocheleau yes we should be releasing that this week :)
Gabriel Rocheleau
@gabrocheleau
Great, I should be able to finish the tutorial on MPT this week also.
Ryan Ghods
@ryanio
sounds great, looking forward to checking it out
Gabriel Rocheleau
@gabrocheleau
Holger Drewes
@holgerd77
Jut published v2.2.5 of the rlp library, this release adds support for native BigInts as an encoding input type.
@gabrocheleau That looks fantastic! :thumbsup: :smile: Feel free to open a PR towards the README linking your tutorial once v4 is out (maybe at the end of the Usage section would fit well?)
Holger Drewes
@holgerd77
Just published ethereumjs-util v7.0.2 on npm. The release re-upgrades the BN.js re-export version to v5 after an import fix on interoperability issues between BN.js v5/v4 has been released. An upgrade is strongly recommended, v7.0.1 is marked as DEPRECATED now.
Gabriel Rocheleau
@gabrocheleau

@gabrocheleau That looks fantastic! :thumbsup: :smile: Feel free to open a PR towards the README linking your tutorial once v4 is out (maybe at the end of the Usage section would fit well?)

Sure, I'll open a PR request once v4 is out! 2/3 of the blog posts currently linked are offline or use deprecated libraries.

vlddm
@vlddm
is there some libs supporting WASM accelerated hd derivation (bip32/44)?
Ghost
@ghost~5eda2317d73408ce4fe60596

Hello everyone. Wanted to ask if somebody can point right direction to get emitted event data from JsVM smart contract execution.

I've seen that Remix IDE in JsVM mode is able to return event data, but was not able to find any example where such logic was explicit. Would appreciate suggestions. Thanks.

Sina Mahmoodi
@s1na
Are you referring to logs or execution events like which opcode was executed etc.?
Ghost
@ghost~5eda2317d73408ce4fe60596
I'm referring to logs.
Sina Mahmoodi
@s1na
If you're using runTx it returns an object res which has res.execResult.logs
Ghost
@ghost~5eda2317d73408ce4fe60596
Yes. Those a Buffer instances which are a bit not user-friendly. Is there any way to decode them to and display as common JavaScript (or JSON) object?

Let me clarify things a bit:

pragma solidity ^0.5.2;

contract SimpleStorage {
    uint storedData = 0;

    event SetNotification(uint val);

    function set(uint x) public returns (uint, uint) {
        storedData = x;

        emit SetNotification(storedData);

        return (111, 222);
    }

    function get() public view returns (uint) {
        return storedData;
    }
}

When we call set(123) and emit SetNotification event, is there any direct way to get

{
    "from": "0x3b06361579e400227d09ef0c197a461f505f66f5",
    "topic": "0x2741a8eb6930759e133b1a5261f1e4eb0fa83ea4fe572c39f335a714cefc1a3c",
    "event": "SetNotification",
    "args": {
        "0": "123",
        "val": "123",
        "length": 1
    }
}

Via JsVM and utilities out of the box?

Sina Mahmoodi
@s1na
The VM only works on raw values. each log in the list above is in the form [fromAddress, [topics], encodedData]
Ghost
@ghost~5eda2317d73408ce4fe60596
So it seems to be some top-level funtionality then. Thanks, I will investigate a bit more.
Sina Mahmoodi
@s1na
It doesn't have access to some information like the event name (we can't revert the hash to get the preimage). I'm not sure how solidity encodes the args, if its ABI there's also an ABI library
Ghost
@ghost~5eda2317d73408ce4fe60596

@s1na You saved my day. So, the first topic is the hashed event name or signature. This can be precomputed to then match hash of first log topic (if the log belongs to event). Data payload of log can also be decoded, when we do have event signatures.

Thank you very much.

Holger Drewes
@holgerd77

Hi @/all,
this channel has been moved over to Discord and we will therefore close the channel here.

The new Discord Server from the EF JavaScript Team has channels on the following projects

  • EthereumJS
  • Grid
  • Ethers
  • Web3.js

... as well as some dedicated topic channels like VM, stateless or eth2.

You are all very much invited to join. Here is the invitation link: https://discord.gg/TNwARpR

See you on Discord! 🌻 😃

The EF JavaScript Team


This channel has been closed. Please don't further comment here.

besmily
@besmily
bonjour, il serait possible de trouver une développeur eth pour integrer une passerelle avec mon site htpps?