Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle top-ups to exiting/exited validators #3776

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

fradamt
Copy link
Contributor

@fradamt fradamt commented May 22, 2024

This PR does the same thing as #3650, which was based on the EIP-7251 spec. Meanwhile, the rationale for it has evolved somewhat, with the realization that it is actually more security-critical than previously realized understood. An attacker can do the following:

  1. Initiate a validator’s exit
  2. Make a top-up while the validator is still exiting
  3. The top-up happens before the exit
  4. Once the validator exits, the topped-up balance leaves the validator set without going through the churn

This can lead to churn limit invariants being violated, even though top-ups go through the deposit churn. The reason for this is subtle: the top-ups can go through the deposit churn slowly, over a long period of time, but the same balance can then exit much faster. For example, say the exit queue is one week long, while the activation queue is completely empty, and an attacker executes the strategy above, exiting validators with minimum balance and topping them up to max balance. Because of the exit queue being full, the large top-ups have one whole week to go through the deposit churn and be processed. Moreover, all exits happen very fast once the week is over, because the validators had minimum balance when the exits were initiated, and so the exits are scheduled very close to each other. The end result is that a bunch of very large exits all happen in a short period of time.

More details in this section of the WIP annotated spec

@fradamt fradamt changed the title handle top-ups to exiting/exited validators Handle top-ups to exiting/exited validators May 22, 2024
@ralexstokes ralexstokes added scope:security General protocol security-related items Electra labels May 22, 2024
Copy link
Contributor

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

@hwwhww hwwhww mentioned this pull request Jun 4, 2024
10 tasks
@hwwhww hwwhww merged commit 5efd6e1 into ethereum:dev Jun 5, 2024
26 checks passed
@michaelsproul
Copy link
Contributor

michaelsproul commented Jun 24, 2024

It seems this change is necessary for security, but I just wanted to note that it probably has a detrimental impact on the performance of Lighthouse's single-pass epoch processing.

Previously, process_pending_balance_deposits did not depend on state.validators, which allowed us to use the following algorithm:

  1. Loop through pending_balance_deposits and collect applicable deposits into a hashmap
  2. Loop (once) through state.validators and for each index apply all deposits (from the hashmap) for that index

Now we are forced to add random-access in step 1 to load validators and check their exit_epoch and withdrawable_epoch. This is probably acceptable because the length of pending_balance_deposits is not enormous, but I thought I'd just note the sorts of implementation challenges that spec changes like this present.

@mkalinin
Copy link
Collaborator

@michaelsproul thanks for raising this performance point, I am currently working on the set of changes to the eip6110 that was agreed during Nyota (#3689 (comment)).

Those changes leverage on and extend pending_balance_deposits to keep full deposits and do full deposit processing including sig verification and new validator creation, so it involves reads and modifications to the state.validators. One of the points that we have agreed is to limit a number of deposits that can be processed during one pass. Although, it is already limited by the churn.

@michaelsproul
Copy link
Contributor

Thanks for the update @mkalinin, I had not been following!

A short queue of deposits that we can process with random access sounds fine

prestonvanloon added a commit to prysmaticlabs/prysm that referenced this pull request Jul 3, 2024
prestonvanloon added a commit to prysmaticlabs/prysm that referenced this pull request Jul 3, 2024
prestonvanloon added a commit to prysmaticlabs/prysm that referenced this pull request Jul 3, 2024
prestonvanloon added a commit to prysmaticlabs/prysm that referenced this pull request Jul 3, 2024
github-merge-queue bot pushed a commit to prysmaticlabs/prysm that referenced this pull request Jul 8, 2024
* EIP-7251: Implement changes from ethereum/consensus-specs#3776

* Unskip epoch processing spectest

* EIP-7251: unit tests for logic in ethereum/consensus-specs#3776

* Radek feedback
syjn99 added a commit to overprotocol/chronos that referenced this pull request Sep 24, 2024
* 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 <radoslaw.kapka@gmail.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>

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

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>

* 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 <terence@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>

* 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 <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update api/client/builder/client.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Radek review

* fix error message

* deal with wonky builder responses

* :scissors:

* gaz

* lint

* tweaks for deep source

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <kasey@users.noreply.github.com>

* 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 <90280386+james-prysm@users.noreply.github.com>

* 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] <support@github.com>
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 <pvanloon@offchainlabs.com>

