quilt / eth1.0-specs Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ethereum/execution-specs
Specifications for the Ethereum 1.0. Tracking network upgrades.
This project forked from ethereum/execution-specs
Specifications for the Ethereum 1.0. Tracking network upgrades.
I think it would be nice to just build the docs on push to ensure we never merge a broken change.
^
I'd like to see a tool that sits above the eth1spec packages which can handle syncing mainnet, including the transitions between hardforks.
This, perhaps obviously, requires some kind of knowledge of hardforks and transition code. We've been thinking that we can put each hardfork on its own git branch, and tie them all together in a descendant package.
The RLP code has inherited the naming scheme of the yellow paper. It would be good to rewrite for clarity.
This would make @djrtwo happy and would be neat.
https://github.com/ethereum/eth2.0-specs/blob/dev/specs/merge/beacon-chain.md#protocols
https://pypi.org/project/eth2spec/1.1.0a7/
Static header checks. See stubbed function verify_header
.
Ideally we want every line of the spec tested in a format that is compatible with real world clients (like the ethereum/tests
tests.)
To get a good idea of how much of the spec is covered by reusable tests, we should separate out the coverage reports for the pytest runs and the ethereum/tests
runs.
This is an important task that should be done before we get too deep in implementing all the opcodes. The goal should be readability.
The current trie code has inherited the language from the yellow paper. It's pretty opaque, it would be useful to go through and rewrite/clean up.
^
A bit lower priority since we have access to all the ethereum/tests
now.
Currently commented out. We need to ensure the values have no leading 0
bytes. I believe the keys should be padded to 32 bytes though.
We need to implementEthHash
, the proof of work algorithm.
We should formalize any coding or style decisions not covered by black
into a document somewhere in the repository.
For now, this issue can be a temporary place to collect these kind of decisions:
fetch
instead of do_fetch
).OutOfGas
), and assert
for everything else.type: ignore
unless absolutely necessary.I'm thinking this can be done as a sphinx extension that subclasses literalinclude
and somehow adjusts the line filter to skip the docstring.
The documentation currently has snippets like:
def BE_inverse(b: Bytes) -> Uint:
"""
Converts a sequence of bytes into an arbitrarily sized unsigned integer `x`
from its big endian representation.
Parameters
----------
b : `eth1spec.eth_types.Bytes`
Bytes to decode.
Returns
-------
x : `eth1spec.number.Uint`
The byte sequence `b`, interpreted as a big endian unsigned integer.
"""
if verbose:
print("BE_inverse(", b.hex(), ")")
x = 0
for n in range(len(b)):
# x+=b[n]*2**(len(b)-1-n)
x += b[n] * 2 ** (8 * (len(b) - 1 - n))
return Uint(x)
But we want them to look like:
def BE_inverse(b: Bytes) -> Uint:
if verbose:
print("BE_inverse(", b.hex(), ")")
x = 0
for n in range(len(b)):
# x+=b[n]*2**(len(b)-1-n)
x += b[n] * 2 ** (8 * (len(b) - 1 - n))
return Uint(x)
Currently, the trie
implementation uses a bytes
type for the sequence of nibbles, with the stated validation rules that each byte may be no larger than 15. This requirement doesn't appear to actually be enforced and it would be ideal if the type definitions actually constrained the inputs via the type system rather than runtime validation.
I would suggest using an enum.IntEnum
for this:
class Nibble(enum.IntEnum):
NIBBLE_0 = 0x0
NIBBLE_1 = 0x1
...
NIBBLE_F = 0xf
Nibbles = List[Nibble]
Not only will this give you strong guarantees on anything that needs to take a Nibbles
type as an input, but it also lets you have runtime validation for free
def bytes_to_nibbles(value: bytes) -> Nibbles:
return [Nibble(v) for v in value] # will raise a TypeError if the value isn't part of the Enum)
Maybe this is already possible, but it would be help get a simple command setup that will host the docs as you live edit.
mload
sload
mload8
calldatacopy
calldataload
calldatasize
should be done in coordination with #10
^
Since Uint
is arbitrarily sized, we should create a U256
type which is capped.
SUB
, MUL
, DIV
, SDIV
, MOD
, SMOD
, ADDMOD
, MULMOD
, EXP
, SIGNEXTEND
Once #34 is merged, someone needs to go through every use of Uint
and U256
and decide if it's using the correct type by comparing against the yellowpaper and/or client code.
^
Should also verify the trie root matches the block being processed.
Can we deploy the docs to some github.io
page once it's merged into pyspec
?
I'd like to implement EVM tracing, but not have that code show in the docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.