Commit Graph

57 Commits

Author SHA1 Message Date
terence tsao
2c805b731d Update FFG Check Points During Block Processing (#1982)
* update FFG check points in service

* where do stategenerators go?

* commented out state_generator_test for now

* moved state generator back to appropiate location

* fixed block processing with state generator

* fmt

* import circle bad commit

* fix

* taking preston's fix

* gaz
2019-03-14 00:22:47 -04:00
Raul Jordan
5371218b9b
Refactor ChainService for Receiving Blocks Synchronously (#1984)
* refactor chain service

* restructure service and lint

* all calls to receive block in chain service are now blocking

* begin fixing tests

* refactored blockchain tests

* builds correctly

* blockchain tests pass again

* lint

* sync and rpc tests pass again

* done

* add in open tracing

* span in fork choice

* Update beacon-chain/blockchain/block_processing.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>
2019-03-13 17:17:32 -04:00
Ivan Martinez
84b7c3654b Rename forkutils -> forkutil (#1976) 2019-03-12 16:39:13 -07: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
terence tsao
936c4dde77
Implement AttestationTargets for ForkChoice (#1912) 2019-03-06 15:03:52 -06:00
terence tsao
dd40320a1c Save and Delete Validators Pubkey - Idx Post Chainstart (#1873)
* starting tests

* added tests

* fixed comments

* gaz

* make sure key is using EntryExitEffectEpoch
2019-03-05 15:22: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
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
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
9f64ee7ecf
Remove Processed Block Operations from DB (#1626) 2019-02-18 15:34:49 -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
59e5e59300
Update Fork Choice to Use Balance (#1564) 2019-02-13 23:13:00 +00:00
Preston Van Loon
b0b55e8d1d
Remove pending deposits after receiving a processed block (#1530)
* Remove pending deposits after receiving a processed block

* Abstract createDeposit

* fix test

* Rename helper for clarity

* MaxDepositAmount
2019-02-09 09:07:30 -05:00
terence tsao
21ac564631
Aligning ETH2.0 spec - Make Epoch First Citizen (Package: Validators) (#1460) 2019-02-04 21:34:33 +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
f89fce9bd7
Implement Basic LMD Ghost Fork Choice Skeleton + Helper Funcs (#1310)
* add fork choice helpers

* LMD GHOST basic implementation

* add todos

* add in the initial test and finalize rest of functions

* added tests

* more simulation, adding trivial case with only one option for a head

* panics

* begin helper function tests

* more helper tests

* higher vote wins

* LMD Ghost full test

* comment

* add types

* optimize

* prepared

* deposits for chain

* lint

* use the hash beacon block util

* rem unnecessary db methods

* comments

* setup works
2019-01-19 10:57:51 +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
Andrei Ivasko
b29188128d ToBytes32 (#1306) 2019-01-13 09:04:14 -05:00
Raul Jordan
5d26efcfaa
Deprecate types.BeaconState with pb.BeaconState Generated Proto (#1164) 2018-12-23 16:51:04 -06:00
Raul Jordan
e49a190754
Replace Types of Block Primitives With Proto Generated Types (#1137)
* refactor repo to use protos

* removed block successfully in types

* db package updated

* db, core passing

* chain service done

* no more block instances

* all pass

* deprecate all block protos

* tests pass
2018-12-20 17:00:38 -05:00
Raul Jordan
6125c304ba
Remove Deprecated Spec Logic (#1138)
* no more deprecated stuff

* remove incentive functions

* rem deprecated

* remove funcs
2018-12-19 20:45:21 -05:00
Nishant Das
e92032346f Partial Implementation of the Slot Processing Routine (#1083) 2018-12-19 00:18:42 -05:00
Raul Jordan
a99de08562
Merge Active/Cystallized State (#1019) 2018-12-01 16:09:12 -06:00
terence tsao
391eacd1d7
Refactor Casper Validators Into Core/Validators Stateless Package (#875) 2018-11-20 22:44:04 -08:00
Raul Jordan
f6c1864d6d
Cleanup of Miscellaneous Items Around the Repo (#790) 2018-11-16 12:01:41 -05:00
Jie Hou
0de655eaab Move BlockVoteCache out of ActiveState (#739) 2018-11-11 08:54:17 -08:00
Raul Jordan
6476fb54af
Dynamic Chain Test Language Package With YAML Parser (#681) 2018-11-07 14:07:41 -05:00
Yutaro Mori
4c5099c8ba Miscellaneous Cleanup Around Block Processing Logic (#684)
* Cleanup code around block processing

* gazelle

* gofmt
2018-10-22 16:04:17 -05:00
Yutaro Mori
c00a1d3132 Replace LevelDB with Bolt (#666) 2018-10-17 01:11:24 -05:00
Yutaro Mori
8bffae1316 Various cleanup and bugfixes around validator/RBC interaction (#657) 2018-10-14 10:29:57 -05:00
Yutaro Mori
724ae3c999 Implement Precise Ticker For Slot Interval (#635) 2018-10-10 11:17:48 -05:00
Yutaro Mori
3e8a450e0f Fix Flaky Tests (#636) 2018-10-09 10:52:20 -05:00
Yutaro Mori
ce99bd7605 Refactor to Create DB Package (#582) 2018-10-05 13:14:50 -04:00
Preston Van Loon
8bcddf5fdc
Migrate dependencies on @com_github_ethereum_go_ethereum//event (#601)
* Add go-ethereum's event and

* remove swp file

* goimports

* remove unused code

* fix gazelle
2018-10-02 21:49:01 -04:00
Raul Jordan
e10baf7c80
Validator Assignment RPC Beacon Node Stream (#563) 2018-09-26 21:34:35 -05:00
Raul Jordan
4bc2176898
Refactor Block Processing + UpdateHead to Use Slot Numbers (#474) 2018-09-18 09:06:28 -04:00
Yutaro Mori
f312c013fc beacon-chain: Refactor Beacon Chain To Simplify Block Processing (#473) 2018-09-11 07:09:41 +02:00
Nishant Das
4891f68929
Persist Blocks and State in DB (#440)
* Persist Dag

* Add schema

* Add new message

* add mapping

* Adding check to save block

* Removing blocks mapping

* Make changes to block processing

* Change from mapping to a slice of hashes

* Adding tests to core

* adding more tests

* Fixing service test

* Add comments and fix bazel

* fix lint

* fix conflicts

* addressing review comments

* Removing references to active

* fixing tests with active state

* Protytype for #440: Persist blocks and latest state in DB

* simplify code

* removing block registry

* fix test

* adding block removal/iterator

* Addressing review comments

* Addressing comments

* removing extra line

* making vars private and adding canonical key

* fix lint

* splitting methods

* adding more changes

* lint

* improving coverage

* removing decodeslotnumber

* gazelle

* remove todos

* addressing preston's comments

* remove slotnumber

* lint
2018-09-03 00:44:03 +08:00
terence tsao
366e5168ba
Initialize New Cycle during Block Processing (#443) 2018-08-29 16:21:15 -07:00
terence tsao
1598ae8605
Part 3 of Aligning Beacon Chain with Latest 2.1 - Processing Attestations (#423) 2018-08-24 09:07:23 -07:00
Raul Jordan
4a1b5db07b
beacon: Store Incoming Blocks and Calculated States in DAG (#422)
* begin with a block/state dag approach in prep for fork choice

* add TODOs for fork choice items, add data structure for forks

* remove syncing and processing states for incoming block sync

* simulator only broadcasts blocks now, no more state simulation

* fix sim tests, no more state sim

* bazel rerun

* naive fork choice

* split update head routine

* pesky race conditions

* fork choice rule works

* dag + fork choice working

* canonical head storage across sessions

* todo: save dag

* no more stalling after 10 blocks, using event feeds

* address review

* sync instead uses event feed

* refactored pure funcs into casper package

* tests pass

* fix lint

* refactor get blockhash

* refactor blockhashforslot

* event feed for incoming blocks in chainservice

* use config

* addressed all comments

* fix typo

* address yutaro comment

* using db interface

* check if parent hash in previous slot DAG

* works

* tests

* drop ffg suffix

* bazel gazelle

* full cov validators by height shard

* gazelle

* state tests

* all state tests

* 100% cov types and 99% cover casper

* cov up

* 80% blockchain cov

* fix lint
2018-08-23 22:09:59 -06:00
Raul Jordan
d3b5a7c67b
beacon: Implement Beacon Node gRPC Server Streams (#400)
* remove client helper in internal

* tidying up the sharding client project

* update all docs

* implementing beacon rpc server methods

* address prs

* begin coverage

* regen proto

* include announcement chans

* tests pass, announcing as canonical only after block has passed all processing

* system functioning yay

* tests pass

* bootstrap validators

* default balance params

* fix lint

* fix all tests

* increasing cov

* 100% test cov rpc

* build file for internal

* typo

* graceful stop

* merge with Terence's PR

* address review comments

* fixed blockchain tests and lint

* added ethdb

* persists last simulated session

* cov

* ready

* fix lint

* fix cov tests

* fix lint

* config options for args

* fix lint

* lint fix
2018-08-17 21:34:56 -06:00
terence tsao
b7bf48bc3e Fixed NewSimulatedBackend (#405)
* sync functions for active and crystallized states

* make pb structure more semantic

* use run func to consolidate to one main routine

* remove mainchain package

* remove smc. yay!

* fixed NewSimulatedBackend

* added smc tests back

* race = off

* used latest commit from bazel-go-ethereum

* changed testoutput to all

* output test.log after failure

* disable race

* restore travis config to original state, add race=off to blockchain workspace

* added issue number and fixed typo
2018-08-16 15:37:53 -06:00
terence tsao
06ca8e758f beacon: Improve Test Coverage for Beacon Chain Package (#402) 2018-08-14 22:49:59 -06:00
Ivan Martinez
4976461e62 Implement GenesisBlock() to Grab the Block from Memory DB (#373)
* Fix odd placement of import

* Puts all of NewGenesisBlock() into GenesisBlock() 

Also removes the unneeded TODO

* Add error check for db retrieval

* Add missing bazel imports

* Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian

* Fix GenesisBlock() to grab the block from memory db

* Fix according to requested changes

Fix GenesisBlock() to grab the block from memory db
Fix odd placement of import


Properly add ParentHash to Block


Remove no longer needed if statement condition


Puts all of NewGenesisBlock() into GenesisBlock() 

Also removes the unneeded TODO
Add error check for db retrieval


Add case for if the beaconChain is missing a genesisBlock


Add missing bazel imports


Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian


Remove duplicate code


Change genesis block timestamp to unix 0


Adds info log when a genesis block isn't found

* Provide fakeClock to pass tests with a mocked genesisBlock

* Fix unexpected log in test from addition of genesis block

* Add tests for clock
2018-08-12 22:07:37 -04:00
Raul Jordan
13a011ce5f
proto: Structure Protos for Beacon and for Sharding (#359) 2018-07-31 13:54:45 -05:00
terence tsao
9b1966374a
Part 2 of State Sync - Active State Proto Struct (#355) 2018-07-30 18:13:25 -07:00
terence tsao
33c56092ad beacon: Part 1 of State Sync - Crystallized State Proto Struct (#354) 2018-07-30 19:29:40 -05:00
Yutaro Mori
9c9aef8194
Eliminate test only methods on types.Block (#350) 2018-07-31 00:45:44 +09:00
Yutaro Mori
f9d23da2dd Decouple Database From the ServiceRegistry (#335) 2018-07-29 23:14:50 -07:00