* 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 <rkapka@wp.pl>

* Update testing/util/electra_state.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update testing/util/electra_state.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing feedback

* removing deepsoure ignore comments

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <90280386+james-prysm@users.noreply.github.com>

* 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 <15244892+saolyn@users.noreply.github.com>

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

This reverts commit 6a4be3bae5b4ec99d3470d3459acb032b9ad78f4.

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* 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 <kasey@users.noreply.github.com>

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

tests for compute_consolidation_epoch_and_update_churn

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>

* 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 <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Move consolidation limit check outside of the loop

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <rkapka@wp.pl>

* 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 <rkapka@wp.pl>

* Electra payload body engine methods (#14000)

* Combined v1/v2 payload body handling

* prevent overflows when dealing with electra fixture

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>

* Remove Beacon API Postman collection (#14014)

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

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>

* 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 <kasey@users.noreply.github.com>

* 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 <kasey@users.noreply.github.com>

* paranoid underflow protection without error handling (#14044)

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>

* 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 <pvanloon@offchainlabs.com>

* fixing naming

* gaz

* fixing more bazel build stuff

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <90280386+james-prysm@users.noreply.github.com>

* 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 <90280386+james-prysm@users.noreply.github.com>

* 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 <rkapka@wp.pl>

* 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 <rkapka@wp.pl>
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>

* 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 <pvanloon@offchainlabs.com>

* Reduce polling period

* Manu's Review

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <rkapka@wp.pl>

* Generate prysm chain client

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <15244892+saolyn@users.noreply.github.com>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing feedback

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <rkapka@wp.pl>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update beacon-chain/rpc/endpoints.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* including radek's review

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <kasey@users.noreply.github.com>

* 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 <preston@pvl.dev>

* 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 <rkapka@wp.pl>

* 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 <delweng@gmail.com>

* chore(rpc): unused method receiver

Signed-off-by: jsvisa <delweng@gmail.com>

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

Signed-off-by: jsvisa <delweng@gmail.com>

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

Signed-off-by: jsvisa <delweng@gmail.com>

* chore(rpc): rm notused params

Signed-off-by: jsvisa <delweng@gmail.com>

* chore(p2p): comment

Signed-off-by: jsvisa <delweng@gmail.com>

* feat(db/prune): reduce complexity

Signed-off-by: jsvisa <delweng@gmail.com>

* chore(db/pruner): name

Signed-off-by: jsvisa <delweng@gmail.com>

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

This reverts commit d76e745f6045a3ca6e40845e40b2a4bf0bb6ee27.

Signed-off-by: jsvisa <delweng@gmail.com>

* revert back pruner.go

Signed-off-by: jsvisa <delweng@gmail.com>

---------

Signed-off-by: jsvisa <delweng@gmail.com>

* Correcting spelling errors (#14107)

* fix small spelling error

* fix small grammar error

* fix small spelling errors

---------

Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>

* 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 <rkapka@wp.pl>

* addressing feedback

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <kasey@users.noreply.github.com>

* 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 <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* 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 <15244892+saolyn@users.noreply.github.com>

* Update validator/accounts/wallet/wallet.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* 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 <15244892+saolyn@users.noreply.github.com>

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

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

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

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* 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 <enalepa@offchainlabs.com>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* radek's review

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing more review feedback and linting

* fixing tests

* adding log

* adding 1 more test

* improving logs

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <pvanloon@offchainlabs.com>

* linting

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>

* 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 <pvanloon@offchainlabs.com>

* 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 <pvanloon@offchainlabs.com>

* 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 <preston@pvl.dev>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <15244892+saolyn@users.noreply.github.com>

* Wrap errors from process_registry_updates for easier debugging

* Rewrite process_registry_updates not to use st.Validators()

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* 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 <rkapka@wp.pl>

* 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 <15244892+saolyn@users.noreply.github.com>

* 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 <pvanloon@offchainlabs.com>

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

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* `TestMigrate`: Fix documentation.

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* 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 <rkapka@wp.pl>

* 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 <enalepa@offchainlabs.com>

* 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 <enalepa@offchainlabs.com>

* fix tests

* Radek' review + tests

* fix tests

* Radek' review

* forgot one

* almost forgot the tests

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: kira <shyampkira@gmail.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <gohunter@foxmail.com>
Co-authored-by: terence <terence@prysmaticlabs.com>

* 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 <radoslaw.kapka@gmail.com>

* wording fix 2

Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>

* minor fixes

* fix: change function names to lowercase and fix dependencies

---------

Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

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

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

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

* Proposer: filter attestations for invalid signature

* Nishant's feedback

Co-authored-by: Nishant Das <nishdas93@gmail.com>

* 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 <nishdas93@gmail.com>

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

* fix: event stream with carriage return

* lint: bazel

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>

* 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 <shuang.cui@live.cn>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <nishdas93@gmail.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <rkapka@wp.pl>

* 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 <radoslaw.kapka@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* 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 <rkapka@wp.pl>

* remove broken link (#14291)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* HTTP endpoint for  `GetChainHead` (#14262)

* add getChainHead endpoint

* James' review

* Radek' review

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Reduce cognitive complexity of ReceiveBlock (#14296)

* Reduce cognitive complexity of ReceiveBlock

* Remove stray line

Co-authored-by: terence <terence@prysmaticlabs.com>

---------

Co-authored-by: terence <terence@prysmaticlabs.com>

* 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 <terence@prysmaticlabs.com>

* Terence's review

* fix tests

---------

Co-authored-by: terence <terence@prysmaticlabs.com>

* 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] <support@github.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: stellrust <gohunter@foxmail.com>
Signed-off-by: shangchengbabaiban <shuang.cui@live.cn>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: terence <terence@prysmaticlabs.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>
Co-authored-by: kasey <489222+kasey@users.noreply.github.com>
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brandon Liu <lzqcn2000@126.com>
Co-authored-by: Bhargava Shastry <bshastry@ethereum.org>
Co-authored-by: Patrice Vignola <vignola.patrice@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: sam (jgscripts) <2887857+jgscr@users.noreply.github.com>
Co-authored-by: Khanh Hoa <49144992+hoanguyenkh@users.noreply.github.com>
Co-authored-by: vickkkkkyy <vickyaviles847@gmail.com>
Co-authored-by: Barnabas Busa <barnabas.busa@ethereum.org>
Co-authored-by: Afanti <127061691+threewebcode@users.noreply.github.com>
Co-authored-by: Brindrajsinh Chauhan <91854080+Brindrajsinh-Chauhan@users.noreply.github.com>
Co-authored-by: Gianguido Sorà <gsora@users.noreply.github.com>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: kira <shyampkira@gmail.com>
Co-authored-by: stellrust <gohunter@foxmail.com>
Co-authored-by: Rupam Dey <117000803+rupam-04@users.noreply.github.com>
Co-authored-by: John <33443230+gazzua@users.noreply.github.com>
Co-authored-by: Samuel VIDEAU <70749906+samuel-videau@users.noreply.github.com>
Co-authored-by: shangchengbabaiban <shuang.cui@live.cn>
Co-authored-by: ethfanWilliam <ethfanWilliam@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Ryan <RyanBGG@proton.me>
Co-authored-by: Jay <jay@superblock.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electra scope:security General protocol security-related items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants