Commit Graph

56 Commits

Author SHA1 Message Date
Yutaro Mori
278a81032f
Always pass an item through channel when processing blocks (#728) 2018-11-06 21:48:11 +01:00
terence tsao
8dc3fb5c85
Removed Demo Debug Flags (#680) 2018-11-05 18:35:50 +01:00
terence tsao
80d6c60769 fixed error strings (#708) 2018-10-31 23:05:55 +01:00
Yutaro Mori
7caedbaf27 Miscellaneous Fixes for Demo (#694)
* Various fixes to get code in line with demo

* more fixes
2018-10-23 11:07:43 -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
Raul Jordan
81ff9fd7e3
Implement GHOST Beacon Chain Fork Choice Rule (#643) 2018-10-17 23:23:18 -05:00
Yutaro Mori
c00a1d3132 Replace LevelDB with Bolt (#666) 2018-10-17 01:11:24 -05:00
terence tsao
b98d30cf18
Implement RANDAO From Spec (#651) 2018-10-15 17:02:00 -07:00
Nishant Das
5117e6d195 Refactor Crystallized State (#641) 2018-10-15 06:17:07 -07:00
Yutaro Mori
8bffae1316 Various cleanup and bugfixes around validator/RBC interaction (#657) 2018-10-14 10:29:57 -05:00
Yutaro Mori
d1eefa5cc7 Use consistent hash formatting (#650) 2018-10-12 08:35:49 -07:00
Yutaro Mori
724ae3c999 Implement Precise Ticker For Slot Interval (#635) 2018-10-10 11:17:48 -05:00
terence tsao
efeb6976d1
Align Block and State Field Names with Spec (#628) 2018-10-09 19:34:50 -07:00
Yutaro Mori
ce99bd7605 Refactor to Create DB Package (#582) 2018-10-05 13:14:50 -04:00
Preston Van Loon
763d0d6bdc
Add Go tools in bazel (#608)
* add atlassian bazel tools

* Add bazel entrypoints for native go stuff

* gazelle
2018-10-02 22:04:36 -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
terence tsao
d5bf733948 Fixed Simulator Can't get ParentSlot (#602) 2018-10-02 13:34:26 -05:00
Raul Jordan
1abed55bdd Update Beacon/Validator Flags to Disable Reward/Cross-Link Checking by Default (#597)
* flag updates

* enable att validity, cross links, rewards

* tests all pass

* fix race

* fix cov

* fix flag

* fix conf

* fix race

* fix gazelle
2018-10-02 10:04:37 +08:00
Preston Van Loon
6e2b6229fe
Revert "Fixed Sync With Simulator (#588)" (#600)
This reverts commit 085b45626e.
2018-10-01 20:54:45 -04:00
terence tsao
085b45626e Fixed Sync With Simulator (#588) 2018-10-01 14:14:10 -05:00
terence tsao
d65e2a4157
Implemented Dev Flag to Use Demo Config (#586) 2018-09-27 23:48:39 -07:00
terence tsao
bc7e07d5dd
Load Genesis State Config when Flag is Specified (#576) 2018-09-26 23:58:00 -07:00
Raul Jordan
e10baf7c80
Validator Assignment RPC Beacon Node Stream (#563) 2018-09-26 21:34:35 -05:00
Jie Hou
c37ad4b446 Initialize ActiveStateHash and CrystallizedStateHash for Genesis BeaconBlock (#518) 2018-09-26 08:34:23 -07:00
terence tsao
1aeb0e6b10 Part 1 of Attestation Service - [sync -> blockchain -> rpc] (#548)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* add coverage.sh back

* beginning sig aggregation routine

* fixed errors

* fixed existing tests

* merged master

* add attestation build.bazel

* private visibility

* tests for attestation service

* lint

* bazel gazelle

* add validator beacon file

* lint

* tests for sync service

* removed tmp.go

* bazel gazelle
2018-09-24 09:22:09 +08:00
terence tsao
1988dd0d5d
Change Default Validator Balance to Big Int (#559) 2018-09-22 13:15:39 -07:00
Raul Jordan
fa96e57ca2
Re-Add Block Validity Checks (#541) 2018-09-21 14:33:53 -05:00
Raul Jordan
190a976d3d
Validator Clients Use an Internal Clock to Determine Slot Responsibility (#467) 2018-09-21 09:32:20 -05:00
Raul Jordan
4bc2176898
Refactor Block Processing + UpdateHead to Use Slot Numbers (#474) 2018-09-18 09:06:28 -04:00
terence tsao
ae84cfcfa2
Implement Proposer Attestation Check for Block Validity (#508) 2018-09-15 07:51:17 -07:00
Jie Hou
be11f2f103 Check attestation slot number (#515) 2018-09-13 22:07:30 -07:00
terence tsao
593c1ec9fc Filled in ContainsBlock for Blockchain Service (#512)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* add coverage.sh back

* filled in contains block to not always return false

* fixed lint

* lint
2018-09-13 23:24:18 +08:00
terence tsao
a630abae59
Dynasty Transition During Block Processing (#498) 2018-09-11 20:17:20 -07:00
Yutaro Mori
f312c013fc beacon-chain: Refactor Beacon Chain To Simplify Block Processing (#473) 2018-09-11 07:09:41 +02:00
Ivan Martinez
d4e8de95d8 Change IndicesForSlots to ShardsAndCommitteesForSlots (#481)
* Change IndicesForSlots to ShardsAndCommitteesForSlots

* Capitalize function properly
2018-09-09 11:05:36 +08:00
terence tsao
b0f5ef0da0
Save Attestation and AttestationHashes to DB (#472) 2018-09-08 18:52:18 -07:00
terence tsao
fe3c647c45
Skip Block if Attestation is Bad (#455) 2018-09-04 16:18:55 -07: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
Yutaro Mori
f0abbf6f26
Refactor Validator Shuffling Logic (#444)
* Refactor and fix bugs for validator shuffling logic

* fix lint errors

* fixes

* address pr comments

* comments

* typo

* fix tests

* better readability

* gofmt
2018-08-30 22:55:52 -04:00
terence tsao
366e5168ba
Initialize New Cycle during Block Processing (#443) 2018-08-29 16:21:15 -07:00
terence tsao
f37a59d2f8
Part 5 of Aligning Beacon Chain with Latest 2.1 - Block Vote Cache (#436) 2018-08-28 17:55:56 -07:00
terence tsao
6389877154
Part 4 of Aligning Beacon Chain with Latest 2.1 - Bootstrapping Genesis (#430) 2018-08-25 11:59:46 -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
terence tsao
e1f727cbb2
Implement Beacon Node Validator and Observer Entry Points (#414) 2018-08-20 08:50:11 -07: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
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
cd90598a90
client: Update Attester to Use Beacon Node RPC, Replacing SMC Completely (#365) 2018-08-09 17:54:59 -05:00
Raul Jordan
cccd675a84
beacon: Initial Sync Network Simulator (#341) 2018-07-30 23:41:27 -05:00