Skip to content

Commit

Permalink
Update to alpaca-devnet-1 baseline (#22)
Browse files Browse the repository at this point in the history
* Electra beacon config (#13907)

* Update spectests to v1.5.0

* Add electra config

* Fix tests in beacon-chain/rpc/eth/config

* gofmt

* Simplify prune invalid by reusing existing fork choice store call (#13878)

* Do not remove blobs DB in slasher. (#13881)

* Refactor beacon-chain/core/helpers tests to be black box (#13906)

* spectests: fail hard on missing test folders (#13913)

* Revert "zig: Update zig to recent main branch commit (#13142)" (#13908)

This reverts commit b24b60dbd88aab0e8348c1ae6fe7af50e63f9007.

* Remove EnableEIP4881 flag (#13826)

* Remove EnableEIP4881 flag

* Gaz

* Fix missing error handler

* Remove old tree and fix tests

* Gaz

* Fix build import

* Replace depositcache

* Add pendingDeposit tests

* Nishant's fix

* Fix unsafe uint64 to int

* Fix other unsafe uint64 to int

* Remove: RemovePendingDeposit

* Deprecate and remove DisableEIP4881 flag

* Check: index not greater than deposit count

* Move index check

* Protobufs for Electra devnet-0  (#13905)

* block protos

* proto and ssz

* stubs

* Enable Electra spec test

* Pull in EIP-7251 protobuf changes

From: https://github.com/prysmaticlabs/prysm/pull/13903

* All EIP7549 containers are passing

* All EIP7251 containers passing

* including changes from eip7002

* Everything passing except for beacon state hash tree root

* fixing eletra state to use electra payload

* Fix minimal test. Skip beacon state test

* Perston's feedback

---------

Co-authored-by: rkapka <[email protected]>
Co-authored-by: james-prysm <[email protected]>

* use [32]byte keys in the filesystem cache (#13885)

Co-authored-by: Kasey Kirkham <[email protected]>

* Electra: full beacon config (#13918)

* Electra: full beacon config

Fix TestGetSpec

* Fix beacon config spec compliance test so that it properly loads the config from spec tests. Tests failing for now.

* fix tests and comply with spec presets

* beacon-chain/cache: Convert tests to cache_test blackbox testing (#13920)

* beacon-chain/cache: convert to blackbox tests (package cache_test)

* Move balanceCacheKey to its own file to satisify go fuzz build

* Electra: Minor proto changes, cloner additions (#13923)

* Electra: more proto changes

* Roundtrip test for cloners

* Electra: HTR util for DepositReceipt and ExecutionLayerWithdrawalRequest (#13924)

* Electra: HTR utils for DepositReceipts and ExecutionLayerWithdrawalRequests

* Tests for HTR utils

* Electra: beacon-chain/core/helpers  (#13921)

* Electra helpers

* Electra helper tests and other fixes

* @terencechain feedback

* Fix spelling (#13929)

* Run correct test (#13935)

* Electra attestation interfaces (#13937)

* config values

* block protos

* get_committee_indices

* proto and ssz

* attestation interface

* Revert "Auxiliary commit to revert individual files from deadb2183723511721b3288c7168808a4fa97c64"

This reverts commit 32ad5009537bc5ec0e6caf9f52143d380d00be85.

* todos

* get_attesting_indices

* Revert "Auxiliary commit to revert individual files from dd2789723f90b15eb1f874b561d88d11dcc9c0bf"

This reverts commit f39644ed3cb6f3964fc6c86fdf4bd5de2a9668c8.

* beacon spec changes

* Fix pending attestation. Build ok

* Electra: add electra version

* Electra: consensus types

* gocognit exclusion

* @potuz's suggestion

* build fix

* interfaces for indexed att and slashing

* indexed att usage

* BuildSignedBeaconBlockFromExecutionPayload

* slashing usage

* grpc stubs

* remove unused methods

* Electra attestation interfaces

* cleanup

* tests

* make linter happy

* simple casting

* test fixes

* Fix spectest failures

* Regen pb and ssz files

* Handle "not ok" type assertion cases

* Setters that check version should always return an error. SetAttesterSlashings and SetAttestations

* gofmt

* Fix TestMinSpanChunksSlice_CheckSlashable

---------

Co-authored-by: terence tsao <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>

* EIP6110: add validator index cache (#13943)

* EIP6110: add validator index cache

* Add tests

* Radek's feedback

* Removes fork-specific concrete type getters (#13941)

* removing typed pb accessors

* refactor ssz api resp handlers to avoid typed pbs

* json get block handler refactor

* SubmitBlindedBlock to use generic json handling

* update SubmitBlindedBlock

* clear out more usages of PbForkname methods

* remove fork-specific getters from block interface

* remove usages of payload pb methods

* remove pb helpers from execution payload interface

* Update beacon-chain/rpc/eth/beacon/handlers.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update beacon-chain/rpc/eth/beacon/handlers.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Radek review

* fix error message

* deal with wonky builder responses

* :scissors:

* gaz

* lint

* tweaks for deep source

---------

Co-authored-by: Kasey Kirkham <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* Fork-specific consensus-types interfaces (#13948)

* fork-specific interface for electra

* add electra to wrapped payload switch

* use electra body in block factory

* deepsource

* rm pb getters from electra payload

---------

Co-authored-by: Kasey Kirkham <[email protected]>

* Spectest: v1.5.0-alpha.1 (#13934)

* Update spectests to v1.5.0-alpha.1

* Add PeerDAS config change

* Electra: BeaconState implementation  (#13919)

* Electra: Beacon State

* Electra: Beacon state fixes from PR 13919

* Add missing tests - part 1

* Split eip_7251_root.go into different files and reuse/share code with historical state summaries root. It's identical!

* Add missing tests - part 2

* deposit receipts start index getters and setters (#13947)

* adding in getters and setters for deposit receipts start index

* adding tests

* gaz

* Add missing tests - part 3 of 3

Update the electra withdrawal example with a ssz state containing pending partial withdrawals

* add tests for beacon-chain/state/state-native/getters_balance_deposits.go

* Add electra field to testing/util/block.go execution payload

* godoc commentary on public methods

* Fix failing test

* Add balances index out of bounds check and relevant tests.

* Revert switch case electra

* Instead of copying spectest data into testdata, use the spectest dependency

* Deepsource fixes

* Address @rkapka PR feedback

* s/MaxPendingPartialsPerWithdrawalSweep/MaxPendingPartialsPerWithdrawalsSweep/

* Use multivalue slice compatible accessors for validator and balance in ActiveBalanceAtIndex

* More @rkapka feedback. What a great reviewer!

* More tests for branching logic in ExitEpochAndUpdateChurn

* fix build

---------

Co-authored-by: james-prysm <[email protected]>

* Remove unused validator map copy method (#13954)

* EIP-7549 beacon spec (#13946)

* EIP-7549 beacon spec

* reviews

* change signature of AttestingIndices

* Update Libp2p Dependencies (#13960)

* Update Libp2p

* Update Go Sum

* Update spectests to v1.5.0-alpha.2 (#13961)

* Bump golang.org/x/net from 0.21.0 to 0.23.0 (#13895)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.21.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.21.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Handle Each Blob In Its Own Goroutine (#13959)

* Electra: upgrade (#13933)

* wip fork logic upgrade

* fixing replay and fork.go

* improving process function and adding tests for transition

* updating unit tests and temporarily removing some fields on state_trie.go

* updating state

* wip adding upgrade to electra code

* adding some comments

* adding spec tests

* fixing values used in state transition logic

* updating upgrade test

* gofmt

* avoid dup word linting

* fixing spec tests for fork

* gaz

* fixing tests

* improving unit test with new getters

* fixing bazel for minimal fork test

* adding bazel file

* Update beacon-chain/core/electra/upgrade.go

Co-authored-by: Preston Van Loon <[email protected]>

* addressing some comments and adding more tests

* addressing more feedback

* one more feedback

* changing value to interface after talking to preston

* adding missed review feedback

* fixing linting

* noticed I was using the wrong function in the state upgrade

* fixing and ignoring some deepsource issues

* moving core electra validator functions to helper to remove circular dependencies in other PRs

* missed deepsource complaint

* Update upgrade.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update testing/util/electra_state.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update testing/util/electra_state.go

Co-authored-by: Radosław Kapka <[email protected]>

* addressing feedback

* removing deepsoure ignore comments

---------

Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* use time.NewTimer() to avoid possible memory leaks (#13800)

Co-authored-by: Preston Van Loon <[email protected]>

* eip-7251: updated initiate_validator_exit with tests (#13974)

eip-7251: tests for initiate_validator_exit

* eip-7251: updated slash_validator with tests (#13976)

Tests for updated slash_validator

* Add electra DB (#13975)

* Add electra DB

* Fix typo

* Revert deep ssz change

---------

Co-authored-by: james-prysm <[email protected]>

* Electra: (partial) spectests  (#13977)

* Electra epoch transition, re-exports only

* Buildable electra spectests

Fix minimal tests that are passing on mainnet

* Skip failing tests

* Update state readme (#13890)

* README.md for the state package

* Update beacon-chain/state/state-native/README.md

Co-authored-by: Sammy Rosso <[email protected]>

* Revert "Update beacon-chain/state/state-native/README.md"

This reverts commit 6a4be3bae5b4ec99d3470d3459acb032b9ad78f4.

---------

Co-authored-by: Sammy Rosso <[email protected]>

* Add proposer gRPC suppot for Electra (#13984)

* Add proposer RPC suppot for Electra

* Kasey's feedback

* Add p2p support for Electra (#13985)

* Add p2p support for Electra

* Fix TestGossipTopicMappings_CorrectBlockType

* Add proposer suppot for Electra (#13987)

* Update interop genesis for Electra (#13991)

* electra engine api support (#13978)

* electra engine api support

* add marshaling support for ExecutionPayloadElectra

* add receipts to json tests

* deep source

* simplify slice handling

* deep source lint about type/method order

---------

Co-authored-by: Kasey Kirkham <[email protected]>

* eip-7251: compute_consolidation_epoch_and_update_churn with tests (#13981)

tests for compute_consolidation_epoch_and_update_churn

Co-authored-by: james-prysm <[email protected]>

* eip-7251: queue_entire_balance_and_reset_validator, queue_excess_active_balance, and switch_to_compounding_validator with tests (#13982)

* Fix GetPayloadMethodV4 endpoint string (#13992)

* Support version Electra for ForkchoiceUpdated (#13994)

* Support version Electra for ForkchoiceUpdated

* Update PbV3 version check

* Correctly return electra attestations for block getter (#13993)

* Debugging attestation bitlist issues in minimal spec (#13997)

* Enable experimental_remote_downloader in CI. (#13996)

* Support Electra for WriteBlockChunk (#13999)

* eip-7251: process consolidations (#13983)

* eip-7251: process_pending_consolidations and process_consolidations

* Consolidate unit tests + spectests

Fix failing spectest //testing/spectest/minimal/electra/operations:go_default_test

* Unskip consolidation processing for minimal spectests

* PR feedback

* Update beacon-chain/core/electra/consolidations_test.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update beacon-chain/core/electra/consolidations_test.go

Co-authored-by: Radosław Kapka <[email protected]>

* Move consolidation limit check outside of the loop

---------

Co-authored-by: Radosław Kapka <[email protected]>

* eip-7251: process_pending_balance_deposits (#14002)

* eip-7251: process_pending_balance_deposits

* Update beacon-chain/core/electra/balance_deposits_test.go

Co-authored-by: Radosław Kapka <[email protected]>

* Remove defensive check. A unit test shows nothing bad happens

* Safe sub to protect from underflow

* Use @kasey's idea for safer subtraction

---------

Co-authored-by: Radosław Kapka <[email protected]>

* Electra payload body engine methods (#14000)

* Combined v1/v2 payload body handling

* prevent overflows when dealing with electra fixture

---------

Co-authored-by: Kasey Kirkham <[email protected]>

* Remove Beacon API Postman collection (#14014)

* g/wei math->primitives, some new helpers (#14026)

Co-authored-by: Kasey Kirkham <[email protected]>

* Substantial VC cleanup (#13593)

* Cleanup part 1

* Cleanup part 2

* Cleanup part 3

* remove lock field init

* doc for SignerConfig

* remove vars

* use full Keymanager word in function

* revert interface rename

* linter

* fix build issues

* review

* Fuzz ssz round trip (#14006)

* Initial commit

* Fuzz all generated ssz en/decoders.

* Make proto message comparison aware of nested proto messages and differing unknown fields therein.

* Don't name receiver variable if not necessary.

* Run gazelle

* EIP-7549: Add aggregate attestation interfaces (#14029)

* interfaces move

* build fix

* remove annoying warning

* more build fixes

* review

* Fix TestNodeHealth_Concurrently race condition (#14033)

* Unwrap payload bid (#14035)

* engine GetPayload returns entire response

* deprecate PayloadValueTo(Gwei|Wei)

* return entire bid from builder getter

* get bid value from api bid (not ExecutionData)

* plumb bid and bundle through BuildBlockParallel

* rm ValueInGwei

* removing wei/gwei fields from the payload wrappers

* commentary around the little-endian situation

* finish the job in BuildBlockParallel

* light self-review cleanup

* fix spectest mock

* restore engine timeout

* lint fixes

* de-duplicate imports

* remove errant comment

* James feedback

---------

Co-authored-by: Kasey Kirkham <[email protected]>

* WebFix develop  (#14040)

* fixing issues introduced by PR 13593

* missed setting db

* linting

* convert ZeroWei to a func to avoid shared pointer (#14043)

Co-authored-by: Kasey Kirkham <[email protected]>

* paranoid underflow protection without error handling (#14044)

Co-authored-by: Kasey Kirkham <[email protected]>

* Electra core transition operations (#14001)

* adding electra operations

* enabling spec tests

* adding electra process epoch

* skipping spec tests for now

* Update testing/spectest/minimal/electra/fork_transition/BUILD.bazel

Co-authored-by: Preston Van Loon <[email protected]>

* fixing naming

* gaz

* fixing more bazel build stuff

---------

Co-authored-by: Preston Van Loon <[email protected]>

* Fix race conditions + cleanup (#14041)

* Fix `CommitteeAssignments` to not return every validator (#14039)

* Rewrite CommitteeAssignments to not return every validator

* Potuz's feedback

* Support electra blob type for by range request (#14047)

Co-authored-by: james-prysm <[email protected]>

* eip-7251: process_effective_balance_updates  (#14003)

* eip-7251: process_effective_balance_updates

Spectests for process_effective_balance_updates

process_effective_balance_updates unit tests

* PR feedback from the amazing @rkapka

---------

Co-authored-by: james-prysm <[email protected]>

* Only log error when aggregator check fails (#14046)

* Only log error when aggregator check fails

* review

* Eip 7549 core (#14037)

* interfaces move

* build fix

* remove annoying warning

* more build fixes

* review

* core code

* tests part 1

* tests part 2

* TranslateParticipation doesn't need Electra

* remove unused function

* pending atts don't need Electra

* tests part 3

* build fixes

* review

* remove newline

* review

* fix test

* Fix dependent root retrival genesis case (#14053)

* Fix dependent root retrival genesis case

* Remove print

* Multiple BN HTTP resolver (#13433)

* http resolver

* Redo

* Revert "Redo"

This reverts commit 5437c44ac26e48c041f5c16f399446c5f72c31a2.

* Revert "http resolver"

This reverts commit 206207b530c30aca13d705db259c6cf738cae533.

* Add host change to ValidatorClient + Validator

* Update mockgen

* Tidy

* Add mock validator

* Update gomock

* Gaz

* Solve interface issues

* Fix host

* Fix test

* Add tests

* Add endpoint change log

* Fix log

* Gen mock

* Fix test

* Fix deepsource

* Lint + deepsource

* Move to healthCheckRoutine

* Fix build errors

* Switch host to string

* Forgot a couple

* Radek' review

* Add PushProposerSettings to goroutine

* Radek' review

* James' review + test fix

* Radek' suggestion

Co-authored-by: Radosław Kapka <[email protected]>

* Check if new node is healthy

* Fix linter errors

* Add host switch logic to ChangeHost

* Lint + comment

* Fix messy merge

* rename ChangeHost to SetHost

* improve log

* remove log

* switch one node

* rename param

---------

Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: rkapka <[email protected]>

* Fix dependent root retrival for first epoch (#14059)

* Restrict Dials From Discovery (#14052)

* Fix Excessive Subnet Dials

* Handle backoff in Iterator

* Slow Down Lookups

* Add Flag To Configure Dials

* Preston's Review

* Update cmd/beacon-chain/flags/base.go

Co-authored-by: Preston Van Loon <[email protected]>

* Reduce polling period

* Manu's Review

---------

Co-authored-by: Preston Van Loon <[email protected]>

* Update Libp2p Dependencies (#14060)

* Update to v0.35.0 and v0.11.0

* Update Protobuf

* Update bazel deps

* api fix for panic on unsynced unfound block (#14063)

* api fix for panic

* adding test

* fixing how we handle the error

* One more validator client cleanup (#14048)

* interface names

* interface method names

* inspection

* regenerate pb and mock

* Revert beacon node changes

* build fix

* review

* more functions

* combine parameters

* Fix mockgen sh (#14068)

* Fix mockgen sh

* Radek's suggestion

Co-authored-by: Radosław Kapka <[email protected]>

* Generate prysm chain client

---------

Co-authored-by: Radosław Kapka <[email protected]>

* EIP-7002:Execution layer triggerable withdrawals (#14031)

* wip fixing 7002 branch

* fixing tests and functions

* fixing linting

* temp fix for transition

* adding unit tests for method

* fixing linting

* partial review from terence

* Update withdrawals.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update beacon-chain/core/electra/withdrawals.go

Co-authored-by: Radosław Kapka <[email protected]>

* addressing feedback

---------

Co-authored-by: Sammy Rosso <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* EIP-7549 gRPC (part 1) (#14055)

* interfaces move

* build fix

* remove annoying warning

* more build fixes

* review

* core code

* tests part 1

* tests part 2

* TranslateParticipation doesn't need Electra

* remove unused function

* pending atts don't need Electra

* tests part 3

* build fixes

* review

* EIP-7549 gRPC part 1

* Organize validator flags (#14028)

* Organize validator flags

* whitespace

* fix comment in test

* remove unneeded flags

* Change It To Debug (#14072)

* Process epoch error to use correct state version (#14069)

* Process epoch error to use correct state version

* Fix return instead

* middleware for content type and accept headers (#14075)

* middleware for content type

* adding accept middleware too and tests

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <[email protected]>

* including radek's review

---------

Co-authored-by: Radosław Kapka <[email protected]>

* always close cache warm chan to prevent blocking (#14080)

* always close cache warm chan to prevent blocking

* test that waitForCache does not block

* combine defers to reduce cognitive overhead

* lint

---------

Co-authored-by: Kasey Kirkham <[email protected]>

* Deprectate `EnableDebugRPCEndpoints` flag (#14015)

* Deprectate `EnableDebugRPCEndpoints` flag

* test fix

* add flag to deprecated list

* disable by default

* test fixes

* Keep only the latest value in the health channel (#14087)

* Increase health tracker channel buffer size

* keep only the latest value

* Make health test blocking as a regression test for PR #14807

* Fix new race conditions in the MockHealthClient

---------

Co-authored-by: Preston Van Loon <[email protected]>

* EIP 7549 spectests (#14027)

* EIP 7549 spectests

* merge fix

* adding in softer check for content type (#14097)

* Delete unused config (#14016)

* Add stub for VerifySignature when build tag blst_disabled is set (#12246)

Co-authored-by: Radosław Kapka <[email protected]>

* Electra: field renames (#14091)

* renaming functions and fields based on consensus changes

* execution api rename

* fixing test

* reverting spectests changes, it should be changed with new version

* reverting temporarily

* revert exclusions

* chore: make deepsource happy (#14081)

* chore(pruner): return error directly

Signed-off-by: jsvisa <[email protected]>

* chore(rpc): unused method receiver

Signed-off-by: jsvisa <[email protected]>

* fix(rpc): use net.JoinHostPort instead of fmt.Sprintf

Signed-off-by: jsvisa <[email protected]>

* chore(amiddleware):use http.NoBody instead of nil

Signed-off-by: jsvisa <[email protected]>

* chore(rpc): rm notused params

Signed-off-by: jsvisa <[email protected]>

* chore(p2p): comment

Signed-off-by: jsvisa <[email protected]>

* feat(db/prune): reduce complexity

Signed-off-by: jsvisa <[email protected]>

* chore(db/pruner): name

Signed-off-by: jsvisa <[email protected]>

* Revert "chore(pruner): return error directly"

This reverts commit d76e745f6045a3ca6e40845e40b2a4bf0bb6ee27.

Signed-off-by: jsvisa <[email protected]>

* revert back pruner.go

Signed-off-by: jsvisa <[email protected]>

---------

Signed-off-by: jsvisa <[email protected]>

* Correcting spelling errors (#14107)

* fix small spelling error

* fix small grammar error

* fix small spelling errors

---------

Co-authored-by: Manu NALEPA <[email protected]>

* proposer settings log ux (#14106)

* adding some logs to improve debugging

* fixing log functions

* Update config/proposer/loader/loader.go

Co-authored-by: Radosław Kapka <[email protected]>

* addressing feedback

---------

Co-authored-by: Radosław Kapka <[email protected]>

* Do not fail production when consensus block value is unavailable (#14111)

* Do not fail production when consensus block value is unavailable

* add log

* use empty string instead of 0

* build fix

* Update github.com/prysmaticlabs/go-bitfield (#14120)

* More tracing in the validator client (#14125)

* More tracing in the validator client

* change context expectation in tests

* ssz: Move stateutil.SliceRoot to ssz package (#14123)

* update codegen dep and cleanup organization (#14127)

Co-authored-by: Kasey Kirkham <[email protected]>

* EIP-7549: p2p and sync (#14085)

* EIP-7549: p2p and sync

* small cleanup

* fuzz fix

* deepsource

* review

* fix ineffectual assignment

* fix pubsub

* update ComputeSubnetForAttestation

* review

* review

* Enable golang.org/x/tools/go/analysis/errorsas static analysis check (#14135)

* Remove electra duplicate helpers (#14138)

* removing duplicate helper functions to reduce 6110 size

* linting

* Prysmctl ui bug (#14140)

* Fix ui bug

* Better logging

* EIP-7549: attestation pool (#14121)

* implementation

* test fixes

* Electra tests

* remove aggregator tests

* id comments and tests

* make Id equal to [33]byte

* updating process deposit function to be more readable and fork specific, breaking out components of pr 13944 (#14139)

* refactor: use go ticker instead of timer (#14134)

Co-authored-by: james-prysm <[email protected]>
Co-authored-by: Sammy Rosso <[email protected]>

* Web3signer: persistent public keys (#13682)

* WIP

* broken and still wip

* more wip improving saving

* wip

* removing cyclic dependency

* gaz

* fixes

* fixing more tests and how files load

* fixing wallet tests

* fixing test

* updating keymanager tests

* improving how the web3signer keymanager works

* WIP

* updated keymanager to read from file

* gaz

* reuse readkeyfile function and add in duplicate keys check

* adding in locks to increase safety

* refactored how saving keys work, more tests needed:

* fix test

* fix tests

* adding unit tests and cleaning up locks

* fixing tests

* tests were not fixed properly

* removing unneeded files

* Update cmd/validator/accounts/wallet_utils.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update validator/accounts/wallet/wallet.go

Co-authored-by: Sammy Rosso <[email protected]>

* review feedback

* updating flags and e2e

* deepsource fix

* resolving feedback

* removing fatal test for now

* addressing manu's feedback

* gofmt

* fixing tests

* fixing unit tests

* more idomatic feedback

* updating log files

* updating based on preston's suggestion

* improving logs and event triggers

* addressing comments from manu

* truncating was not triggering key file reload

* fixing unit test

* removing wrong dependency

* fix another broken unit test

* fixing bad pathing on file

* handle errors in test

* fixing testdata dependency

* resolving deepsource and comment around logs

* removing unneeded buffer

* reworking ux of web3signer file, unit tests to come

* adding unit tests for file change retries

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Sammy Rosso <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Sammy Rosso <[email protected]>

* updating based on review feedback

* missed err check

* adding some aliases to make running easier

* Update validator/keymanager/remote-web3signer/log.go

Co-authored-by: Manu NALEPA <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* radek's review

* Update validator/keymanager/remote-web3signer/internal/client.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* Update validator/keymanager/remote-web3signer/keymanager.go

Co-authored-by: Radosław Kapka <[email protected]>

* addressing more review feedback and linting

* fixing tests

* adding log

* adding 1 more test

* improving logs

---------

Co-authored-by: Sammy Rosso <[email protected]>
Co-authored-by: Manu NALEPA <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* Finalized validator index cache saving (#14146)

* adding logic for saving validator indicies in new cache

* updating index cache for eip6110

* Update setters_misc.go

Co-authored-by: Preston Van Loon <[email protected]>

* linting

---------

Co-authored-by: Preston Van Loon <[email protected]>

* Remove Backoff when Searching for a lot of non-viable peers. Affects peer performance (#14148)

* process_registry_updates without a full copy of the validator set (#14130)

* Avoid copying validator set in ProcessRegistryUpdates

* Fix bug with sortIndices. Thanks to @terencechain for the expert debugging

* removed some internal expired jump targets (#14128)

* Electra v1.5.0-alpha.3 changes: Move consolidations from beacon block body to the execution payload header. (#14152)

* fix: update holesky repository layout (#14057)

* fix: update holesky repository layout

* Update holesky-testnet dependency

---------

Co-authored-by: james-prysm <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>

* Increase attestation seen cache exp time to two epochs (#14156)

* `IndexedAtt` wrapper for the slasher feed (#14150)

* `IndexedAtt` wrapper for the slasher feed

* test fixes

* fix simulator

* fix e2e

* Revert "Auxiliary commit to revert individual files from 191bbf77accfc2523fa9f909837a2e9dca132afa"

This reverts commit 2b0441a23a0e5f66e50cf36c3bbfbb39d587b17b.

* extract interface from channel

* Electra: Properly Calculate Proposer Probabilities for MaxEB (#14010)

* adding small change and tests for max eb spec change

* gaz

---------

Co-authored-by: Preston Van Loon <[email protected]>

* EIP-6110: Supply validator deposits on chain (#13944)

* wip changes

* wip changes refactoring deposit functions

* wip on deposit functions

* wip changes to fix deposit processing

* more wip function logic

* gaz

* wip refactoring deposit changes

* removing circlular dependency and other small fix

* fixing circular dependencies

* fixing validators file

* fixing more tests

* fixing unit tests

* wip deposit packing

* refactoring packing

* changing packing code some more

* fixing packing change

* updating more tests

* removing comment

* fixing transition code for eip6110

* including inserts for validator index cache

* adding tests and placeholder test

* moving deposit related unit tests over

* adding in test for electra proposer packing

* spec test wip

* moving cache saving to the correct spot

* eip-6110: deposit spectests

* adding deposit receipt spec tests

* reverting altair operations in this pr and will be handled separately

* fixing renames but need to refactor process deposits

* gaz

* fixing names

* fixing linting

* fixing unit test

* fixing a test and updating test util

* bal never used

* fixing more tests

* fixing one more test

* addressing feedback

* refactoring process deposits to be part of their own fork instead of in blocks package

* adding new tests to cover functions and removing redundancies

* removing comment based on feedback

* resolving easy deepsource issue

* refactoring for appropriate aliasing and readability

* reverting some changes to simplify diff

* small edit to comment

* fixing linting

* fixing merge changes and review comments

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_deposits.go

Co-authored-by: Preston Van Loon <[email protected]>

* partial review comments

* addressing slack feedback

* moving function from deposits to validator.go

* adding in batch verification and improving logs

---------

Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>

* eip-7251: process_registry_updates (#14005)

* eip-7251: registry_updates

* Fix spectest violation

* More unit tests for process_registry_updates

* Update tests for ProcessRegistryUpdates

* Minor refactorings and benchmark

* Update beacon-chain/core/electra/registry_updates.go

Co-authored-by: Sammy Rosso <[email protected]>

* Wrap errors from process_registry_updates for easier debugging

* Rewrite process_registry_updates not to use st.Validators()

---------

Co-authored-by: Sammy Rosso <[email protected]>

* chore: fix comments (#14149)

fix the typos in the code comments.

* go version upgrade (#14161)

* Update to v1.5.0-alpha.3 spec tests (#14112)

* Update to v1.5.0-alpha.3 spec tests

* Fix deposit request

* Remove todo

* Electra: get_next_sync_committee_indices. (#14164)

* validator/client: process Sync Committee roles separately (#13995)

* validator/client: process Sync Committee roles separately

In a DV context, to be compatible with the proposed selection endpoint, the VC must push all partial selections to it instead of just one.

Process sync committee role separately within the RolesAt method, so that partial selections can be pushed to the DV client appropriately, if configured.

* testing/util: re-add erroneously deleted state_test.go

* validator/client: fix tests

* validator/client: always process sync committee validator

Process sync committee duty at slot boundary as well.

* don't fail if validator is marked as sync committee but it is not in the list

ignore the duty and continue

* address code review comments

* fix build

---------

Co-authored-by: Radosław Kapka <[email protected]>

* EIP-7549: Aggregation gRPC metods (#14115)

* impl

* tests

* generate mock

* review feedback

* gofmt

* use underscore to signify that it is not being used (#14162)

Co-authored-by: Sammy Rosso <[email protected]>

* Update to Go v1.22 (#13965)

* Bump go version up

* Update to go 1.22 compatible version

* Fix NoSec declarations

* Skip Gosec in GolangCi

* Avoid Bug In Analyzer

* Add in Gohashtree and Update to 1.22.4

* Fix Go Sum

* Electra: new `process_consolidation_request` (#14163)

* Electra: process_consolidation_request

* Enable consolidation_request spectests

* Electra: Unskip passing spectests at v1.5.0-alpha.3 (#14175)

* Electra: Unskip state-native tests for spectest v1.5.0-alpha.3 (#14174)

* Fix slasher disk usage leak. (#14151)

* `PruneProposalsAtEpoch`: Test return value in case of nothing to prune.

* `TestStore_PruneAttestations_OK`: Create unique validator indexes.

Before this commit, `attester2` for `j = n` was the same than
`attester1` for `j = n + 1`, resulting in erasure of a lot of attesters.

I guess it was not the initial intent.

* Slasher pruning: Check if the number of pruned items corresponds to the expectation.

Before this commit, if the pruning function did remove a superset
of the expected pruned items (including all the items), then the test would pass.

* Prune items that should be pruned and stop pruning items that should not be pruned.

The first 8 bytes of the key of `attestation-data-roots` and
`proposal-records` bytes correspond respectively to an encoded epoch and
and encoded slot.

The important word in this sentence is "encoded".
Before this commit, these slot/epoch are SSZ encoded, which means that
they are little-endian encoded.

However:
- `uint64PrefixGreaterThan` uses `bytes.Compare` which expects
   big-endian encoded values.
- `for k, _ := c.First(); k != nil; k, _ = c.Next()` iters over the
  keys in big-endian order.

The consequence is:
- Some items that should be pruned are not pruned, provoking a disk
  usage leak.
- Some items that should not be pruned are pruned, provoking errors like
  in https://github.com/prysmaticlabs/prysm/issues/13658.

This commit encodes the slot/epoch as big-endian before storing them in
the database keys.

Why this bug has not been detected in unit test before?

The values used in unit tests before this commit in
`TestStore_PruneProposalsAtEpoch` and `TestStore_PruneAttestations_OK`
are `10` and `20`.
Unfortunately, checking if `littleEndian(20) > littlenEndien(10)`
with the `>` operator considering operands as big-endian encoded returns
the expected result...

Just replacing `20` by `30` trigs the bug.

* Make deepsource happy.

* Slasher: Migrate database from little-endian to big-endian.

* Update beacon-chain/slasher/service.go

Co-authored-by: Preston Van Loon <[email protected]>

* Update beacon-chain/db/slasherkv/migrate.go

Co-authored-by: Preston Van Loon <[email protected]>

* `TestMigrate`: Fix documentation.

---------

Co-authored-by: Preston Van Loon <[email protected]>

* refactor: enable errorlint and refactor code (#14110)

* refactor: enable errorlint and refactor code

* revert

* revert

* add bazel

* gofmt

* gofmt

* gofmt

* gofmt

* gci

* lint

---------

Co-authored-by: Radosław Kapka <[email protected]>

* Update Libp2p (#14192)

* Add Aggregated Public Key Method (#14178)

* Add aggregated key method

* Gazelle

* Manu's Review

* Electra: EIP-7251 update `process_pending_balance_deposits` (#14177)

* EIP-7251: Implement changes from https://github.com/ethereum/consensus-specs/pull/3776

* Unskip epoch processing spectest

* EIP-7251: unit tests for logic in https://github.com/ethereum/consensus-specs/pull/3776

* Radek feedback

* copy just the pointer in the votes loop (#14196)

* Optimize ProcessRegistryUpdates Further (#14197)

* Add it in

* Clean it Up

* Electra: EIP-7251 Update `process_voluntary_exit` (#14176)

* Electra: EIP-7251 Update `process_voluntary_exit`

* Add unit test for VerifyExitAndSignature EIP-7251

* @potuz peer feedback

* Avoid Cloning When Creating a New Gossip Message (#14201)

* Add Current Changes

* add back check

* Avoid a Panic

* fix: Multiple network flags should prevent the BN to start (#14169)

* Implement Initial Logic

* Include check in main.go

* Add tests for multiple flags

* remove usage of append

* remove config/features dependency

* Move ValidateNetworkFlags to config/features

* Nit

* removed NetworkFlags from cmd

* remove usage of empty string literal

* add comment

* add flag validation to prysctl validator-exit

---------

Co-authored-by: Manu NALEPA <[email protected]>

* EIP-7549: validator client (#14158)

* EIP-7549: validator client

* server code

* tests

* build fix

* review

* remove context

* Revert "Auxiliary commit to revert individual files from 16fed79a1ae0bbe4a08cb9819c2785d6e34958dd"

This reverts commit f59e1459f3f7561e0483bc8542110794951585c5.

* State: HasPendingBalanceToWithdraw (#14200)

* Implement HasPendingBalanceToWithdraw to improve the best / average case lookup

* Add tests for HasPendingBalanceToWithdraw

* adding electra version to payload attribute event (#14212)

* EIP-7549: Allow multiple committee bits (#14203)

* Fix Merkle proof generator for Electra (#14211)

* Electra: Forkchoice spectest fix (#14180)

* Electra: EIP-7251 implement process_withdrawal updates (#14181)

* Electra: EIP-7251 implement process_withdrawal updates

* Unit tests for new process_withdrawal logic in electra

* Remove warning eip_7251.proto is unused (#14213)

* Fix effective balance updates in Electra (#14215)

* Electra: ProcessConsolidationRequests (#14219)

* Electra: process_registry_updates handle exiting validators (#14221)

* Handle case where validator is already exited

* unit test for a slashed validator

* Unskip electra spectests (#14220)

* Electra: Add minimal spectests for sync_committee_updates (#14224)

* Payload attributes misleading value fix (#14209)

* draft solution to corrected suggested fee recipient

* removing electra from this PR

* gaz

* adding test for endpoint

* gaz

* Add missing pieces of Electra (#14227)

* Add missing pieces of Electra

* update mock

* adding consolidation requests to json serialization (#14229)

* adding consolidation requests to json serialization

* fixing test

* missed file checkin

* fixing unit tests

* Fix typo (#14233)

* electra payload fix for devnet1 (#14235)

* fixing marshalling and adding more to unit test

* updating missed consolidation requests

* renaming variables

* adding test gen

* reverting config change

* removing unused naming convention (#14241)

* Remove electra todo for process deposit requests (#14243)

* GetValidatorPerformance empty body bug (#14240)

* fix possible empty body panic bug

* gaz

* fix test

* HTTP endpoint `GetIndividualVotes` (#14198)

* add http endpoint

* add tests

* Gaz

* Add pointers

* add endpoint to test

* Electra: EIP-7251 Update `process_voluntary_exit` (#14176)

* Electra: EIP-7251 Update `process_voluntary_exit`

* Add unit test for VerifyExitAndSignature EIP-7251

* @potuz peer feedback

* Avoid Cloning When Creating a New Gossip Message (#14201)

* Add Current Changes

* add back check

* Avoid a Panic

* fix: Multiple network flags should prevent the BN to start (#14169)

* Implement Initial Logic

* Include check in main.go

* Add tests for multiple flags

* remove usage of append

* remove config/features dependency

* Move ValidateNetworkFlags to config/features

* Nit

* removed NetworkFlags from cmd

* remove usage of empty string literal

* add comment

* add flag validation to prysctl validator-exit

---------

Co-authored-by: Manu NALEPA <[email protected]>

* fix tests

* Radek' review + tests

* fix tests

* Radek' review

* forgot one

* almost forgot the tests

---------

Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: Nishant Das <[email protected]>
Co-authored-by: kira <[email protected]>
Co-authored-by: Manu NALEPA <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* EIP-7549: Attestation packing (#14238)

* EIP-7549: Attestation packing

* new files

* change var name

* test fixes

* enhance comment

* unit test for Deneb state

* payload electra cloning (#14239)

* poc for payload electra cloning

* partial fixes

* fixing build

* addressing kasey's comment

* forgot to unexport interface

* making test more generic

* making fuzzing slightly more robust

* renaming based on kasey's comment

* using fuzz test in same package to avoid exporting interface

* fixing build

* chore: fix comment for struct field (#14218)

Signed-off-by: stellrust <[email protected]>
Co-authored-by: terence <[email protected]>

* creating execution payload copy and fuzz tests (#14246)

* creating execution payload copy and fuzz tests

* fixing build

* removing unused code

* remove eip6110flag for validator index cache (#14173)

* using fork instead of eip6110flag for validator index cache

* updating validator indicies on initialize from poroto unsafe

* fixing bad version check

* attempting to fix unit test

* reverting test changes

* changing incorrect initialization

* updating comment

* radek's comment'

* moving cloners to attestation.go and adding fuzzing (#14254)

* moving cloners to attestation.go and adding fuzzing

* fixing bazel

* fixing build

* moving cloners to beacon_block.go and adding fuzzing (#14255)

* moving beacon block fields from cloners to individual files and adding fuzzing tests

* adding missed tests

* fixing tests:

* removing deep not equals for now

* adding clarifying comment

* feat: implement ``is_better_update`` for light client (#14186)

* feat: implement ``is_better_update`` for light client

* replace ``!=`` with ``!reflect.DeepEqual``

* chore: import constant instead of redeclaring and some minor fixes

* feat: add test for ``newHasSupermajority != oldHasSupermajority``

* chore: capitalise first letter of function names

* refactor: rewrite test setups in a more readable manner

* two test cases

* feat: add tests for ``IsBetterUpdate``

* refactor: remove double import

* wording fix 1

Co-authored-by: Radosław Kapka <[email protected]>

* wording fix 2

Co-authored-by: Radosław Kapka <[email protected]>

* minor fixes

* fix: change function names to lowercase and fix dependencies

---------

Co-authored-by: rkapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* Remove no deposit requests found debug log (#14257)

* Fix: Adjust fieldRefCount for capella, deneb, electra (#14252)

Co-authored-by: Radosław Kapka <[email protected]>

* Proposer: filter attestations for invalid signature (#14225)

* Proposer: filter attestations for invalid signature

* Nishant's feedback

Co-authored-by: Nishant Das <[email protected]>

* Add more checks based on potuz's feedback

* Fix filter by fork choice conditions

* Potuz's feedback

* Pass in epoch

* Potuz feedback 2

* Fix test

---------

Co-authored-by: Nishant Das <[email protected]>

* Fix Event stream with carriage return support (#14250)

* fix: event stream with carriage return

* lint: bazel

---------

Co-authored-by: james-prysm <[email protected]>

* moving cloner functions to beacon_block.go (#14265)

* moving cloner functions for beacon block and adding fuzzing tests

* fixing test

* Push proposer settings every slot (#14155)

* test push settings every slot

* updating comments

* changing design a little bit based on feedback

* adding corrected deadline

* missed adding electra process epoch on state replay - devnet 1 (#14272)

* missed adding electra process epoch on state replay

* abstracting common functionality as to not forget in processing

* removing unnessesary error check

* breaking out core process slots logic out

* fixing small bug in epoch processing

* adding small log to fix linting and make use of logrus in the package

* adding some unit tests for process epoch

* potuz's review feedback

* reversing processing order based on feedback

* adding corrected returns under handle error (#14280)

* chore: fix some comments (#14270)

Signed-off-by: shangchengbabaiban <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* chore: fix unfound image (#14167)

* Remove Feature Flag From Prater (#12082)

* Use Epoch boundary cache to retrieve balances (#12083)

* Use Epoch boundary cache to retrieve balances

* save boundary states before inserting to forkchoice

* move up last block save

* remove boundary checks on balances

* fix ordering

---------

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>

* chore: fix unfound image

* fix link

---------

Co-authored-by: Nishant Das <[email protected]>
Co-authored-by: Potuz <[email protected]>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* Get all beacon committees at once (#14282)

* Get all beacon committees at once

* Update beacon-chain/core/helpers/beacon_committee.go

---------

Co-authored-by: Radosław Kapka <[email protected]>

* Refactor CommitteeAssignments to get all committees at once (#14284)

* removing explicit deadlines on push proposer settings (#14285)

* removing deadlines

* fixing mock interface implementation

* Use the beacon block root to verify the prestate (#14290)

* Committee-aware attestation packing (#14245)

* initial algorithm

* ready for review

* feature flag

* typo

* review

* comment fix

* fix TestProposer_sort_DifferentCommittees

* flag usage

* HTTP endpoint for `GetValidatorParticipation` (#14261)

* add endpoint

* remove canonicalFetcher

* Add replayerBuilder to coreService

* fix endpoint template

* fix string query params

* gaz

* fix linter

* test fix

* Radek' review

* remove unused request struct + gaz

* linter

* gaz

---------

Co-authored-by: rkapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>

* process Electra operations in the right order (#14294)

* process Electra operations in the right order

* godoc

* Return parent root from forkchoice (#14293)

* fix(tests): Correct misleading variable names and expressions in test files (#14292)

Co-authored-by: Radosław Kapka <[email protected]>

* remove broken link (#14291)

Co-authored-by: Radosław Kapka <[email protected]>

* HTTP endpoint for  `GetChainHead` (#14262)

* add getChainHead endpoint

* James' review

* Radek' review

---------

Co-authored-by: Radosław Kapka <[email protected]>

* Reduce cognitive complexity of ReceiveBlock (#14296)

* Reduce cognitive complexity of ReceiveBlock

* Remove stray line

Co-authored-by: terence <[email protected]>

---------

Co-authored-by: terence <[email protected]>

* Check locally for min-bid and min-bid-difference (#14205)

* Check locally for min-bid and min-bid-difference

* fix tests

* Terence's fix

Co-authored-by: terence <[email protected]>

* Terence's review

* fix tests

---------

Co-authored-by: terence <[email protected]>

* HTTP endpoint for `GetValidatorActiveSetChanges` (#14264)

* add GetValidatorActiveSetChanges

* fix linter

* fix errors

* James' review

* use stater

* fix merge conflict errors

* remove validator from func names

* rename util funcs

* engine_getPayloadBodiesByRangeV1 - fix, adding hexutil encoding on request parameters (#14314)

* adding hexutil encoding on request parameters

* fix for test

* fixing more tests

* deepsource fix

* Clean up: Deduplicate fork spec tests pasta (#14289)

* Deduplicate code in spectest operations

Deduplicate code in blockchain core packages.

* Deduplicate code in blockchain core packages.

* Fix state upgrade log (#14316)

* Move slasher handling down the pipeline (#14322)

* Fix typo

* Remove redundant

* Add bailout in beacon block proto

* Add electra fork epoch for testnet/under config

* Run mockgen

* Run update-go-pbs

* Run update-go-ssz.sh

* Run gazelle

* Remove spectest

* Go mod tidy

* Fix InitiateValidatorExit

* Add bailout to Electra state

* Fix lint issues

* Fix proto/prysm/v1alpha1 BUILD.bazel

* Fix electra transition: replace to bailout score update method

* Add Electra state proto

* Run update-go-pbs/ssz

* Make validator client build

* Fix lint issues

* Fix mainnet config values

* Merge to pectra-devnet-3

* Fix config: add genesis validators root

* Fix electra beacon block body and state: add over things

* Gofmt

* Delete web handler in validator

* Remove CHANGELOG

* electra upgrade support

* Delete pb.gw.go files

* Fix state initialization: might resolve multi value issue of bail out

* Add Electra case for GetBeaconStateV2

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: stellrust <[email protected]>
Signed-off-by: shangchengbabaiban <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: terence <[email protected]>
Co-authored-by: Manu NALEPA <[email protected]>
Co-authored-by: Sammy Rosso <[email protected]>
Co-authored-by: rkapka <[email protected]>
Co-authored-by: james-prysm <[email protected]>
Co-authored-by: kasey <[email protected]>
Co-authored-by: Kasey Kirkham <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Preston Van Loon <[email protected]>
Co-authored-by: james-prysm <[email protected]>
Co-authored-by: Nishant Das <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brandon Liu <[email protected]>
Co-authored-by: Bhargava Shastry <[email protected]>
Co-authored-by: Patrice Vignola <[email protected]>
Co-authored-by: Delweng <[email protected]>
Co-authored-by: sam (jgscripts) <[email protected]>
Co-authored-by: Khanh Hoa <[email protected]>
Co-authored-by: vickkkkkyy <[email protected]>
Co-authored-by: Barnabas Busa <[email protected]>
Co-authored-by: Afanti <[email protected]>
Co-authored-by: Brindrajsinh Chauhan <[email protected]>
Co-authored-by: Gianguido Sorà <[email protected]>
Co-authored-by: kevaundray <[email protected]>
Co-authored-by: Potuz <[email protected]>
Co-authored-by: kira <[email protected]>
Co-authored-by: stellrust <[email protected]>
Co-authored-by: Rupam Dey <[email protected]>
Co-authored-by: John <[email protected]>
Co-authored-by: Samuel VIDEAU <[email protected]>
Co-authored-by: shangchengbabaiban <[email protected]>
Co-authored-by: ethfanWilliam <[email protected]>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Jay <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 945 changed files with 60,795 additions and 26,995 deletions.
2 changes: 1 addition & 1 deletion .github/actions/gomodtidy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:alpine
FROM golang:1.22-alpine

COPY entrypoint.sh /entrypoint.sh

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.5'
go-version: '1.22.3'
- id: list
uses: shogo82148/actions-go-fuzz/list@v0
with:
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.5'
go-version: '1.22.3'
- uses: shogo82148/actions-go-fuzz/run@v0
with:
packages: ${{ matrix.package }}
Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: Go

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ '*' ]
merge_group:
types: [checks_requested]
branches: ["*"]

jobs:
formatting:
Expand All @@ -28,15 +26,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go 1.21.5
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
cache: false
go-version: "1.22.6"
- name: Run Gosec Security Scanner
run: | # https://github.com/securego/gosec/issues/469
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/securego/gosec/v2/cmd/gosec@v2.15.0
go install github.com/securego/gosec/v2/cmd/gosec@v2.19.0
gosec -exclude-generated -exclude=G307 -exclude-dir=crypto/bls/herumi ./...
lint:
Expand All @@ -46,10 +43,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.21.5
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
go-version: "1.22.6"
id: go

- name: Golangci-lint
Expand All @@ -65,7 +62,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
go-version: "1.22.6"
id: go

- name: Check out code into the Go module directory
Expand All @@ -79,14 +76,13 @@ jobs:
# Use blst tag to allow go and bazel builds for blst.
run: go build -v ./...
env:
CGO_CFLAGS: "-O2 -D__BLST_PORTABLE__"
CGO_CFLAGS: "-O2 -D__BLST_PORTABLE__"
# fuzz leverage go tag based stubs at compile time.
# Building and testing with these tags should be checked and enforced at pre-submit.
- name: Test for fuzzing
run: go test -tags=fuzz,develop ./... -test.run=^Fuzz
env:
CGO_CFLAGS: "-O2 -D__BLST_PORTABLE__"

# Tests run via Bazel for now...
CGO_CFLAGS: "-O2 -D__BLST_PORTABLE__"
# # Tests run via Bazel for now...
# - name: Test
# run: go test -v ./...
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
- proto
- tools/analyzers
timeout: 10m
go: '1.21.5'
go: '1.22.6'

linters:
enable-all: true
Expand Down Expand Up @@ -34,7 +34,6 @@ linters:
- dogsled
- dupl
- durationcheck
- errorlint
- exhaustive
- exhaustruct
- forbidigo
Expand All @@ -52,6 +51,7 @@ linters:
- gofumpt
- gomnd
- gomoddirectives
- gosec
- inamedparam
- interfacebloat
- ireturn
Expand Down
8 changes: 1 addition & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ alias(
visibility = ["//visibility:public"],
)

# Protobuf gRPC gateway compiler
alias(
name = "grpc_gateway_proto_compiler",
actual = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
visibility = ["//visibility:public"],
)

gometalinter(
name = "gometalinter",
config = "//:.gometalinter.json",
Expand Down Expand Up @@ -224,6 +217,7 @@ nogo(
"@org_golang_x_tools//go/analysis/passes/deepequalerrors:go_default_library",
"@org_golang_x_tools//go/analysis/passes/defers:go_default_library",
"@org_golang_x_tools//go/analysis/passes/directive:go_default_library",
"@org_golang_x_tools//go/analysis/passes/errorsas:go_default_library",
# fieldalignment disabled
#"@org_golang_x_tools//go/analysis/passes/fieldalignment:go_default_library",
"@org_golang_x_tools//go/analysis/passes/findcall:go_default_library",
Expand Down
20 changes: 10 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
go_rules_dependencies()

go_register_toolchains(
go_version = "1.21.8",
go_version = "1.22.4",
nogo = "@//:nogo",
)

Expand Down Expand Up @@ -227,7 +227,7 @@ filegroup(
url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz",
)

consensus_spec_version = "v1.4.0"
consensus_spec_version = "v1.5.0-alpha.5"

bls_test_version = "v0.1.1"

Expand All @@ -243,7 +243,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "c282c0f86f23f3d2e0f71f5975769a4077e62a7e3c7382a16bd26a7e589811a0",
integrity = "sha256-R9vG5HEL5eGMOAmbkKfJ2jfelNqL5V0xBUPiXOiGM6U=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version,
)

Expand All @@ -259,7 +259,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "4649c35aa3b8eb0cfdc81bee7c05649f90ef36bede5b0513e1f2e8baf37d6033",
integrity = "sha256-AEIiEOlf1XuxoRMCsN+kgJMo4LrS05+biTA1p/7Ro00=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version,
)

Expand All @@ -275,7 +275,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "c5a03f724f757456ffaabd2a899992a71d2baf45ee4db65ca3518f2b7ee928c8",
integrity = "sha256-LH/Xr20yrJRYnbpjRGupMWTIOWt3cpxZJWXgThwVDsk=",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version,
)

Expand All @@ -290,7 +290,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "cd1c9d97baccbdde1d2454a7dceb8c6c61192a3b581eee12ffc94969f2db8453",
integrity = "sha256-mlytz4MPjKh0DwV7FMiAtnRbJw9B6o78/x66/vmnYc8=",
strip_prefix = "consensus-specs-" + consensus_spec_version[1:],
url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version,
)
Expand Down Expand Up @@ -332,14 +332,14 @@ http_archive(
filegroup(
name = "configs",
srcs = [
"custom_config_data/config.yaml",
"metadata/config.yaml",
],
visibility = ["//visibility:public"],
)
""",
sha256 = "5f4be6fd088683ea9db45c863b9c5a1884422449e5b59fd2d561d3ba0f73ffd9",
strip_prefix = "holesky-9d9aabf2d4de51334ee5fed6c79a4d55097d1a43",
url = "https://github.com/eth-clients/holesky/archive/9d9aabf2d4de51334ee5fed6c79a4d55097d1a43.tar.gz", # 2024-01-22
integrity = "sha256-b7ZTT+olF+VXEJYNTV5jggNtCkt9dOejm1i2VE+zy+0=",
strip_prefix = "holesky-874c199423ccd180607320c38cbaca05d9a1573a",
url = "https://github.com/eth-clients/holesky/archive/874c199423ccd180607320c38cbaca05d9a1573a.tar.gz", # 2024-06-18
)

http_archive(
Expand Down
14 changes: 6 additions & 8 deletions api/client/beacon/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@ import (
"net/http"
"testing"

"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/api/client"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
blocktest "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks/testing"
"github.com/prysmaticlabs/prysm/v5/network/forks"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/prysmaticlabs/prysm/v5/time/slots"

"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/ssz/detect"
"github.com/prysmaticlabs/prysm/v5/network/forks"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/runtime/version"

"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/prysmaticlabs/prysm/v5/time/slots"
)

type testRT struct {
Expand Down
6 changes: 5 additions & 1 deletion api/client/builder/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/v5/api/client/builder",
visibility = ["//visibility:public"],
deps = [
"//api:go_default_library",
"//api/server/structs:go_default_library",
"//config/fieldparams:go_default_library",
"//consensus-types:go_default_library",
Expand All @@ -20,14 +21,15 @@ go_library(
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//monitoring/tracing:go_default_library",
"//monitoring/tracing/trace:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/version:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prysmaticlabs_fastssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_opencensus_go//trace:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
)

Expand All @@ -49,9 +51,11 @@ go_test(
"//math:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/version:go_default_library",
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
],
Expand Down
19 changes: 10 additions & 9 deletions api/client/builder/bid.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
consensus_types "github.com/prysmaticlabs/prysm/v5/consensus-types"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/runtime/version"
)
Expand All @@ -22,7 +23,7 @@ type SignedBid interface {
type Bid interface {
Header() (interfaces.ExecutionData, error)
BlobKzgCommitments() ([][]byte, error)
Value() []byte
Value() primitives.Wei
Pubkey() []byte
Version() int
IsNil() bool
Expand Down Expand Up @@ -125,8 +126,8 @@ func (b builderBid) Version() int {
}

// Value --
func (b builderBid) Value() []byte {
return b.p.Value
func (b builderBid) Value() primitives.Wei {
return primitives.LittleEndianBytesToWei(b.p.Value)
}

// Pubkey --
Expand Down Expand Up @@ -165,7 +166,7 @@ func WrappedBuilderBidCapella(p *ethpb.BuilderBidCapella) (Bid, error) {
// Header returns the execution data interface.
func (b builderBidCapella) Header() (interfaces.ExecutionData, error) {
// We have to convert big endian to little endian because the value is coming from the execution layer.
return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, blocks.PayloadValueToWei(b.p.Value))
return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header)
}

// BlobKzgCommitments --
Expand All @@ -179,8 +180,8 @@ func (b builderBidCapella) Version() int {
}

// Value --
func (b builderBidCapella) Value() []byte {
return b.p.Value
func (b builderBidCapella) Value() primitives.Wei {
return primitives.LittleEndianBytesToWei(b.p.Value)
}

// Pubkey --
Expand Down Expand Up @@ -222,8 +223,8 @@ func (b builderBidDeneb) Version() int {
}

// Value --
func (b builderBidDeneb) Value() []byte {
return b.p.Value
func (b builderBidDeneb) Value() primitives.Wei {
return primitives.LittleEndianBytesToWei(b.p.Value)
}

// Pubkey --
Expand All @@ -249,7 +250,7 @@ func (b builderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) error {
// Header --
func (b builderBidDeneb) Header() (interfaces.ExecutionData, error) {
// We have to convert big endian to little endian because the value is coming from the execution layer.
return blocks.WrappedExecutionPayloadHeaderDeneb(b.p.Header, blocks.PayloadValueToWei(b.p.Value))
return blocks.WrappedExecutionPayloadHeaderDeneb(b.p.Header)
}

// BlobKzgCommitments --
Expand Down
Loading

0 comments on commit 7cfea26

Please sign in to comment.