Commit Graph

76 Commits

Author SHA1 Message Date
Ivan Martinez
700264b3c7 Add caching to beacon state DB (#1775)
* Initial addition to cache beacon state

* Add benchmark to tests

* Fix benchmarks

* Fix benchmarks

* Fix caching to requests

* Update to master

* Remove b.N assignments

* Init cache on state init
2019-03-12 15:30:10 -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
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
Nishant Das
6d69ac1abd
Add State Generator (#1718)
* add finalized function

* add functions

* gazelle

* add separate package for import cycles

* main tests are passing

* add finalized state test

* add block test

* fix tests and gazelle

* lint

* build file

* remove package

* remove unecessary method

* visibility

* remove package

* comments

* final comments

* imports spacing

* goimports
2019-03-07 11:02:47 +08:00
Ivan Martinez
5aa7320507 Clear Up Code Inconsistencies (#1836) 2019-03-03 09:31:29 -08:00
Nishant Das
b8785ba1d8 Eth1 Data Fix (#1785)
* adding fields to initalize state

* fix references

* change naming

* change to eth1data

* lint
2019-03-02 17:38:22 -06:00
shayzluf
62c6cd58e0 Batch db write in order to resolve test slowliness (#1732)
* first version of batching

* batching db writes to solve test slowliness

* remove debug msg

* variable problem

* remove exesive code
2019-02-28 13:14:52 +08:00
Preston Van Loon
a19cb1864e Tracing additions (#1747) 2019-02-27 19:55:47 -08:00
Preston Van Loon
28e360665d
Complain if contract address changes (#1724)
* complain if wrong contract address

* add comment
2019-02-26 13:40:17 -05: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
terence tsao
b6cc79fa2a
Save Validator Public Key -> Index in DB (#1690) 2019-02-25 09:37:02 -08: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
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
Raul Jordan
ab511cb022
Move Deposit Encoding to Helpers Package (#1644)
* move deposits

* finish moving deposit helpers
2019-02-19 12:05:34 -06:00
terence tsao
9f64ee7ecf
Remove Processed Block Operations from DB (#1626) 2019-02-18 15:34: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
terence tsao
c8a170dbad Retrieve Attestations from Operation Service (#1606)
* fixed epoch_processing

* test p2p

* attestation pool to retrieve attestations up to max config amount

* lint

* update comments

* lint
2019-02-15 13:27:45 -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
e052e457df
Remove Old References to Block Vote Cache (#1585)
* rem references to vote cache

* fix build
2019-02-14 08:54:29 -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
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
terence tsao
4cadd534db
Update Genesis Slot and Epoch (#1537) 2019-02-10 23:09:35 +01:00
terence tsao
c46a583acb
Update MaxDeposit Config Names (#1539) 2019-02-09 14:09:09 +01:00
Raul Jordan
7ae19ec370
Align Block Operations to Spec (#1512)
* 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

* address comms

* comment

* no more confusing is double vote function

* surround
2019-02-08 15:53:36 -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
58ca71af23 Insert pending deposits (#1495)
* Update config for deposits processing

* Add pending deposits database methods

* oops forgot the files

* move the lock after the nil check

* move the lock after the nil check

* test inclusion behavior

* Insert pending deposits on process deposit log
2019-02-05 11:25:09 -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
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
Preston Van Loon
721a3bfb6a Pending deposits db (#1475)
* Update config for deposits processing

* Add pending deposits database methods

* oops forgot the files

* move the lock after the nil check

* test inclusion behavior

* Update db.go

* Add debug logs if processing nil data

* missing return statement

* /before/until/
2019-02-04 21:47:17 +08:00
terence tsao
d1df055ab1
Aligning ETH2.0 spec - Removed Balances from Validator Proto (#1470) 2019-02-04 08:31:43 +01: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
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
terence tsao
665f3f885c
New Operation Service Part 1 - Sync and DB connection (#1437) 2019-01-30 20:48:50 +01:00
terence tsao
c0f36e467b
Eliminate Custody Logic for Phase 0 (#1408) 2019-01-30 11:11:13 +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
Raul Jordan
4d43f5128a Remove Simulator Service (#1392)
* remove all instances of simulator service

* fix flag decl

* fix lint
2019-01-27 12:51:44 -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
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
Nishant Das
bb7b0a324b
Fix Bug On Startup Using Genesis.json (#1258)
* fix bug

* making requested changes

* new changes

* changing initialize state

* remove genesis.json and references

* remove log

* readme

* readme

* remove reference
2019-01-09 11:03:57 +08:00
terence tsao
141a8dba87
Reformat Configs for Readability (#1256) 2019-01-05 20:36:05 -08:00
Raul Jordan
ccc2a4b91f
Process Validator Deposits (#1184) 2019-01-04 23:39:34 -06:00
Raul Jordan
7e1af4fceb
Remove Use of Proto .GetX for Value Getters (#1235) 2019-01-04 21:58:19 -06:00
terence tsao
1314077a4d
Code Clean Up Part 1 - Core Package (#1216) 2019-01-01 09:17:44 -08:00
Nishant Das
9db1002d87
Updating Genesis Block to Spec (#1172)
* Updating to spec

* addressing review comments
2018-12-25 14:47:07 +08:00
Raul Jordan
5d26efcfaa
Deprecate types.BeaconState with pb.BeaconState Generated Proto (#1164) 2018-12-23 16:51:04 -06:00
Preston Van Loon
10f45744d6
Use gogo protobuf as the protoc compiler (#1165)
* first commit, remote att types

* no more agg attestation proto

* regen mock

* only attestations

* proto

* att process

* fix att references

* more tests passing

* use att protos

* complete

* change visibility

* use gogoprotobu
2018-12-23 15:34:59 -05:00
Raul Jordan
1065617087 Replace Attestation Type Primitive With Proto Generated Type (#1149)
* first commit, remote att types

* no more agg attestation proto

* regen mock

* only attestations

* proto

* att process

* fix att references

* more tests passing

* use att protos

* complete

* Update dependency com_github_deckarep_golang_set to v1 (#1159)

* Update dependency com_github_edsrzf_mmap_go to v1 (#1160)

* Update dependency com_github_go_stack_stack to v1 (#1161)

* Update dependency com_github_rs_cors to v1 (#1162)

* Update dependency in_gopkg_urfave_cli_v1 to v1 (#1163)

* change visibility
2018-12-22 15:30:59 -05: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