**1 — proto + API structs**
New fields: `execution_requests_root` on the bid,
`parent_execution_requests`
on the body. `state_root` gone from the envelope. Nothing uses them yet.
**2 — consensus-types accessors + state interfaces**
Wires up the Go side of (1). Also adds `QueueBuilderPaymentForSlot` and
factors `queueBuilderPaymentAtIndex` out of `QueueBuilderPayment`.
**3 — ProcessParentExecutionPayload + spec tests**
New spec fn, not wired in yet. Read it side-by-side with the pyspec.
**4 — swap the mutation site**
Old `ProcessExecutionPayload` drops all its state mutations and becomes
verify only. `ProcessParentExecutionPayload` gets wired into
`ProcessBlockForStateRoot` before `process_block_header` per spec order.
Also: renames `IsParentBlockFull` → `LatestBlockHashMatchesBidBlockHash`
(old name was misleading, it's just an equality check).
`ProcessSlotsForBlock`
and `head.full` are deleted. Envelope no longer computes a `state_root`.
**5 — proposer**
Sets `parent_execution_requests` on the body, builds the bid with the
new
fields, computes withdrawals via `computePayloadWithdrawals`. That fn
has
three branches (empty parent / pre-Gloas parent / full Gloas parent).
**6 — gossip validation**
Adds `validateParentExecutionRequests`: body's
`parent_execution_requests`
has to hash to what the parent bid said.
**7 — rip out dual-key state access**
State's always keyed by beacon block root now, so all the "sometimes
execution block hash" code across forkchoice, stategen, and the
blockchain
service can go. Almost pure deletions. One actual behavior change: FCU
notifications use `forkchoice.BlockHash()` instead of
`st.LatestBlockHash()`
**8 — rename ProcessExecutionPayload → VerifyExecutionPayloadEnvelope**
Rename only, nothing else. Just approve.
**9 — test utilities + assertions + changelog**
Mechanical. Test builders pick up the new fields, a few stray
`envelope.StateRoot` references get swept up, changelog added.
- Add EIP-7928 block access list (`ExecutionPayloadGloas` extends Deneb
with `block_access_list`) and wire up Amsterdam engine API:
`newPayloadV5`, `getPayloadV6`, `forkchoiceUpdatedV4`,
`getPayloadBodiesByHashV2`/`RangeV2`, plus
`PayloadAttributesV4` with `slotNumber` (EIP-7843). Payload
reconstruction now runs `eth_getBlockByHash` and
`getPayloadBodiesByHashV2` in parallel.
- Move `slot` from `ExecutionPayloadEnvelope` onto the payload itself
- Swap `latest_block_hash` and `latest_execution_payload_bid` ordering
in `BeaconStateGloas`
this PR implements [process
withdrawals](https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#modified-process_withdrawals)for
gloas. In particular
* `process_withdrawals` signature changed from the last fork, moving
from `(state, payload)` to `(state)`. It now adds builder pending
withdrawals, sweeping withdrawals, and index updates, and removes the
payload check. Because of these drastic changes, I think it is more
beneficial to implement gloas process withdrawals from scratch rather
than overloading the electra function
* previously, for every withdrawal, we would lock and unlock state to
deduct validator balance. In this fork, when a withdrawal is for a
builder, we also decrease the builder balance. I improved this by encap
the whole logic under a state setter
`st.DecreaseWithdrawalBalances(expected.Withdrawals)`, which only locks
and unlocks once
* what's new are the following (in code order).. In
`process_withdrawals`
* `IsParentBlockFull`
* `ExpectedWithdrawalsGloas`
* `appendBuilderWithdrawals`
* `appendBuildersSweepWithdrawals`
* `DecreaseWithdrawalBalances`
* `SetPayloadExpectedWithdrawals`
* `DequeueBuilderPendingWithdrawals`
* `SetNextWithdrawalBuilderIndex`
* i passed withdrawals by reference as `*[]*enginev1.Withdrawal`. This
results in two slice header copies of 24 bytes. I find the cost
non-matter and the code more readable, but this can be changed if anyone
has a stronger opinion
This PR ismplement Gloas fork upgrade. There are two main parts
- The first part is upgrade fulu state to gloas and including new gloas
fields
- The second part on board builder at the fork, which is a state setter
under one block. For this, we had to refactor a few things to be lock
free
- We also added spec tests for it to pass
This pr implements the Gloas builder registry and related beacon state
fields per the spec, including proto/SSZ updates and state-native wiring
for builders, payload availability, pending payments/withdrawals, and
expected withdrawals. This aligns BeaconState with the Gloas container
changes and adds supporting hashing/copy helpers.
Spec ref:
https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md
* Flatten spectests directory: Move all spectests to a single directory per network.
Commands ran:
```
cd testing/spectest/
```
Then for each network, I ran the following command twice.
```
find . -type f -name '*_test.go' -exec bash -c '
for file; do
dir=$(dirname "$file")
base=$(basename "$file" _test.go)
new_name="./${dir#./}__${base}_test.go"
git mv "$file" "$new_name"
done
' bash {} +
```
Then updated the packages with a command like
```
sed -i 's/package [a-zA-Z0-9_]\+/package mainnet/g' *.go
```
Updated commit from 5edadd7b to address @Kasey's feedback.
* Fix panic when checking types. String is not compatible with DeepEqual.
* Docs: add commentary on the filename convention
* Add a section about nightly tests to the spectest readme. Ref https://github.com/OffchainLabs/prysm/pull/15312
* Set shard_count to optimal value... one!
* Changelog fragment
* use latest unclog release
* Update spectest build instructions after #9122
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Migrate Prysm repo to Offchain Labs organization ahead of Pectra upgrade v6
* Replace prysmaticlabs with OffchainLabs on general markdowns
* Update mock
* Gazelle and add mock.go to excluded generated mock file
* wip
* updating types and wip on functions
* renaming to MAX_PENDING_DEPOSITS_PER_EPOCH
* fixing linting and conversions
* adding queue deposit changes
* fixing test and cloning
* removing unneeded test based on update
* gaz
* wip apply pending deposit
* fixing replay test and adding apply pending deposit
* fixing setters test
* updating transition test
* changelog
* updating pending deposits
* fixing ProcessPendingDeposit unit tests
* gaz
* fixing cyclic dependencies
* fix visiblity
* missed adding the right signature verification
* adding point to infinity topup test
* adding apply pending deposit test
* making changes based on eip6110 changes
* fixing ineffassign
* gaz
* adding batched verifications sigs
* fixing broken type
* fixing proto
* updated consensus spec tests and fixed consensus bug tests
* testing readability improvement by avoiding ApplyPendingDeposit
* removing the boolean from apply pending deposit
* improve naming
* review comments and fixing a small bug using wrong variable
* fixing tests and skipping a test
* adding some test skips
* fixing bugs terence found
* adding test for batchProcessNewPendingDeposits
* gaz
* adding churn test
* updating spec tests to alpha.8
* adding pr to changelog
* addressing terence's comments
* Update beacon-chain/core/electra/validator.go
Co-authored-by: terence <terence@prysmaticlabs.com>
* adding tests for batch verify and rename some variables
* skipping tests , add them back in later
* skipping one more test
---------
Co-authored-by: terence <terence@prysmaticlabs.com>
* 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>
* 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>
* 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
* 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>
* 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>