Eth 2.0
Presentation by @protolambda
Consensus state-machine
& executable specs
Taipei meetup 29 Apr. '19
Eth 2.0
Quick recap


GitHub

ETH 2.0 Spec-development timeline
(2019 only)
Eth 2.0
Spec components

Eth 1.0
Full-node
Eth 2.0 - phase 0
Beacon-node

Eth 2.0 - phase 1
Shards! Data availability!

Eth 2.0 - phase 2
Contracts!


Consensus state-machine, executable spec
@protolambda (EF Research)
Networking and libp2p
Kevin (Trinity)


Eth 2.0
"consensus state-machine"
How do you define a spec?


Valid block identity in Ethereum 1.0:
Example:
The academically verbose (but beautiful) way:


What characterizes the current Eth 2 spec wording:





-
Block transition
-
Slot transition
-
Epoch transition



Quick walkthrough:
what happens here?




Eth 2.0
Executable spec

"Pyspec"
The first exec-spec:





run build_spec.py:
core/0_beacon-chain.md
eth2spec/phase0/spec.py
make -B pyspec

What you can do with:

Pytests

Test-generation
Clients can check if they match the spec, literally.

v0.6.0 introduces new tests:

ZRNT
minimal "ZehRehNehTy"
a.k.a. Serenity
Exec. Go Spec

Some history:


Conceptually complete, but lots of lurking bugs...

Mini project:
convert bounty work in quality pyspec alternative


Result:

Keep it up to date with


Make sure *all* the generated tests are correct
Extreme example:


Cross-reference, find bugs!
Pyspec
ZRNT

- Coverage; find bugs + test better
- Benchmark: go-spec is fast, no set operations, minimal memory allocations
- Fast enough for fuzzing
- counterpart for differential fuzzing
Eth 2.0
Future of exec. specs

Pyspec
- more testing
- more test-generation
- compare against clients / ZRNT
ZRNT


A new Go client?

Phase 2, to be integrated
Questions?
Thanks!



@protolambda
eth2-state-machine
By protoslides
eth2-state-machine
- 1,002