Radosław Kapka
30cd158ae5
Move forkchoice dump to eth
namespace ( #11325 )
...
* protos
* server code
* rename v2 to v1 in endpoint
* middleware
* test fix
* test fix
* oops
* remove duplicated import
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-26 14:54:32 +00:00
Potuz
52271cf0ba
Report depth and distance on reorgs ( #11315 )
...
* Report depth and distance on reorgs
* rename to CommonAncestor
* change event feed
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-25 23:59:08 +00:00
Potuz
e1f56d403c
Restore forkchoice dump endpoint. ( #11312 )
...
* Restore forkchoice dump endpoint.
Only working on doubly-linked-tree.
* unit test
* revert proto changes
* protoarray
* Deepsource
* shut up!
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-25 23:37:23 +00:00
Potuz
ab7e97ba63
Fix setNodeAndParentValidated ( #11302 )
...
* Fix setNodeAndParentValidated
* fix tests
2022-08-24 19:30:45 +00:00
Potuz
76f958710f
Protoarray deadlocks ( #11271 )
...
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-19 14:46:12 +00:00
Potuz
8fecfaee48
DoublyLinkedTree double locks ( #11269 )
...
* DoublyLinkedTree double locks
* fix updateCheckpoints
* add comment
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-19 14:06:57 +00:00
Raul Jordan
100ca0ebaf
Prysmctl Command to Request Beacon Nodes for Block Ranges Over P2P ( #11035 )
...
* first
* attempt p2p connect send tool
* attempt
* stream registration
* trying to register
* attempt
* workinnnn
* begin
* p2p prysmctl tool
* ignore
* fix
* delete deprecated
* p2p smaller iface surface area
* further p2p refactor
* gaz
* better logging
* process
* all functionality
* fix up
* rhandle
* v2 req
* cmd
* send sub
* v1 handle
* show head slot
* cmd
* cmd lib
* gazelle fix
* bazel
* gaz
* work on the handshake items
* prevent dial to self
* add config awareness
* gaz
* inferring host addrs from p2p
* initialize data mappings
* add own mock
* fix up logic
* gaz
* add img
* gaz
* add images
* builds
* builds
* nishant feedback:
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2022-08-17 06:38:57 +00:00
Potuz
5c84192606
Revert --enable-forkchoice-doubly-linked-tree ( #11212 )
...
* Revert --enable-forkchoice-doubly-linked-tree
* fix tests
* fix parallell test
* fix noviablehead tests
* Terence's suggestion
2022-08-16 10:39:57 -03:00
Raul Jordan
d077483577
Add V3 Suffix to All Prysm Packages ( #11083 )
...
* v3 import renamings
* tidy
* fmt
* rev
* Update beacon-chain/core/epoch/precompute/reward_penalty_test.go
* Update beacon-chain/core/helpers/validators_test.go
* Update beacon-chain/db/alias.go
* Update beacon-chain/db/alias.go
* Update beacon-chain/db/alias.go
* Update beacon-chain/db/iface/BUILD.bazel
* Update beacon-chain/db/kv/kv.go
* Update beacon-chain/db/kv/state.go
* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go
* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go
* Update beacon-chain/sync/initial-sync/service.go
* fix deps
* fix bad replacements
* fix bad replacements
* change back
* gohashtree version
* fix deps
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-08-16 12:20:13 +00:00
Potuz
155d60dd60
Remove forkchoice debug endpoint ( #11105 )
...
* Remove forkchoice debug endpoint
* change protos
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-08-15 21:04:39 +00:00
Potuz
186fbc5f99
release checkpoints lock from store.head ( #11217 )
2022-08-13 07:19:52 -07:00
Potuz
c79ec31c17
Release checkpoints lock on on_tick ( #11216 )
...
There is a double lock race condition when NewSlot acquires the
checkpoints lock first and the nodes lock later, while calls to Head()
acquire the nodeslock first and the checkpoints lock later.
This PR releases the checkpoints lock in NewSlot, to reaquire it later
in updateUnrealizedCheckpoints after getting the nodes lock
2022-08-13 09:30:08 -03:00
terencechain
1117118435
Add highest slot and blocks received last epoch tracking ( #11146 )
...
* Add highest slot and blocks received last epoch tracking
* Comments
* Potuz feedback
* Fix tesT
* Potuz feedback, use clock time
* Raul's feedback
* Raul's feedback
* Use field params
* Fix minimal value
* Fix constant
* Fix constant
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-10 15:58:52 +00:00
terencechain
9b4d22c48c
Remove unused ctxs ( #11192 )
...
* Remove unused ctxs
* Check ctx errors
2022-08-09 16:43:29 +00:00
David Theodore
1323912625
Node by root mutex fix ( #11172 )
2022-08-04 19:40:25 -07:00
Potuz
cef95dd5b2
Revert --experimental-disable-boundary-checks ( #11160 )
...
* Revert --experimental-disable-boundary-checks
* add deprecation
* gaz
* spectests
* spectests fix
* fix previous justified checkpoint
* copy previous jcp
* Revert "copy previous jcp"
This reverts commit 6e2b865c23e356e24b1f801ad3670acb0714ade7.
* update previous jcp on on_tick
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-04 13:26:41 +00:00
terencechain
d4ab08050f
Clean up: fix typos ( #11165 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-03 18:47:30 +00:00
Potuz
19e4cd30cf
Forkchoice: expose if no tip is viable ( #11153 )
...
* Forkchoice: expose if no tip is viable
This PR changes the behavior on when the node is considered optimistic.
A call to `blockchain.IsOptimistic()` relies solely on forkchoice, if
all tips are invalid, then it's optimistic. If the current headroot is
not in forkchoice then it's optimistic.
A call to `blockchain.IsOptimisticForRoot()` will return true if the
requested root is headroot and it's not found in forkchoice
* update comment
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-08-03 13:59:03 +00:00
Radosław Kapka
879e310332
Native Blocks Ep. 2 - Switch usages to new package ( #10885 )
...
* panic in SizeSSZ
* moving slowly
* adapt old code to new interfaces
* return interfaces from factory functions
* replace the rest of WrappedSignedBeaconBlock
* WrappedBeaconBlock
* WrappedBeaconBlockBody
* miscellaneous
* Test_BeaconBlockIsNil
* replace usages of BeaconBlockIsNil
* replace usages of mutator
* fix all build errors
* fix some more issues
* mutator changes
* relax assertions when initializing
* revert changes in object_mapping.go
* allow calling Proto on nil
* Revert "allow calling Proto on nil"
This reverts commit ecc84e455381b03d24aec2fa0fa17bddbec71705.
* modify Copy and Proto methods
* remove unused var
* fix block batch tests
* correct BUILD file
* Error when initializing nil objects
* one more error fix
* add missing comma
* rename alias to blocktest
* add logging
* error when SignedBeaconBlock is nil
* fix last test
* import fix
* broken
* working
* test fixes
* reduce complexity of processPendingBlocks
* simplified
2022-08-02 15:30:46 +00:00
terencechain
97dc9ebbc8
Reset proposer root if the root is getting removed in store ( #11053 )
...
* Reset proposer root if the root is getting removed in store
* Potuz feedback
* Fix root
* unit test
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-07-18 15:09:01 +00:00
Preston Van Loon
5722a5793c
Tracing: properly overwrite context so that spans can be correctly attributed ( #11012 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-14 17:00:33 +00:00
Potuz
f2dcc9a570
more pruning unit tests ( #11034 )
...
* unit tests
* Sort the slice before compare
* Gazelle
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-13 16:23:29 +00:00
Potuz
2f0e2886b4
Do not error if the LVH is bogus ( #10996 )
...
* Do not error if the LVH is bogus
* add tests and mark the regression PR
* dead code
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-06 17:37:15 +00:00
terencechain
2d53ae79df
Cleanups to pulltips ( #10984 )
...
* Minor cleanups to pulltips
* Feedbacks
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-06 16:55:17 +00:00
Potuz
379bed9268
add heuristics for pulltips ( #10955 )
...
* add heuristics for pulltips
* gazelle
* add unit test
* fix unit test
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-03 20:27:39 +00:00
Potuz
73237826d3
ensure there are as many deltas as nodes ( #10979 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-03 00:53:33 -03:00
Potuz
5d29ca4984
Experimental disable boundary checks ( #10936 )
...
* init
* bellatrix + altair tests passing
* Add Phase0 support
* add feature flag
* phase0 test
* restore testvectors
* mod tidy
* state tests
* gaz
* do not call precompute
* fix test
* Fix context
* move to own's method
* remove spectests pulltips
* time import
* remove phase0
* mod tidy
* fix getters
* Update beacon-chain/forkchoice/doubly-linked-tree/types.go
* reviews
* fix workspace
* Recursive rlocks
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2022-06-29 23:37:21 +00:00
Radosław Kapka
7f56ac6355
Massive code cleanup ( #10913 )
...
* Massive code cleanup
* fix test issues
* remove GetGenesis mock expectations
* unused receiver
* rename unused params
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-06-27 13:34:38 +00:00
Potuz
f8b4d8c57a
Deprecate store in blockchain pkg ( #10903 )
...
* Deprecate store WIP
* fix spectests build
* mock right interface
* sync tests build
* more tests builds
* blockchain tests
- TestFinalizedCheckpt_GenesisRootOk
- TestCurrentJustifiedCheckpt_CanRetrieve
- TestJustifiedCheckpt_GenesisRootOk
- TestHeadRoot_CanRetrieve
- TestHeadRoot_UseDB
- TestService_ProcessAttestationsAndUpdateHead
- TestService_VerifyWeakSubjectivityRoot
- TestVerifyFinalizedConsistency_InconsistentRoot_ProtoArray
- TestVerifyFinalizedConsistency_InconsistentRoot_DoublyLinkedTree
- TestVerifyFinalizedConsistency_Ok
- TestStore_OnBlock_ProtoArray
- TestStore_OnBlock_DoublyLinkedTree
- TestStore_OnBlockBatch_ProtoArray
- TestStore_OnBlockBatch_DoublyLinkedTree
- TestStore_OnBlockBatch_NotifyNewPayload
- TestCachedPreState_CanGetFromStateSummary_ProtoArray
- TestCachedPreState_CanGetFromStateSummary_DoublyLinkedTree
* more blockchain tests
- TestStore_OnBlockBatch_PruneOK_Protoarray
- TestFillForkChoiceMissingBlocks_CanSave_ProtoArray
- TestFillForkChoiceMissingBlocks_CanSave_DoublyLinkedTree
- TestFillForkChoiceMissingBlocks_RootsMatch_Protoarray
- TestFillForkChoiceMissingBlocks_RootsMatch_DoublyLinkedTree
- TestFillForkChoiceMissingBlocks_FilterFinalized_ProtoArray
- TestFillForkChoiceMissingBlocks_FilterFinalized_DoublyLinkedTree
- TestVerifyBlkDescendant
- Test_verifyBlkFinalizedSlot_invalidBlock
- TestChainService_SaveHeadNoDB
* update best justified from genesis
* deal with nil head on saveHead
* initialize prev justified checkpoint
* update finalization correctly
* update finalization logic
* update finalization logic
* track the wall clock on forkchoice spectests
* export copies of checkpoints from blockchain package
* do not use forkchoice's head on HeadRoot
* Remove debug remain
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* terence's review
* add forkchoice types deps
* wtf
* debugging
* init-sync: update justified and finalized checkpoints on db
* call updateFinalized instead of only DB
* remove debug symbols
* safe copy headroot
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-06-25 03:57:52 +00:00
terencechain
b7463d0070
Ignore nil node when saving orphaned atts ( #10930 )
...
* Ignore nil node when saving orphaned atts
* Just use ErrUnknownCommonAncestor
2022-06-24 18:07:31 +00:00
Potuz
20b4c60bcb
Apply Proposer Boost from forkchoice ( #10893 )
...
* Apply proposer boost at block insertion
* gaz
* fix tests
* revert time change
* conflict
* change genesis time in forkchoice on spectests
* Terence Review
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-06-22 13:56:07 +00:00
terencechain
0b50ab7832
Consolidate ExecutionPayloadHeader
Protobuf definitions ( #10917 )
2022-06-22 13:08:06 +02:00
Potuz
2d0fdf8b4a
prune within forkchoice ( #10896 )
2022-06-17 12:53:17 -03:00
Potuz
e439f4aff6
Forkchoice duplicate store ( #10840 )
...
* forkchoice tests
* blockchain tests
* no fatal errors
* use ZeroHash for genesis
* deal with zerohashes at genesis
* avoid nil best justified checkpoint on new store
* unit tests
* Debug log
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Terence's review
* update capitalization
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* update capitalization
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* update capitalization
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* update capitalization
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-06-16 18:21:40 +00:00
Potuz
18fc17c903
Forkchoice checkpoints ( #10823 )
...
* double_tree_changes
* protoarray changes
* beacon-chain changes
* spec tests and debug rpc fixes
* more conflicts
* more conflicts
* Terence's review
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-06-09 22:28:30 +00:00
Potuz
52acaceb3f
Enforce that every node descends from finalized node ( #10784 )
...
* Enforce that every node descends from finalized node
* fix test
* fix conflict
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-06-06 14:28:49 +00:00
Potuz
2536195be0
Change forkchoice API ( #10774 )
...
* Change forkchoice API
doubly-linked-tree changes
* protoarray changes
* blockchain tests
* rebase and fix conflicts
* More blockchain fixes
* blockchain test fixes
* doubly linked tree changes again
* protoarray changes v2
* blockchain packages v2
* Radek's review
* Fix on batch processing
* Terence's review
* fill in at start
* Revert "fill in at start"
This reverts commit 8c11db063a02a59df8e0ac6d0af0c8923921dc76.
* wrap error message
* fill in before mutating the state
* wrap nil node errors
* handle unknown optimistic status on init sync
* rename insert function
* prune on batches only after forkchoice insertion
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-06-05 17:48:21 +00:00
Potuz
b582ca27e6
Forkchoice fill chain ( #10783 )
...
* Move chain inclusions to forkchoice handling
* gaz
* return early if no blocks are pending
* Terence's review
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-31 10:19:48 +00:00
terencechain
364ad3fbda
Reinsert reorg atts ( #10767 )
...
* Add common ancestor root for protoarray
* More efficient algo
* Tests
* Fix linting
* Fix linting
* Fix linting
* Fix linting
* Fix linting
* Fix linting
* Apply suggestions from code review
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Feedbacks
* Revert saveHead changes
* Revert "Revert saveHead changes"
This reverts commit a15fddc2e68b2e370290b1783eb1ee626af17503.
* Fix rest of the tests
* Update beacon-chain/blockchain/head.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-29 19:32:42 +00:00
terencechain
7cc291c09f
Update proposer boost score and spec tests ( #10665 )
...
* Update mainnet_config.go
* Fixed a few tests
* Update rest of the tests
* Consolidate blockchain errors
* Update spec tests to v1.2.0-rc.1
* Fix withdrawal epoch overflows
* add slashings to forkchoice spectests
* Remove unused parameter
* Disable skip slot cache
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-05-23 23:08:24 +00:00
Potuz
237807b248
Do not update forkchoice checkpoints on calls to Head ( #10702 )
...
* Only update forkchoice checkpoints at epoch transition
* gazelle
* blockchain package changes
* fix node
* spectest package
* rpc package
* fix spec test
* Fix spectests
* fix new_slot.test
* gaz
* fix spectests
* fix conflicts
* Update beacon-chain/blockchain/process_block.go
* regression do not update on newSlot
* revert bd64cab
* terence's review
* fix conflicts
* fix latest conflicts
* gaz
* go mod tidy
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-22 18:37:01 +00:00
Potuz
e7991b9d7b
Track unrealized justification/finalization in forkchoice ( #10658 )
...
* Track unrealized justification/finalization in forkchoice
* add missing files
* mod tidy
Co-authored-by: terencechain <terence@prysmaticlabs.com>
2022-05-21 10:27:07 -03:00
terencechain
e9ad7aeff8
Fix a bad forkchoice proposer boost test ( #10705 )
...
* Fix a bad forkchoice proposer boost test
* Improve tests
* Add fork regression
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-05-17 16:26:56 -03:00
Potuz
e808025b17
regression test off-by-one ( #10675 )
...
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-12 15:49:37 +00:00
Radosław Kapka
7db0435ee0
Unify WARNING
comments ( #10678 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-12 15:25:44 +00:00
terencechain
6a197b47d9
Call fcu on invalid payload ( #10565 )
...
* Starting
* remove finalized root
* Just call fcu
* Review feedbacks
* fix one test
* Fix conflicts
* Update execution_engine_test.go
* Add a test for invalid recursive call
* Add comprehensive recursive test
* dissallow override empty hash
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-10 20:02:00 +00:00
Potuz
df695346a5
process slashings once ( #10621 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-04 14:51:18 +00:00
terencechain
5ad4f14ffc
Use remove equivocating validators ( #10603 )
...
* remove equivocating votes from forkchoice
* shutup deepsource
* Add insertSlashingsToForkChoiceStore
* Fix equality checks, add tests
* Update process_block.go
* Fix equality check for doublylinked
* More checks
* Rm err return
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-05-03 00:46:05 +00:00
Potuz
4c869fa587
remove equivocating votes from forkchoice ( #10597 )
...
* remove equivocating votes from forkchoice
* shutup deepsource
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-05-02 19:19:03 +00:00
Potuz
f9113dfd06
Forkchoice use parent hash when removing invalid blocks ( #10594 )
2022-05-02 06:53:22 -07:00
Raul Jordan
84916672c6
Remove Eth2-Types Dependency in Prysm ( #10578 )
...
* replace eth2 types
* replace protos
* regen proto
* replace
* gaz
* deps
* amend
* regen proto
* mod
* gaz
* gaz
* ensure build
* ssz
* add dep
* no more eth2 types
* no more eth2
* remg
* all builds
* buidl
* tidy
* clean
* fmt
* val serv
* gaz
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2022-04-29 10:32:11 -04:00
terence tsao
58f4ba758c
Metrics tracking EE VALID/SYNCING/INVALID response counter ( #10504 )
...
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2022-04-12 09:51:13 +00:00
terence tsao
d98428dec4
Can prune nodes from canonical and payload maps ( #10496 )
...
* Can prune nodes from canonical and payload maps
* Update store_test.go
* prune payload hashes, canonical nodes and better testing
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2022-04-11 11:08:50 +00:00
Potuz
ac8d27bcf1
Deal with node balance underflow ( #10492 )
...
* deal with balance underflow
* fix log format
* preston's review
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-04-07 17:38:48 +00:00
Potuz
83a83279d4
Remove synced tips and use last valid hash ( #10439 )
...
* Remove synced tips
use last valid hash in removing invalid nodes.
* add test
* Remove unused code
* More unused parameters
* Fix proposer boost
* terence's review #1
* Fix conflicts
* terence's review 2
* rename argument
* terence's review #3
* rename optimistic -> status
* Minor clean up
* revert loop variable change
* do not mark lvh as valid
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-04-06 14:18:30 +00:00
Nishant Das
2a7a09b112
Add Lock Analyzer ( #10430 )
...
* add lock analyzer
* fix locks
* progress
* fix failures
* fix error log
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-04-05 16:39:48 +00:00
Raul Jordan
eb6d68a4b1
Deterministic Proposer Root Boosting in Forkchoice ( #10427 )
...
* begin refactor
* fix doubly linked tree tests
* pass
* fix up
* gaz
* buidl
* buidl more
* comment
* args check
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-03-28 21:34:41 +00:00
Potuz
a5dc40393d
Allow inner protoarray nodes to become VALID ( #10418 )
...
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-03-25 15:35:44 +00:00
Potuz
0165351db3
Setup Optimistic sync when starting the service ( #10397 )
...
* Load Last Validated Checkpoint at service startup and initialize
Forkchoice
* fix spectests
* Update service_test.go
* wip
* Fix blockchain tests
* remove unnecessary summary saves
* Terence's suggestion
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-03-23 21:11:36 +00:00
Potuz
8f49167117
return invalid roots from SetOptimisticToInvalid ( #10403 )
...
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-03-23 15:55:05 -03:00
terence tsao
c7d64c03ac
Insert payload hash to forkchoice store nodes ( #10400 )
...
* Insert payload hash to forkchoice store nodes
* Fix tests
* Update new_slot_test.go
* Update beacon-chain/blockchain/process_block.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-03-22 01:20:42 +00:00
Potuz
807b71244b
Add database methods for optimistic sync ( #10357 )
...
* Add database methods for optimistic sync
* Add epoch comparison
* add extra epoch comparison
* Summary instead of block
* fix tests
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-03-15 20:52:59 +00:00
Potuz
3f1e3cf82f
remove optimistic control flag ( #10340 )
...
* remove optimistic control flag
* Rename
* More
* More
* redundant return
* fix conflict
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-03-12 17:32:04 +00:00
terence tsao
60003c481b
Add unlock to IsOptimistic
returns ( #10341 )
...
* Add unlock to returns
* add regression test
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-03-11 10:36:47 +00:00
Preston Van Loon
c1197d7881
Add static analysis for unsafe uint casting ( #10318 )
...
* Add static analysis for unsafe uint casting
* Fix violations of uintcast
* go mod tidy
* Add exclusion to nogo for darwin build
* Add test for math.Int
* Move some things to const so they are assured not to exceed int64
* Self review
* lint
* fix tests
* fix test
* Add init check for non 64 bit OS
* Move new deps from WORKSPACE to deps.bzl
* fix bazel build for go analysis runs
* Update BUILD.bazel
Remove TODO
* add math.AddInt method
* Add new test casts
* Add case where builtin functions and declared functions are covered
* Fix new findings
* cleanup
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2022-03-11 09:34:30 +00:00
Potuz
b59484b285
Export SetOptimisticToInvalid ( #10330 )
...
* temp
* export remove invalid blocks
2022-03-09 13:50:57 -03:00
Potuz
57a323f083
Forkchoice featureflag ( #10299 )
...
* Compiling main beacon-chain binary
* Add feature flag
* passing protoarray tests
* passing nodetree tests
* passing blockchain package tests
* passing rpc tests
* go fmt
* re-export forkchoice store from blockchain package
* remove duplicated import
* remove unused var
* add nodetree rpc method
* remove slot from IsOptimisticForRoot
* release lock in IsOptimistic
* change package name
* Revert "change package name"
This reverts commit 679112f9ef795922c631e7823dbdfb3746838f3c.
* rename package
* Update doc
* Fix span names
* Terence + Raul review
* remove go:build flags
* add errors dep
* spec tests
* fix call to IsOptimisticForRoot
* fix test
* Fix conflict
* change name of function
* remove ctx from store.head
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-03-09 03:05:51 +00:00
terence tsao
a9a75e0004
Release lock before return validatedTips
( #10289 )
...
* Release lock before return
* add test
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-03-01 15:36:47 +00:00
Potuz
f5719f8c8e
Fix updateCanonicalNodes ( #10241 )
...
* Fix updateCanonicalNodes
* fix logic
* terence's review
2022-02-14 21:30:26 +00:00
terence tsao
c9f299b50a
Clean up fork choice ( #10226 )
...
* Clean up fork choice
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/store_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/store_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update store.go
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2022-02-12 03:33:46 +00:00
Potuz
9f419bee7d
Remove unnecessary reassignement ( #10224 )
2022-02-10 23:51:20 -03:00
Potuz
82ceb51548
Load Synced Tips when starting from Finalized State ( #10196 )
...
* Load Synced Tips when starting from Finalized State
* Terence's review #1
* Fix tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-02-10 22:18:42 +00:00
Potuz
6a2ef13b87
add metrics for synced tips ( #10221 )
...
* add metrics for synced tips
* Update beacon-chain/forkchoice/protoarray/metrics.go
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-02-10 18:48:46 +00:00
Potuz
72a2dd004b
Fix integer overflow ( #10222 )
...
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-02-10 15:20:36 -03:00
Potuz
5f8b01ccda
Make UpdateSyncedTips safe for context cancellation ( #10174 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-02-09 14:54:27 +00:00
terence tsao
168e06e607
Save sync tips to DB ( #10171 )
...
* Save sync tips to DB
* Fix build
* Update process_block_test.go
* Copy map
* Revert back to nil
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-02-06 18:00:47 +00:00
Potuz
aeb6940935
Prune synced tips ( #10143 )
...
* Prune synced tips
* Terence's minor cleanups
* Update optimistic_sync.go
* go fmt
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-02-05 20:24:02 +00:00
Potuz
4020a603b6
Invalid synced tips ( #10154 )
...
* add synced_tips structure
* create optimisticStore type
* Add UpdateSyncedTips
* use context
* update comment
* use better context cancellation
* reinsert removed error from different PR
* Minor clean ups
* remove invalid nodes from forkchoice
* Update beacon-chain/forkchoice/protoarray/optimistic_sync.go
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* Add check for tip status
* Terence's minor cleanups
* Potus' feedbacks
* Update optimistic_sync.go
* Add erorr
* Synced
* update weights
* Add context error check
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-02-03 22:57:15 +00:00
terence tsao
3a5cfab5f2
Add IsOptimistic
chain info getter ( #10184 )
...
* Add chain info getter
* Interface
* Test
* Update mock.go
* Go fmt
* Update beacon-chain/blockchain/testing/mock.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
2022-02-03 21:30:07 +00:00
terence tsao
8a01d412f5
Implement fork choice spec tests ( #10159 )
...
* starting
* Reimplement store
* begin on proposer boost
* implement fork choice proposer boost algorithm
* boosting
* gaz
* add mutexes and previous root
* comment on compute proposer boost
* safe
* rem todo
* reset and add tests
* unit test for proposer boost score
* boost works
* Can process block
* Basic test case passing
* ex ante
* test
* propoer test
* More progresses
* More fixes
* rm unused pieces
* Refactor, add phase 0
* locks
* vanilla ex-ante attack
* test similar to spec test
* works works works
* boost test working for num votes > proposer boost weight
* commentary fixes
* rem unused
* comments
* Proposer boost use store time
* Reset proposer root
* debugging
* passing
* Rm unused visibility imports
* Move update head to better place
* Fix deepsrc complains
* Fix more complains
* Raul's feedback
* Use correct byte lengths
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-01-31 19:03:48 +00:00
Potuz
26ec352bdc
Update synced tips ( #10129 )
...
* add synced_tips structure
* create optimisticStore type
* Add UpdateSyncedTips
* use context
* update comment
* use better context cancellation
* reinsert removed error from different PR
* Minor clean ups
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-01-31 15:05:05 +00:00
Raul Jordan
65ec437ce5
Fork Choice Proposer Boost Changes ( #10083 )
...
* begin on proposer boost
* implement fork choice proposer boost algorithm
* boosting
* gaz
* add mutexes and previous root
* comment on compute proposer boost
* safe
* rem todo
* reset and add tests
* unit test for proposer boost score
* boost works
* ex ante
* test
* propoer test
* vanilla ex-ante attack
* test similar to spec test
* works works works
* boost test working for num votes > proposer boost weight
* commentary fixes
* rem unused
* comments
* boost necessary to sandwich unit test
* sad path
* gaz
* Update beacon-chain/forkchoice/protoarray/proposer_boost.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/forkchoice/protoarray/proposer_boost_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* gaz
* radek comments
* reset boosted root in on new slot
* pass
* broken tests
* cfg test
* modify e2e config
* Revert e2e changes
* Test
* Test again
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-01-29 16:32:01 +00:00
Potuz
cb0c382bf3
Fix Fork Choice prunning ( #10137 )
...
* Fix Fork Choice prunning
* Use copy node. Update comments and var names.
* rm unused err var
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2022-01-27 19:17:19 +00:00
Potuz
f0fd29d367
Is optimistic ( #10124 )
...
* add synced_tips structure
* create optimisticStore type
* Add ForkChoice.Optimistic()
Adds the logic implementing whether a synced block is optimistic or not.
* Terence's bug catch
* Reinforce warning
* Preston's review
* add comment on optimistic sync
2022-01-26 01:42:18 +00:00
Preston Van Loon
7df01feb58
Remove libfuzzer / afl based builds in favor of go 1.18 fuzz testing ( #10065 )
...
* Remove libfuzzer / afl based builds in favor of go 1.18 fuzz testing
* rm beacon-fuzz archive
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-01-20 04:51:02 +00:00
Radosław Kapka
5569a68452
Code cleanup ( #9992 )
...
* Value assigned to a variable is never read before being overwritten
* The result of append is not used anywhere
* Suspicious assignment of range-loop vars detected
* Unused method receiver detected
* Revert "Auxiliary commit to revert individual files from 54edcb445484a2e5d79612e19af8e949b8861253"
This reverts commit bbd1e1beabf7b0c5cfc4f514dcc820062ad6c063.
* Method modifies receiver
* Fix test
* Duplicate imports detected
* Incorrectly formatted error string
* Types of function parameters can be combined
* One more "Unused method receiver detected"
* Unused parameter detected in function
2021-12-07 17:52:39 +00:00
Raul Jordan
a9a4bb9163
Move Shared/Testutil into Testing ( #9659 )
...
* move testutil
* util pkg
* build
* gaz
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-23 18:53:46 +00:00
Raul Jordan
29513c804c
Create Encoding Bytesutil ( #9658 )
...
* bytesutil
* gaz
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-23 15:23:37 +00:00
Raul Jordan
f3d6dbcc1e
Move Shared/Params Into Config/Params ( #9642 )
...
* config params into pkg
* gaz
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-21 19:59:25 +00:00
Raul Jordan
61c24c3870
Move Fuzz/ Into Testing/ ( #9617 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-16 17:32:51 +00:00
terence tsao
ee5d75732d
Add pkg crypto ( #9603 )
...
* Add pkg crypto
* Update go.yml
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-15 22:55:11 +00:00
terence tsao
005ce7e238
Remove float64 usage for fork choice ( #9438 )
2021-08-20 14:15:18 -05:00
Preston Van Loon
d6bd619429
Bazel: minimal test build transitions ( #9122 )
...
* Add build transitions for minimal config based tests
* respect existing gotags
* clean up import
* Add some commentary
* gaz
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: rauljordan <raul@prysmaticlabs.com>
2021-06-30 19:22:09 +00:00
Raul Jordan
a860648960
Reduce Usage of Eth2 Terminology in Prysm ( #9104 )
...
* remove all mentions
* more changes
* folder by folder
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-06-26 19:00:33 +00:00
terence tsao
528cd89616
Move chainheads to blockchain pkg ( #8700 )
...
* Move chainheads to block chain's head info
* Fix mock
2021-04-03 11:25:25 +00:00
Radosław Kapka
f822f0436e
Break long lines in beacon chain package ( #8686 )
...
* Break long lines in beacon chain package
* change log formatting
* Revert "change log formatting"
This reverts commit b610fd67edbf4f9f095f0336e313376e4472d50a.
* Revert "Break long lines in beacon chain package"
This reverts commit 53215fdcde0ad5cbed5c9e0616979e3ae396322c.
* wrap lines over 160
* revert go.mod and go.sum
2021-03-30 11:24:46 +00:00
terence tsao
a8ab279cb8
Protoarray: add ChainHeads ( #8684 )
...
* Add ChainHeads
* Add only has bestChild case
* Update beacon-chain/forkchoice/protoarray/store.go
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-03-29 17:40:38 +00:00
Victor Farazdagi
a069738c20
ETH2 Types: Slot ( #8408 )
...
* update shared/params
* update eth2-types deps
* update protobufs
* update shared/*
* fix testutil/state
* update beacon-chain/state
* update beacon-chain/db
* update tests
* fix test
* update beacon-chain/core
* update beacon-chain/blockchain
* update beacon-chain/cache
* beacon-chain/forkchoice
* update beacon-chain/operations
* update beacon-chain/p2p
* update beacon-chain/rpc
* update sync/initial-sync
* update deps
* update deps
* go fmt
* update beacon-chain/sync
* update endtoend/
* bazel build //beacon-chain - works w/o issues
* update slasher code
* udpate tools/
* update validator/
* update fastssz
* fix build
* fix test building
* update tests
* update ethereumapis deps
* fix tests
* update state/stategen
* fix build
* fix test
* add FarFutureSlot
* go imports
* Radek's suggestions
* Ivan's suggestions
* type conversions
* Nishant's suggestions
* add more tests to rpc_send_request
* fix test
* clean up
* fix conflicts
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
2021-02-16 07:45:34 +00:00
Victor Farazdagi
a8e501b3cf
ETH2 Types: Epoch ( #8373 )
...
* update deps
* update deps
* update protos/*
* update deps
* reset protos
* update protos
* update shared/params/config
* update protos
* update /shared
* update shared/slotutil and shared/testutil
* update beacon-chain/core/helpers
* updates beacon-chain/state
* update beacon-chain/forkchoice
* update beacon-chain/blockchain
* update beacon-chain/cache
* update beacon-chain/core
* update beacon-chain/db
* update beacon-chain/node
* update beacon-chain/p2p
* update beacon-chain/rpc
* update beacon-chain/sync
* go mod tidy
* make sure that beacon-chain build suceeds
* go fmt
* update e2e tests
* update slasher
* remove redundant alias
* update validator
* gazelle
* fix build errors in unit tests
* go fmt
* update deps
* update fuzz/BUILD.bazel
* fix unit tests
* more unit test fixes
* fix blockchain UTs
* more unit test fixes
2021-02-09 10:05:22 +00:00
Raul Jordan
148e7fcd59
Consolidate Required Web UI Endpoints Into Single Protobuf File ( #8127 )
...
* define required endpoints for unifying backends
* proto definitions
* impl
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-12-16 17:30:48 +00:00