Commit Graph

116 Commits

Author SHA1 Message Date
Raul Jordan
dcc0672a19
Fatal if ChainStart Receiving Fails (#1665)
* fatal if impossible to receive chainstart

* fix tests
2019-02-20 15:58:23 -06:00
terence tsao
06bfda24d5 Revert "Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655)" (#1664)
This reverts commit 15f8b6a10d.
2019-02-20 14:46:30 -06:00
terence tsao
15f8b6a10d
Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655) 2019-02-20 11:53:49 -08:00
Raul Jordan
19abe81472
Implement Randao Reveal Signing in Proposer Client (#1650)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* block processing test into own package to avoid cycle

* randao tests pass

* blocks test passing

* use common deposit generator

* helper

* resolved import cycle

* setup initial

* builds

* almost done with blockchain tests

* fix blockchain tests

* getting through with chaintests

* revert client change

* lint

* sync master conflict gazelle

* randao test fixes

* randao proposer impl

* tests pass
2019-02-20 12:58:34 -06:00
Raul Jordan
9bee695a3b
Implement Eth1Data RPC Server Functionality (#1615)
* eth1 data comments

* eth1 data RPC server side impl

* logic is data objects is empty

* finished eth1 server logic

* update comments

* fmt

* big int comparisons

* begin adding eth1 data tests

* empty data votes test runs

* all tests complete with every code branch triggered, behavior correct

* fmt, imports

* address comments

* wrapped up tests

* addressed all comments
2019-02-20 11:57:02 -06:00
Raul Jordan
b0f5324303
Implement BLS Based RANDAO (#1633)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* block processing test into own package to avoid cycle

* randao tests pass

* blocks test passing

* use common deposit generator

* helper

* resolved import cycle

* setup initial

* builds

* almost done with blockchain tests

* fix blockchain tests

* getting through with chaintests

* revert client change

* lint

* sync master conflict gazelle

* randao test fixes
2019-02-19 23:07:28 -06:00
terence tsao
c30bef0812
Implement Next Epoch Committee Assignment for RPC Server (#1641) 2019-02-19 15:31:04 -08:00
Raul Jordan
2425bef5c7
Update Configuration, Naming, and GenesisStart to Accommodate Randao (#1647)
* signature on startup configuration

* remove ref to hash32s for randao

* completed changes
2019-02-19 14:24:00 -06:00
Raul Jordan
ab511cb022
Move Deposit Encoding to Helpers Package (#1644)
* move deposits

* finish moving deposit helpers
2019-02-19 12:05:34 -06:00
Raul Jordan
3e46381b3f
Fetch the Correct Chain Head During AttestHead (#1596)
* correct attester view of chain head and prioritize proposer

* fix attempt not working

* revise with correct logic

* attester fixess to root fetching, spec did not make sense

* comments to match code

* fix attester responsibility

* comments
2019-02-18 23:49:56 -06:00
terence tsao
8c04ced1a6 Name Changes to Align with V0.3 (#1621)
* fixed epoch_processing

* penalize->slash

* exit -> voluntary_exit

*  SEED_LOOKAHEAD -> MIN_SEED_LOOKAHED

* ENTRY_EXIT_DELAY -> ACTIVATION_EXIT_DELAY

* `INCLUDER_REWARD_QUOTIENT` -> `ATTESTATION_INCLUSION_REWARD_QUOTIEN`

* LatestIndexRoots -> LatestActiveIndexRoots

* `MIN_VALIDATOR_WITHDRAWAL_EPOCHS` -> `MIN_VALIDATOR_WITHDRAWAL_DELAY`

* MAX_WITHDRAWALS_PER_EPOCH -> MAX_EXIT_DEQUEUES_PER_EPOCH

* ETH1_DATA_VOTING_PERIOD -> EPOCHS_PER_ETH1_VOTING_PERIOD

* SLOT_DURATION -> SECONDS_PER_SLOT

* EPOCH_LENGTH -> SLOTS_PER_EPOCH

* SLOT_DURATION -> SECONDS_PER_SLOT take 2

* rest of the misc fixes for config name changes

* remove tools/bootnode/.!74296!bootnode.go

* `current_epoch_start_shard` -> `current_shuffling_start_shard`, `current_shuffling_epoch`, `current_shuffling_see`

* go fmt

* fixed comment

* updated pseudocode comments

* merged master
2019-02-18 10:52:16 -06:00
Raul Jordan
c032b0f6b5
Pending Attestations RPC Server/Client Implementation (#1617)
* complete tests for integrating the attestations pool

* fix broken build
2019-02-15 18:36:40 -06:00
terence tsao
de4c8667fd Fixed Get Block Root (#1616)
* fixed epoch_processing

* test p2p

* fixed get block root and tests

* in test nightmare, yay

* fixed all the tests

* lint
2019-02-15 17:19:36 -06:00
Raul Jordan
1d72cee59c Revive Our Demo Config for Local Testing (#1602) 2019-02-14 15:01:07 -08:00
Raul Jordan
ae13bb5c83
Use Tree Hashing Algorithm Everywhere for Block Roots and State Root (#1577)
* begin using tree hash instead of hash for state and blocks

* replace with ssz

* rem references to vote cache

* replace all instances of state/block hash with root

* goimports

* almost every test in the world fails

* goimports

* all tests pass, tree hash across repo
2019-02-14 14:04:47 -06:00
terence tsao
89b451cb6e Move Validator Helper Functions to Helper Package (#1584)
* fixed epoch_processing

* test p2p

* refactored validator helpers to helper package

* increased validator test cov
2019-02-13 15:04:31 -06:00
Raul Jordan
f707f14cb2
Change BLS Public Key Length Check in Beacon RPC Server (#1571) 2019-02-13 12:08:25 -06:00
Raul Jordan
c4ad6f220d
Wait to Send Genesis Time to Validators Until After Genesis State is Initialized (#1568)
* add state initialized feed to send to rpc service

* rpc tests pass by using mock initializer

* verifies the chain start send and receive

* chain start chan sub test

* goimports
2019-02-13 11:51:57 -06:00
Raul Jordan
5dc5f1d1c8 Update Contract to Use Little Endian And Encoding Across Entire Repo (#1536)
* using little endian and tests for encoding dep inputs

* use decode value and timestamp method in state

* updated comments to match serialization format

* latest compiled contract, abi, bytecode, and bindings

* to little endian everywhere

* fix all tests except for contract tests

* include contract changes

* address broken build

* compile with vyper v8

* update readme

* fix pkg name

* add skip chainstart delay

* skip chainstart delay tests pass

* to little endian timestamp
2019-02-12 09:27:00 +05:30
Raul Jordan
3d8bb73f15
Attester RPC Server Functions (#1505)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* server implementation logic

* attestation info tests

* completed passing tests, tree hash still blocked by error with nil fields unfortunately

* fix todo failure

* gazelle rerun and master merge

* testing full behavior of attestation info server

* finished all required server tests and implementation

* break loop

* fix tests due to genesis slot updates
2019-02-11 10:15:25 -06:00
terence tsao
4cadd534db
Update Genesis Slot and Epoch (#1537) 2019-02-10 23:09:35 +01:00
Raul Jordan
12524ae8dd
Update RANDAO to Match Spec (#1533)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* deprecate all instances of old randao logic

* fix all broken tests and cleanup randao references across repo

* builds but tests failing

* fixing broken chaintests

* only chaintests fail now

* randao fully updated

* add bls todo

* lint

* travis

* fix unresolved property in struct

* remove used randao var
2019-02-09 14:35:51 -06:00
terence tsao
c46a583acb
Update MaxDeposit Config Names (#1539) 2019-02-09 14:09:09 +01:00
Nishant Das
b07a3c3bb8 Update Deposit Contract (#1494)
* Update deposit Contarct

* updating deposit trie

* add verifyMerkleBranch

* fix test

* fixed all tests

* fix other tests

* fixing a test

* All tests are fixed

* lint

* fix lint
2019-02-08 11:01:15 -06:00
Preston Van Loon
05c6689c9d Pending Deposits RPC Server Implementation (#1508)
* Add impl for pending deposits via gRPC

* Add test for pending deposits RPC
2019-02-06 12:06:31 -06:00
Raul Jordan
61026103c6
Validator Attester Rewrite (#1487)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* tests passing after checking for empty committee and crosslink root

* address nishant comments
2019-02-06 10:20:38 -06:00
terence tsao
506db55be5
Aligning ETH2.0 spec - Make Epoch First Citizen (Shuffling and GetCrosslinkAtSlot) (#1488) 2019-02-05 19:52:14 +01:00
Preston Van Loon
2a0eae163e
Handle idx panic (#1492)
* fix panic on empty first committee

* fix issue in validator server too
2019-02-05 11:15:54 -05:00
Preston Van Loon
4add403335
Validator Proposer Rewrite (#1462)
* WIP - with TODOs

* interface w/ test

* basic test for broadcast

* Add computeStateRoot funciton

* remove custody challenge

* resolve TODO lint issues

* more TODOs

* revert new line in types.proto

* broadcaster comment

* one of several failure condition tests

* Add test cases

* handle compute state error test case

* fix config in validator helpers

* fix tests too

* fix conflict

* partial PR feedback

* remove p2p

* gazelle

* package comment

* Better godoc
2019-02-05 08:47:25 -05:00
Andrei Ivasko
4672859832 Create RPC health check (#1385)
* rpcHealth

* TestBadEndPoint not passed

* Crasher and TestCrasher()

* panic and recover

* assertPanic , TestBadEndPoint failed because of panic in goroutine

* log not found: Starting go routine

* TestLogger implementation

* Testlogger with map  and overriden Fatalf

* rebased

* testLogger - modified the severity of message - added TestStatus - goimports

* fix test issues

* fmt
2019-02-04 15:54:30 -06:00
terence tsao
720c80d8ee Aligning ETH2.0 spec - Make Epoch First Citizen (Package: Committee) (#1477)
* able to bazel build beacon chain.. yay

* fixed package validator tests

* fixed a few more package tests (epoch, blockops, forkchoice)

* fixed all the tests! and lint. Woohoo

* moving committee helpers to own package

* more fixes at epoch processing

* fixed rewards and penalties tests

* fixed rest of the tests. yay
2019-02-04 15:27:28 -06:00
Raul Jordan
088507af66
Initialize State from ChainStart Deposits in POWChainService (#1474)
* tests passing once again in db package

* fixed all tests

* revert some weird p2p changes made accidentally

* fix repeated code

* build fixed

* fix p2p

* fix all tests
2019-02-03 16:44:48 -06:00
terence tsao
8c355497ee
Beacon Block Operation Pool to store Attestation (#1444) 2019-01-31 19:54:24 +01:00
Raul Jordan
cec6c8de83 Standardize Naming of Shared Packages, Remove Deprecated Packages (#1435)
* rem txpool

* standardize repo shared utils, remove deprecated items

* complete

* package lvl godoc
2019-01-31 10:53:58 +08:00
Raul Jordan
425ec4eee1
Add NoSigVerification Option to State Transition (#1434)
* no sig verify

* gofmt
2019-01-30 13:45:01 +01:00
Raul Jordan
ec9240106e
Implement WaitForChainStart RPC Server and Client (#1421) 2019-01-30 13:28:53 +01:00
terence tsao
c0f36e467b
Eliminate Custody Logic for Phase 0 (#1408) 2019-01-30 11:11:13 +01:00
Raul Jordan
07c0387be1
Validator Epoch Assignments RPC Implementation (#1419)
* begin reorder

* move into beacon server

* add proposer server

* fix

* add proposer server

* wrap up rpc reorder

* eliminated deprecated RPC endpoints

* formatted nicely

* RPC protos

* fix lint

* integrate hash proto

* epoch assignments

* deprecated committee code

* remove deprecated messages

* fixed mocks, added tests for validator epoch assignments

* gazelle

* fix broken bazel

* nishant comment
2019-01-29 13:56:14 +01:00
Ivan Martinez
e9cfc08549 Update all beacon constants to latest in spec (#1407)
* Update all beacon constants

* Fix documentation

* Fix sync time in config

* Fix some names
2019-01-29 12:16:50 +08:00
Raul Jordan
4c46b02dac
Deprecating Old RPC Methods (#1410)
* begin reorder

* move into beacon server

* add proposer server

* fix

* add proposer server

* wrap up rpc reorder

* eliminated deprecated RPC endpoints

* formatted nicely

* RPC protos

* fix lint

* integrate hash proto

* autoclean

* deprecate all old code

* include the rest of methods mocks

* bazel run

* lint fixes
2019-01-28 20:41:04 +01:00
Raul Jordan
b86388410d
Restructure RPC Server Into Individual Servers (#1393)
* begin reorder

* move into beacon server

* add proposer server

* fix

* add proposer server

* wrap up rpc reorder

* gazelle

* lint fix

* fix broken build
2019-01-28 16:40:40 +01:00
Raul Jordan
98a4274b81
Refactor ChainService for Synchronous Tests and ChainStart (#1347)
* can now test blockchain service synchronously

* completed chainstart listener

* fix comment

* completed refactor

* fix

* fix build

* rem genesis fetch

* fix broken

* fixed concurrency bug

* comments
2019-01-28 19:59:37 +08:00
Preston Van Loon
956721fe43 Simplified validator workflow 2 - updateAssignments (#1371)
* Add attestation p2p messages

* first pass refactor

* lint

* viz fix

* comment unused const for now

* Add opentracing spans

* PR feedback

* added updateAssignments implementation

* update proto

* handle error in runner

* only do updates on epoch start

* gazelle

* goimports
2019-01-25 11:26:03 +08:00
Ed Mazurek
10b237e72d db methods: remove Get prefix (#1351)
* db methods: remove Get prefix for getter functions

* db methods: consistent test names by removing Get
2019-01-21 17:34:11 +08:00
terence tsao
463cd58171
Implement Process Penalties and Exit Logic (#1291)
* implemented process pentalties and exit logic

* tests

* add MaxWithdrawalsPerEpoch to config

* preston's feedback, replaced index with idx

* s/e/penalizedEpoch

* removed blank line
2019-01-15 21:52:57 -08:00
Raul Jordan
d47db5e834
Advance Beacon State Transition Part 6: Simulate Validator Exits (#1302)
* deposit definition according to latest spec

* ssz decode input data tests

* fix todo

* ignore XXX fields in struct

* fix

* timestamp

* gazelle run processing

* process deposit complete

* all logic complete

* verify merkle branch

* gazelle

* process deposit func

* diff cov 1005

* add todo"

* all test cases written down

* most tests complete

* ttl timestamp fail

* 100% code coverage in deposits

* fix params

* encode deposit data helper func

* state transition with no slots failing with panic at calcnewblockhashes

* smaller deposits for chain start

* state advancement benches

* ran go tests

* bazel

* improve the thing

* lint

* works works works

* all conflicts fixed

* edit readme to specify tests format

* edit readme to specify tests format

* skip slots works yay

* gazelle

* edit readme to specify tests format

* wrapped up all randao simulation

* fix

* passing

* goimports

* move to slices pkg

* deadcode

* deposit yaml tests

* created deposit trie implementation in Go

* created deposit trie implementation in Go

* gazelle

* merkle branch generation

* merkle branch generation

* more merkle debugging

* fix deposit trie

* include new merkle trie functions

* update all deposit operations

* capitalize

* advancing deposits fully works, grows the validator set

* wrap up time formatting

* lint fix

* include all information in the README

* edit conf

* revert

* clean up before merge

* successfully e2e test proposer slashings

* casper advancement

* wrap up casper slashings

* gazelle

* fix conf

* fix comments

* advance validator exits complete

* wrap up readme
2019-01-15 01:02:49 +08:00
Preston Van Loon
592c5c3d92 Refactor hashing of beaconblock to shared (#1315)
* Add beacon block hash function

* Refactor/remove old hash method

* gazelle
2019-01-15 00:41:20 +08:00
terence tsao
e313e97666
Implement Validator Rotation Logic (#1279) 2019-01-13 12:52:31 -08:00
Preston Van Loon
b7b2e51450
Add reflection gRPC service to beacon-chain gRPC server (#1313)
* Add reflection gRPC service to beacon-chain gRPC server

* Move reflection to end of server bootstrap
2019-01-13 11:58:52 -05:00
Preston Van Loon
ddf454a04d Ignore empty public keys in gRPC request (#1309)
* Ignore empty public keys in gRPC request

* Remove log
2019-01-13 12:44:28 +08:00