Commit Graph

211 Commits

Author SHA1 Message Date
Preston Van Loon
e5cb1db5bc Sort list before processing batched blocks (#2531) 2019-05-08 12:27:00 +08:00
Raul Jordan
76881fd1ae
Do Not Subscribe to Blocks in Initial Sync (#2524)
* only sub to block batches

* batch sub remove

* tests

* fix lint

* gazelle

* delete old im mem blocks code
2019-05-07 21:12:36 -05:00
Raul Jordan
4954ed0221
Use Single Code Path for Receiving Blocks and Fork Choice (#2514)
* insert canonical

* one path

* single entry

* travis

* lint
2019-05-06 15:06:41 -05:00
terence tsao
a818564b8d
Canonical Blocks for Batch Block Request (#2511)
* only reply canonical block for reg sync

* CanonicalBlock test

* lint
2019-05-06 11:02:04 -07:00
Nishant Das
2442b1a4d6
fix chainstart waiting on rpc server (#2488) 2019-05-04 20:04:12 +08:00
Nishant Das
16b42f4ac6
change logging (#2487) 2019-05-04 12:11:34 +08:00
Raul Jordan
939382ac86 Better Error Message if Failing to Exit Initial Sync (#2483)
* no err throw

* nil errors

* better error on init sync
2019-05-04 10:13:33 +08:00
Raul Jordan
629b76cf44 Only Perform Initial Sync With a Single Peer (#2471)
* fix spacing

* use send instead of broadcast in initial sync
2019-05-02 15:36:23 -04:00
terence tsao
b1334c6120 Revert "Reverts RPC Disabling (#2435)" (#2468)
This reverts commit e16f1e1533.
2019-05-02 09:17:45 -04:00
Raul Jordan
05336e16e0
Querier Polls Forever Until 1st Response (#2458)
* revert changes to protos

* typo
2019-05-01 12:10:39 -05:00
terence tsao
de6ea81790 Recent Block Roots RPC API (#2455)
* add metrics for corret participation rate

* gaz

* add recent canonical roots API

* gaz

* all tests passed

* comments

* fmt
2019-05-01 10:14:46 -05:00
Raul Jordan
aa74b1dca3 Various Logging Improvements (#2454) 2019-04-30 14:55:59 -07:00
terence tsao
d453b0f199 fixed typos (#2444) 2019-04-30 14:55:14 -05:00
terence tsao
63998b92aa Add and Use Truncate Hash Library (#2417)
* add truncate lib

* use trunc

* spaces
2019-04-29 13:11:51 -05:00
Nishant Das
e16f1e1533 Reverts RPC Disabling (#2435)
* make changes

* more changes
2019-04-29 08:23:24 -05:00
Nishant Das
52250c9e7a Fix Fork Choice Reorg Conditions (#2413)
* make fixes

* change condition

* comment

* fixed up a few var names for clarity

* added test for isDescendant

* chain split reorg test

* interface for atts service

* comprehensive reorg regression test added

* space

* all tests pass

* target handler

* ci lint

* Update beacon-chain/sync/receive_block.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>
2019-04-28 17:53:51 -04:00
Nishant Das
cd302e88c2 Fix Block Processing And UpdateChainHead (#2399)
* fix block processing

* add in defer

* do not update chainhead

* save historical states from all blocks, so that fork choice can retrieve it

* revert changes

* make new changes

* remove forkchoice at the end
2019-04-27 14:36:53 -05:00
terence tsao
7a04af7621 Use Withfields for Forked Block (#2394)
* use with fields for forked block

* spacing
2019-04-27 12:08:15 +08:00
Raul Jordan
81c8b130c6
Only Sync With the Peer With the Highest Observed Slot (#2280)
* only accept the highest finalized slot from peers

* use best peer for state requests

* peer id

* rem old tests

* req peers tests pass

* warn level support for peer not having the same protocol

* pretty

* best peer

* comments

* req peers done

* tests passing

* fully functional

* enforce receiving from the best peer

* comments

* lint fixes
2019-04-26 10:18:43 -05:00
frederickalcantara
a170c69653 upgrading linter from gometalinter to golangci-lint (#2100)
* upgrading linter from gometalinter to golangci-lint

* fixed golangci-lint linting

* removed linting before_script command

* removed disable-all command

* Fixed golang config file

* fixed golang config file v2

* removed gosec issue rule

* formatting

* fixed travis build to run golangci-lint

* Add install golangci-lint command

* fixing golangci-lint script

* removed https://

* Added golangci-lint cmd script

* added go get for local lint install

* created a before_script

* add install before script

* Added get script

* added go mod download

* removed go mod downloads

* changed

* removed before script

* Added before script go get lint

* added exit zero to see what went wrong

* removed golang run script

* removed before script

* change lint command

* verbose output

* removed verbose

* change linter enable and disable configuration

* Update .golangci.yml

Removed gotype as a linter

* Update .golangci.yml

Added typecheck linter

* Update .golangci.yml

Added fixed lint version

* Update .golangci.yml

Added gotype

* Update .golangci.yml

Added typecheck

* removed env:lint

* Added env lint

* fixing lint upgrade

* Changing travis configuration

* FIxed spelling errors

* disabled typecheck

* Enabled typecheck

* remove binary

* Deleting lib binary

* adding more linters

* fixed constants

* fix spelling

* fixed all lint issues

* Revert "Changing travis configuration"

This reverts commit 334afe9d05e96261b01f275aa3ada20e7f36aac4.

* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into update-linter

* Changed from Infof to Info

* Fixing commits

* fixing commits with linter config

* added install

* Fixing

* fix log statement
2019-04-26 14:24:01 +08:00
Nishant Das
09083b072c
add log (#2390) 2019-04-26 13:15:53 +08:00
Nishant Das
89600e8978
Remove Duplicated Functions in the Slice Package (#2389)
* remove duplicated funcs

* lint

* remove duplicated tests
2019-04-26 12:31:27 +08:00
Raul Jordan
5bf1032b7d
Prevent Reading Head State on Every Received Attestation (#2383)
* no more calls

* fix lint unused

* Update beacon-chain/attestation/service.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* fix tests

* fixed broken tests

* using ctx

* fixed single state req

* tests pass

* fix one of last major bottlenecks

* fix test

* lint
2019-04-25 12:21:45 -05:00
terence tsao
b81eeec374 Optimize block fetch with attestation target fetch (#2373)
* 1st attemp to optimize blk fetch w/ att tgt fetch

* test test test test
2019-04-24 12:21:00 -05:00
shayzluf
6c1740eefc Add Caching to Tree Hashing Algorithm (#1929)
* added todo to hash file in ssz

* params and copy of block cache

* start hash cache

* Hash cache implementation

* fixed some comments

* fixed promatheus duplicate counter name

* removed TODO

* change to use special expiration cache

* function name fixes junk object generator

* naming changes

* gazzle fix

* added pruning last read data test

* fixed gometallinter errors

* fix benchmarks and no int64 not serializable

* move struct from test

* add feature flag

* fix merge issues

* add featureflag to beacon and validator

* featureflag init for tests

* added feature flag to all ssz dependent tests

* remove setter func

* replace k8s tweaked expiration cache to https://github.com/karlseguin/ccache

* remove else

* change request by preston

* added init featureflags to genesis_test

* Update shared/ssz/hash_cache.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

remove extra space

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/params/config.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* remove powchain from prometheus hash cache name

* fixes fron change requests

* fix change requests

* remove faulty merge test

* gazelle fix

* fix fmt.sprintf

* remove debug binary

* fix gazelle
2019-04-24 13:39:02 +08:00
Nishant Das
4ed86566c1 Disable RPC while Syncing (#2353)
* handle nil block

* blocking rpc till synced

* remove unused field

* remove log

* fix tests
2019-04-23 10:57:10 -05:00
Nishant Das
a5def315ae Separate Registry and Balances (#2334)
* all changes

* lint

* terence's review
2019-04-22 10:52:56 -05:00
Raul Jordan
1df15f72c4
Ensure Block Processing Failures Return an Error (#2325)
* ensure block failed processing returns an error

* fixed test

* test assertion corrected

* comments

* fix tests

* imports
2019-04-21 17:38:14 -05:00
Raul Jordan
0ff335f254
Fix Pending Attestations RPC Call (#2304)
* pending atts

* use proposal slot

* attestation inclusion fix

* lint

* advance state transitions

* gazelle

* lint tests pass
2019-04-21 16:12:03 -05:00
Nishant Das
0499da2b95 Only Update Head of Chain with Child Blocks (#2310)
* change block child loop

* remove redundant hashing

* wrap in conditional

* gazelle

* fix test
2019-04-20 10:17:08 -05:00
Nishant Das
1f4890adde
clean up test (#2309) 2019-04-20 19:24:40 +08:00
terence tsao
1602c5d0c5
Use Withfields for Logging (#2305)
* use with fields

* gaz
2019-04-19 21:09:01 -07:00
Raul Jordan
63549e9db9
Blacklist Bad Block Hashes (#2297)
* prevent blacklisted block hashes

* comments

* test passing blacklisted blocks

* bad blocks prom counter

* Update beacon-chain/sync/receive_block.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* Update beacon-chain/db/block.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* fix test
2019-04-18 16:57:19 -05:00
Nishant Das
4e7eb21594 Fix Validator Store (#2277)
* add fix and tests

* fix lint

* lint
2019-04-17 13:57:13 -05:00
terence tsao
a9da23f444 Proposer Server Filters Attestation by Canonical (#2271)
* filter attestations by canonical

* fix test

* added mutex

* fixed rpc tests

* forgot to init map, all existing tests passing

* added test for filter non-canonical atts

* lint
2019-04-16 13:19:31 -05:00
Raul Jordan
3e525ebe8b
Block Deletion Upon Block State Transition Error (#2270)
* block deletion upon block state transition error

* include tests

* tests complete

* comment

* imports spacing
2019-04-16 13:06:53 -05:00
Ivan Martinez
62279489a3 Add deposit index to beacon state (#2232)
* Begin adding Deposit Index to beacon state

* Move deposit index increment to ProcessDeposit

* Fix initial deposits bug

* Fix bug in RPC

* More bug fixes

* Fix RPC bug, ensure deposits are processed in the right order

* Fix tests

* Fix merge

* Attempt to fix pruning deposits on regular sync

* Fix pending deposits on node restart

* Fix test

* Fix tests properly

* Gofmt

* Remove unneeded logs

* Fix build
2019-04-14 18:17:39 +10:00
Raul Jordan
19a5e35be9 Apply Fork Choice at End of Ancestor Block Fetching (#2244)
* recursively process blocks and apply fork choice at end

* no duplicate calls

* add back spans

* Update beacon-chain/sync/receive_block.go
2019-04-14 08:23:59 +10:00
Nishant Das
cb0c08c285 Add Lock to Block Processing in Sync (#2239)
* add lock

* remove context

* add announcements lock

* fix test

* fix transition

* change ordering of return args
2019-04-12 10:11:15 -05:00
Nishant Das
98042c613d
Update State to Include Current and Previous Justified Roots (#2186)
* update protos

* Revert "Use DB to Fetch Justified Block (#2172)"

This reverts commit 60c254d818.

* use justified root and previous justified root across the repo

* change attester server to use state justified root

* remove commented code

* fix build issues

* fix test

* fix all tests

* fix merge issues
2019-04-10 14:52:06 +08:00
terence tsao
83e5492e55 Save State during Init Genesis State (#2193)
* added spans and save state during init state

* fix other svcs

* tests

* Delete saving hist state
2019-04-09 15:06:23 -04:00
Nishant Das
90fed79610 Fix Initial Sync in Restarts (#2197)
* set chainstart value

* revert change in IsSynced and add regression test

* change status

* make a better status query

* allow status check to work on restarts

* spacing
2019-04-09 14:18:23 -04:00
Preston Van Loon
97b184e5c7
Historical pruning by flag only (#2210)
* add flag

* use flag

* fixes
2019-04-07 22:46:55 -04:00
Raul Jordan
3704126533
Improve Beacon Node Logging (#2175)
* improve beacon node logging

* better info logging

* much nicer balance logging

* lint

* tests
2019-04-05 22:37:46 -05:00
Preston Van Loon
c925632cc9
Add a span to block-by-slot (#2184)
* Add a span to block-by-slot

* /goroutinez
2019-04-05 19:19:27 -05:00
Raul Jordan
0d2d7a558f If At Genesis or !ChainStarted, Return Healthy Sync Status (#2183)
* genesis or not chainstarted

* is synced

* lint

* tests pass
2019-04-05 16:40:53 -05:00
Raul Jordan
de0f4ad278
Correct Sync Status for Healthz (#2182)
* is synced status

* is synced

* Update beacon-chain/sync/service.go
2019-04-05 16:06:04 -05:00
Raul Jordan
60c254d818
Use DB to Fetch Justified Block (#2172)
* builds

* db tests in core

* spacing

* Gazelle

* fix lint

* iterative block root loop

* Update beacon-chain/core/blocks/block_operations_test.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* imports
2019-04-05 14:48:49 -05:00
terence tsao
a19f08f7b6 Attestation Using Head State instead of Latest State (#2156)
* headRoot is a better name

* yay merged with master

* fixed attester server returning incorrect attestation field values

* revert stupid mock changes

* fixed and updated all the tests

* uncomment

* head start should handle skip blocks

* Raul's feedback
2019-04-05 09:41:49 -05:00
Preston Van Loon
83130358a9
Rollback state to handle side chain with skip blocks (#2147)
* Add initial test

* chkpt

* add failing test

* add span to historical state lookup

* use db.HighestBlockSlot()

* fix comment

* update comment

* i wrote a test like a good programmer.

* add test back

* add assertion and unskip test, something new failing tho

* trying to fix test

* remove -1, not sure if i need it yet

* Revert "remove -1, not sure if i need it yet"

This reverts commit 2cfcbb8108b28bb3d7135a993d9053150d5f1e6e.

* save historical state on every save state

* fix hsitorical states

* set historical state in initialize state

* change to a bool

* fix error with empty retrieval of states

* Add missing import

* fix test

* lock in receive block

* remove state generator

* Revert "lock in receive block"

This reverts commit 151b10829d70b2dad3055a8db36d0e1269a853f2.

* Fix Initial Sync Not Processing Canonical Block to Produce Canonical State (#2152)

* fix init sync

* fatal if highest observed root does not match

* proto fields

* Update beacon-chain/sync/initial-sync/service.go

* confirm canonical state root

* fix most tests

* failing test

* fix PR tests

* lint

* no simbackend changes

* logf revert

* add todo

* fix off by one

* fix test with deleted property

* merge #2157

* passing tests :)
2019-04-04 22:39:51 -05:00