Commit Graph

82 Commits

Author SHA1 Message Date
Preston Van Loon
991ee7e81b "Super sync" and naive p2p reputation (#2550)
* checkpoint on super sync with reputation

* ensure handling only expected peers msg

* exclusive of finalized block

* skip block saved already

* clean up struct

* remove 2 more fields

* _

* everything builds, but doesnt test yet

* lint

* fix p2p tests

* space

* space

* space

* fmt

* fmt
2019-05-09 16:02:24 -05:00
Preston Van Loon
e5a00fdca9
Add GCP test configuration and p2p-host-ip flag (#2510)
* Add GCP startup script

* add flag for external IP

* specify that it must be for linux

* /deploy/create

* gofmt
2019-05-06 13:33:19 -04:00
Raul Jordan
679493c786
issue warn log on disconnecting peer instead of error (#2491) 2019-05-05 11:22:04 -05:00
Zak Cole
8b510e7fad typo (#2464)
negotiation was spelled wrong and it confused me for a second.
2019-05-01 16:49:59 -07:00
Preston Van Loon
80d47468e4 Add a temporary commenting for issue #2408 (#2409) 2019-04-27 21:56:28 -05:00
Preston Van Loon
769fcb50ab
use Network, not Peerstore (#2404) 2019-04-27 16:05:19 -04:00
Preston Van Loon
210edfc940 P2P handshake handling (#2306)
* proto: illegal wireType 7 :(

* set addr to todo for now so somethign gets sent

* push latest progress

* Add feedback from @raulk. Stream never connects

* working handshake handler

* add exclusions for relay/bootstrap node

* fix tests, still need to add new ones

* remove race, fails coverage

* Add test for negotiation

* gazelle

* regen pb

* Update shared/p2p/handshake_handler.go

Co-Authored-By: prestonvanloon <preston@prysmaticlabs.com>
2019-04-27 14:08:27 -05: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
Raul Jordan
e4bbf54f9f
Hardcoded Bootstrap + Relay Nodes (#2359)
* default bootstrap node and local network flag

* default relay node value

* Update shared/p2p/service.go

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

* use no discovery
2019-04-23 15:30:59 -05:00
Preston Van Loon
d00350bf75 disable pubsub signatures and verification (#2339) 2019-04-22 09:44:36 -07:00
Preston Van Loon
a5da9f2dd6
Add feature flag to toggle gossip sub in p2p (#2322)
* add feature flag to enable gossip sub in p2p

* invert the enable/disable logic

* add the flag in k8s and fix tests

* gazellle

* return empty config if nil
2019-04-21 13:31:23 -04:00
Preston Van Loon
67cbf774f5 Add nogo to introduce built time linting (#2317)
* Add nogo and fix lint issues

* Run gazelle

* better gazelle

* ignore external struct tags
2019-04-21 22:14:34 +08:00
Preston Van Loon
82bd94b42d
do not directly dial a peer we cannot reach (#2245) 2019-04-14 08:04:17 +10:00
Preston Van Loon
3ec9fc0b8f lower the p2p peer count minimum for a successful status (#2179) 2019-04-05 15:09:05 -05:00
Preston Van Loon
0bd4489bc3 add span tag (#2176) 2019-04-05 15:00:35 -05:00
Preston Van Loon
55ca5cc2c3
do bootstrap p2p (#2177) 2019-04-05 14:30:41 -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
Raul Jordan
7472628c48
Modify p2p Allowed Buffer Size & Batch Block Limit (#2114)
* change batch block size

* imports
2019-03-30 15:43:15 -05:00
Preston Van Loon
46a83a83d0
Use DNS resolution and istio for redialing bootnode (#2071)
* Use DNS resolution and istio for redialing bootnode

* use faster peering
2019-03-25 12:56:42 -05:00
Preston Van Loon
d1d2af4e50
Reconnect to VIP peers (#2070)
* reconnect to peers

* Add test for p2p
2019-03-25 10:36:44 -05:00
Raul Jordan
053038446c
Allow 8 Validator Multinode Cluster to Run Indefinitely (#2050)
* plug forkchoice to blockchain service's block processing

* fixed tests

* more fixes...

* clean ups

* fixed test

* Update beacon-chain/blockchain/block_processing.go

* merged with 2006 and started fixing tests

* remove prints

* fixed tests

* lint

* include ops service

* if there's a skip slot, slot--

* fixed typo

* started working on test

* no fork choice in propose

* bleh, need to fix state generator first

* state gen takes input slot

* feedback

* fixed tests

* preston's feedback

* fmt

* removed extra logging

* add more logs

* fixed validator attest

* builds

* fixed save block

* children fix

* removed verbose logs

* fix fork choice

* right logs

* Add Prometheus Counter for Reorg (#2051)

* fetch every slot (#2052)

* test Fixes

* lint

* only regenerate state if there was a reorg

* better logging

* fixed seed

* better logging

* process skip slots in assignment requests

* fix lint

* disable state root computation

* filter attestations in regular sync

* log important items

* better info logs

* added spans to stategen

* span in stategen

* set validator deadline

* randao stuff

* disable sig verify

* lint

* lint

* save only using historical states

* use new goroutine for handling sync messages

* change default buffer sizes

* better p2p

* rem some useless logs

* lint

* sync tests complete

* complete tests

* tests fixed

* lint

* fix flakey att service

* PR feedback

* undo k8s changes

* Update beacon-chain/blockchain/block_processing.go

* Update beacon-chain/sync/regular_sync.go

* Add feature flag to enable compute state root

* add comment

* gazelle lint fix
2019-03-25 10:21:21 -05:00
Preston Van Loon
58a13a2eb7 Use imported interfaces in sync package (#2032)
* Fix spans in regular_sync

* more regular sync ctx fixes

* rename

* use more imported interfaces

* add godoc comments
2019-03-19 17:07:49 -06:00
Preston Van Loon
612bb38077 Cross p2p spans, more spans, synchronous attestations, minor fixes (#2009)
* Fix assignments bug where validators don't retry for assignments on failure

* synch only please

* trying to fix state issues

* trying random stuff

* do not explode

* use ctx

* working build, failing tests

* broadcast local addrs as well as relay addrs

* fixed p2p tests, more tests to fix still

* another test fixed, log warning instead of throw error

* Fix last tests

* godoc

* add test for broadcast in apply fork choiec

* remove unneeded code

* remove tracer adapter, not needed

* remove extra stuff

* remove any

* revert addr_factory

* revert addr_factory

* Revert "revert addr_factory"

This reverts commit e93fb706494a1070158b8db31e67146d6b0648ad.

* Revert "revert addr_factory"

This reverts commit dedaa405559cc818698870c4e4570953367f1e3c.

* revert removal of this code

* unused param
2019-03-17 10:56:05 +08:00
Preston Van Loon
2c1f29922e use floodsub (#1992) 2019-03-14 09:05:49 -07:00
Preston Van Loon
4767b1dfbf Return loopback address when disconnected from network (#1969)
* Return loopback address when disconnected from network

* Update discovery_norace_test.go
2019-03-11 20:01:46 -07:00
Raul Jordan
205594c5d6 Fix Travis Failures on Master (#1938)
* resolve travis conflicts

* cp proto

* revert

* remove unused context
2019-03-07 23:54:41 -05:00
Preston Van Loon
2e7b08f97e
p2p fixes / improvements (#1931)
* don't broadcast to yourself

* todo

* Also listen for incoming streams

* send to a specific peer

* add godoc comment

* handle EOF as a normal thing

* gazelle

* add test for subscribing via direct comm
2019-03-07 21:37:15 -05:00
Preston Van Loon
1f550a0da9
Handle nil protos (#1927)
* Handle hash nil pointers

* handle in hash beacon block

* add recovery when broadcasting p2p messages

* cmt

* gazelle
2019-03-07 11:32:01 -05:00
Preston Van Loon
eda03ff767
Recover from a panic in p2p (#1906)
* recover from a panic in p2p

* Add safely process function

* print proto message

* add status to the span, if available

* add status to the span, if available
2019-03-05 23:57:44 -05:00
Preston Van Loon
2a7d9e157c
currently connected peers (#1893) 2019-03-05 15:20:47 -06:00
Ivan Martinez
5aa7320507 Clear Up Code Inconsistencies (#1836) 2019-03-03 09:31:29 -08:00
Preston Van Loon
a19cb1864e Tracing additions (#1747) 2019-02-27 19:55:47 -08:00
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -08: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
Preston Van Loon
19d9ad3e37
Revert "add unit test for test broadcast (#1127)" (#1348)
This reverts commit 685e299c45.
2019-01-18 19:27:21 -05:00
Jonathan Gimeno
685e299c45 add unit test for test broadcast (#1127)
* add unit test for test broadcast

* execute goimports

* add import peerstore

* refactor and check message equals expected

* remove not needed sleep

* add function to connect hosts to host

* refactor test for better reading

* refactor to only use one channel

* refactor subs to channel

* close channels instead of sending boolean value

* use goimports

* copy value to avoid race condition

* remove TODO comment

* fix issues with gometalinter

* run gazelle

* reduce sleep time

* add comments to goroutines
2019-01-17 20:43:22 -05:00
Preston Van Loon
5b14c8695d
Actually test p2p service against the service definition (#1304) 2019-01-12 23:35:00 -05:00
Raul Jordan
1f11b821ab
Implement PoW Chain Deposit Trie in Go (#1285) 2019-01-11 16:29:30 +08:00
Kushagra Sharma
ef41dcfe3b Documented p2p.Server.Broadcast (#1166)
* Documented Server.Broadcast

* Fixed documentation formatting
2019-01-10 22:56:17 -05:00
Preston Van Loon
a901a154dc
Health check endpoints for services (#1183)
* /healthz part1

* lint, fix

* lints and todos

* add p2p status test

* Add test for service registry Statuses

* fix my fake errors for the linter

* Test healthz handler

* Run gazelle
2018-12-30 16:20:43 -05: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
renovate[bot]
4a784d3735 Update com_github_prometheus_common commit hash to 67670fe (#1125)
* Update com_github_prometheus_common commit hash to 67670fe

* fix formatting, the values are now floats, not ints

* delete metric with a now wild floating point value
2018-12-18 21:50:26 -05:00
terence tsao
6fb3af04da
Implement Attestation Participants Helper Function (#1111) 2018-12-17 10:34:28 -08:00
Jonathan Gimeno
4f316d6ed0 Issue 1017 taken port (#1108)
* add git ignore to avoid intellij bazel plugin files.

* check if port for p2p is available

* add unit test for port taken
2018-12-17 16:57:22 +08:00
Preston Van Loon
c8ce74825e Bootstrap the DHT service (#973)
* Bootstrap the DHT service, add some tracing spans

* fix

* test fix

* dont ignore error
2018-11-26 10:18:43 -06:00