Commit Graph

253 Commits

Author SHA1 Message Date
Nishant Das
00ca1d7991 Fix Errors with Attestation to Current Chainhead (#1990)
* fix errors

* fix bit check to little endian

* fix all tests
2019-03-14 12:29:44 -04:00
Raul Jordan
ef8232ae2e
Do Not Propose if Assigned to Genesis Slot (#1989)
* do not propose if assigned to genesis

* fix bitset

* revert bitset

* regress test

* rem commented blocks
2019-03-14 10:13:57 -04:00
Ivan Martinez
84b7c3654b Rename forkutils -> forkutil (#1976) 2019-03-12 16:39:13 -07:00
terence tsao
bb46784735 Fix Attestation Aggregation Bitfield (#1975)
* fixed setting aggregation bitfield

* fix tests

* space

* travis
2019-03-12 16:05:08 -04:00
Preston Van Loon
a7a22856f2
Do not propose a block when compute state root fails (#1972) 2019-03-12 12:49:09 -04:00
Raul Jordan
c1a9937760
Post ChainStart Validator Activation (#1934)
* implemented all the merkle func signatures

* branch indices complete

* check for index out of range in generating merkle proof

* completed full tests for sparse merkle trie impl

* lint

* formatting

* gazelle

* commentary

* ivan comments

* fmt

* get rid of the deposit trie

* recalculate trie when eth1 data changes

* default data response recalculates tree

* update merkle trie to use raw bytes

* use the new verify merkle root func

* builds

* if default data response historical deposits are empty, return the deposit root at the contract at the time

* work on trie

* trying again with more logging

* keep track of merkle trie indices, use correct big int ops

* use uint for merkle idx

* add todo

* update ticker correctly

* fix config and remove unnecessary logs

* readd plus one fix

* clarify some details

* weird imports spacing

* gazelle, lint

* fix tests using the new deposit trie

* builds but tests still fail

* rpc tests

* lint

* tests pass

* bazel lint

* rem commented block

* revert att slot fix

* preston comments

* comments

* fix build

* address last comment

* use counter

* imports
2019-03-12 00:05:55 -04:00
Preston Van Loon
e4588d9be0
Revert "Create and Verify Signatures for Attestations (#1908)" (#1958)
This reverts commit 23072983ff.
2019-03-10 20:02:47 -04:00
Nishant Das
028506e7ed Handle Panics in Remaining Services (#1926)
* add recovery for initial sync

* add recovery for rpc

* adding to other services

* remaining services and tests

* fix test

* remove changes to rpc

* handle powchain

* handle in powchain

* abstract to shared package

* gazelle

* lint

* remove for operations

* add in more for operations

* travis

* fix lint
2019-03-10 17:53:28 -05:00
Preston Van Loon
16be050f4b fix validaotr pending attestations call (#1941) 2019-03-09 08:29:47 +08:00
Ivan Martinez
23072983ff Create and Verify Signatures for Attestations (#1908)
* Verify signatures of attestations

* Implement BLS Signing for attestations

* Remove custody bit 0 from the attestation for now

* Fixes tests for attestations

* Fix tests to ensure they use proper attester indice

* Run gazelle

* Goimports

* Test attestation sigs in block operations

* Change formatting and make sure signatures are actually verified

* Fix duplicate import

* Fix duplicate import from merge

* Organize attestation sig to be conssitent with codebase

* Update to comments

* Change signatures to use aggregation

* Run gazelle

* Change function to return err instead of bool
Also gofmt

* Fix for comments

* Move createAggregationSignature to a function in attestations.go
2019-03-08 15:30:01 +08:00
Preston Van Loon
90225aac31 PendingAttestations: allow for request to specify a slot (#1922)
* PendingAttestations: allow for request to specify a slot

* enhance the test
2019-03-07 09:56:22 -06:00
Preston Van Loon
34f0241f32
Fix wait for activation (#1913)
* fix but no test

* ensure a canonical state is sent
2019-03-06 15:13:09 -05:00
Raul Jordan
44edbd4fbc
Validator Client WaitForActivation Implementation (#1898)
* create wait for activation stream

* wait for activation server stream open

* complete server side logic

* formatting

* first test passing

* context closed test

* lint

* fix build failure

* imports

* implemented wait for activation on client side

* all tests pass for validator client

* weird spacing
2019-03-05 18:09:41 -06:00
terence tsao
17682321fe
Clean Up Validator RPC Server (#1798) 2019-03-03 14:55:12 -08:00
Ivan Martinez
5aa7320507 Clear Up Code Inconsistencies (#1836) 2019-03-03 09:31:29 -08:00
Nishant Das
9de86c0d3a make less aggressive log (#1786) 2019-03-02 08:58:58 -05:00
Nishant Das
615daa98e9
Add Error Log for Attester (#1759)
* add log

* add test
2019-03-02 09:57:02 +08:00
Raul Jordan
88765b6d3c
Fix Attestation Info at Slot to Match Justified Epoch Expectations (#1768)
* fix crosslinkt committees

* fix lint

* fix in epoch

* imports

* add gx tags

* epoch shuffling tests

* regress test

* preston comments

* service change

* advance to handle skip slots

* ready

* imports

* rem unnecessary log

* revert config

* last comment

* imports
2019-03-01 18:33:55 -06:00
Preston Van Loon
a19cb1864e Tracing additions (#1747) 2019-02-27 19:55:47 -08:00
terence tsao
9f950211d8
Rename Shard Block Root to Crosslink Data Root (#1743) 2019-02-27 15:07:39 -08:00
Ivan Martinez
136950e0c5 Update some of client to v0.3 spec (#1733)
* Update validator to v0.3 spec

* Fix typos with rename
2019-02-27 12:21:15 -08:00
Raul Jordan
20803b4c9d
Revert Usage of ssz.TreeHash Across Repo (#1711)
* revert using ssz.TreeHash

* gazelle
2019-02-25 21:42:31 -06:00
Raul Jordan
e19920aec1
Miscellaneous Runtime Fixes & Improvements - Raul (#1674)
* fatal if impossible to receive chainstart

* fix tests

* fix

* custom delay

* completed custom delay

* errors

* better logs, nothing at genesis

* use demo in val

* add gazelle

* log

* starting to log stuff

* pass in ops

* avoid printing the large #s for debug, still working on tests..

* all around better logging

* fixed build error in epoch process

* fixed state transiton tests

* fixed block tests

* lint

* verify sigs in randao

* ready for inclusion falg

* only print waiting when slot is not valid

* fix build

* mod config

* fixed last justified slot issue

* fix inclusion

* fixed attestation issue

* using zero hash from params instead

* fix tests

* update balance

* removed swp

* more `- genesis_slot` for logs

* rem unused log

* fix broken tests

* account for skip slots in state root computation

* fixes done

* validator guide bug fixes - 671

* epoch boundary at the last slot of the epoch

* fix epoch issue

* more balance cal logs for debugging

* greater balance

* attestaton fixes

* fixes

* addressed testrun

* fixed ejection balance

* fix tests with far future epoch

* revert sync change

* revert initial sync change

* fix changes

* off by one att fix

* revert the att fix

* address comments

* format

* fix build

* rem file
2019-02-24 20:09:45 -06:00
Nishant Das
f5c88e1bcb
Test Syncing with Another Fully Synced Service (#1594)
* clean up test

* adding test setup

* add chainstart check to sync querier

* goimports

* goimports

* backend cleanup

* adding getters

* lint

* moving to db

* gazelle

* adding more services setup

* adding more changes

* adding different test setups

* other merge issues

* imports

* fixing keys

* get intial sync able to be set up

* new changes and gazelle

* use simulated p2p

* everything finally works

* unexport fields

* revert changes from merge

* remove mock server

* add documentation

* gazelle

* add another node

* review comments

* fix tests
2019-02-23 11:36:20 +05:30
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -08:00
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
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
c5c7d40398
Create Wrapper Around Pure Go BLS Project in Prysm (#1625)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* slice

* len

* cap err string

* tests

* imports

* gazelle
2019-02-19 09:09:50 -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
Ivan Martinez
650372915f Hotfix/add both role case (#1627) 2019-02-18 14:51:49 -08: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
Preston Van Loon
8d67337564
Revert go-bls (#1607)
* revert bc2afa04c6

* Fix workspace

* remove serialize reference

* Remove static
2019-02-15 13:31:07 -05:00
Ivan Martinez
78c205758f Wait Until Halfway Through Slot Duration to AttestHead (#1532)
* Write initial sleep function

* Add fake delay to testing

* Attempt to fix tests

* Fix tests

* Remove stray delay = 0

* Attempt at test

* Changes to tests, removed unneeded code

* Fix delay

* Get further in test

* Fix gomock being stupid

* Fix merge issues

* Fix tests

* Fix tests (!!!)

* Fix goimports

* Fix merge issues
2019-02-15 10:58:06 -06:00
Raul Jordan
37fa839d98
Eliminate Repeated Expensive Operation in Client Tests (#1597)
* no more repeated get key

* no more calls to triple new key

* goimports
2019-02-14 14:51:40 -06: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
Raul Jordan
281e5d1cfd
Provide Real Keystore to Validator Service for Public/Private Key Access at Runtime (#1570)
* provide validator with real keystore public key

* fmt

* build errors buildkite

* readd imports removed by goimport

* gazelle

* address broken tests

* make reference to filename a param

* fmt

* imports

* gazelle

* os remove all

* Use better Temp storage for tests

* testmain approach to avoid repeating expensive operation for each test

* travis lint

* fix test

* nokeystore in status test

* passing

* fix goimports
2019-02-13 17:49:06 -06:00
Raul Jordan
b1f1dff8e5
Fetch Initial Assignments at Genesis Slot Post ChainStart (#1574)
* fix test for initial assign

* fmt
2019-02-13 12:27:44 -06:00
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
e321fdfafa Update to Use Crosslink in AttestationData (#1546)
* fixed epoch_processing

* test p2p

* attestation uses crosslink instead of crosslink root hash

* lint
2019-02-10 11:59:17 -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
Preston Van Loon
4b27b8408b
Fix travis (#1493)
* fix travis

* test 2

* goimports

* Remove unused p2p config

* remove unused var
2019-02-05 10:46:32 -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
Raul Jordan
67ae7a3a98
Validator Secret Initialization (#1436)
* begin validator initialization

* utilize keystore

* cli create

* add items

* validator accounts package

* completed tests

* linter

* fix broken build
2019-01-31 12:57:57 +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
ec9240106e
Implement WaitForChainStart RPC Server and Client (#1421) 2019-01-30 13:28:53 +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
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
Preston Van Loon
0becb6dc01 Simplified validator workflow - first pass (#1362)
* Add attestation p2p messages

* first pass refactor

* lint

* viz fix

* comment unused const for now

* Add opentracing spans

* PR feedback
2019-01-23 10:52:39 +08:00