* Dont return if proposer boost roots are missing
* move spectests to doublylinked tree
* unit test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Remove native state flag and use native state in spectests
* remove feature from tests
* use e2e config in slasher simulator
* use params.BeaconConfig in testutil
* use correct function
* use minimal config in go_test
* fix TestListValidators
* parameterize sync committee bits and aggregation bits
* Fix TestServer_ListIndexedAttestations_GenesisEpoch
(cherry picked from commit 254ab623dde08ae8886b152facdbbd8889ed79db)
* fix more tests
* fix even more
* moreeee
* aaaand more
* one more fix
* one more
* simplify TestGetAltairDuties_UnknownPubkey
* comment out problematic test
* one more fix
* one more
* aaaand one more
* another
* use fieldparams in HydrateBlindedBeaconBlockBodyBellatrix
* create new package for mainnet tests
* TestServer_GetBellatrixBeaconBlock
* change slashed validator index
* clear cache in reward_test.go
* deprecate flag
* create bazel mainnet target
* move attester mainnet test to mainnet target
* "fix" proposer tests
* use minimal config in TestServer_circuitBreakBuilder
* fix TestProposer_ProposeBlock_OK
* more fixes in validator package
* more fixes
* more fixes
* test code
* move TestProposer_GetBeaconBlock_BellatrixEpoch to minimal
* finally
* remove proposer_bellatrix_mainnet_test.go
* fix TestServer_GetBellatrixBeaconBlock_HappyCase
* fix TestServer_GetBellatrixBeaconBlock_BuilderCase
* Preston needs to fix this!
* Revert "Preston needs to fix this!"
This reverts commit b03d97a16e3080e254c7b19d7f193d3c600ca869.
* remove proto state tests
* fix migration tests
* static analysis fix
* review
* remove proto state
* swap state in tests
* fix BUILD file in /proto/testing
* remove metrics test with nil state
* Report voted fractions for a given root
* unused parameters
* comment update
* change test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* 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>
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
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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