Giter Club home page Giter Club logo

Comments (2)

gavofyork avatar gavofyork commented on July 19, 2024

The root of the empty trie is a 0_256 (i.e. a 32-byte 'hash' of zeros).
From the YP:

The empty trie is defined as being a 256-bit hash of zeroes, $0_{256}$.

Trie roots are allowed to be deep (and there are several real examples of
this), but the empty trie has, since
ethereum/aleth@4aa0c71
been
defined as the zeroed hash.

This means all nodes are either 2 or 17 items; never zero.

Never put down to incompetence that which can be adequately explained by
self-interest.

On 13 May 2014 14:04, heikoheiko [email protected] wrote:

currently we don't get compatibility with the cpp client. the state.roots
after adding the premine accounts differ. I tried to isolate the problem:
https://github.com/ethereum/pyethereum/blob/master/tests/test_chain.py#L88

from the YP it looks like empty trie roots would be represented as
'\x00'*32 in the cpp client. if so it would not match the empty string
that we use.

  • Comment by Vitalik Buterin: that's wrong, trie roots are allowed to
    be either empty or even deep arrays (though that should never happen in
    practice)

YP: https://raw.githubusercontent.com/ethereum/latexpaper/master/Paper.tex
0256 , SHA3RLP(), 0160 , stateRoot, 0256 , 2**22 , 0, 0, 1000000, 0, 0,
(), SHA3(42), (), ()

Where 0256 refers to the parent and state and transaction root hashes, a
256-bit hash which is all zeroes; and the implementation looks like it
would implement it just like this:
https://github.com/ethereum/cpp-ethereum/libethereum/BlockInfo.cpp#L64

h256() << sha3EmptyList << h160() << stateRoot << h256() <<
c_genesisDifficulty << 0 << 0 << 1000000 << 0 << (uint)0 << string() <<
sha3(bytes(1, 42));

also the default for an account looks different in cpp
['', '', h256(), sha3('')] rather than ['', '', '', ''] currently in
pyethereum.


Reply to this email directly or view it on GitHubhttps://github.com//issues/91
.

from pyethereum.

heikoheiko avatar heikoheiko commented on July 19, 2024

thanks. see #92

from pyethereum.

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.