10279 Commits

Author SHA1 Message Date
james-prysm
495056625e Validator block v4 (#16594)
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

Introduces the validator connection point for rest api to call block v4
and envelope endpoints

builds on https://github.com/OffchainLabs/prysm/pull/16488 and
https://github.com/OffchainLabs/prysm/pull/16522

testing
```
participants:
  - el_type: geth
    el_image: ethpandaops/geth:epbs-devnet-0
    cl_type: prysm
    cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
    vc_image: gcr.io/offchainlabs/prysm/validator:latest
    supernode: true
    count: 2
    cl_extra_params:
      - --subscribe-all-subnets
      - --verbosity=debug
    vc_extra_params:
      - --enable-beacon-rest-api
      - --verbosity=debug

  - el_type: geth
    el_image: ethpandaops/geth:epbs-devnet-0
    cl_type: prysm
    cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
    vc_image: gcr.io/offchainlabs/prysm/validator:latest
    validator_count: 63
    cl_extra_params:
      - --verbosity=debug
    vc_extra_params:
      - --enable-beacon-rest-api
      - --verbosity=debug

network_params:
  fulu_fork_epoch: 0
  gloas_fork_epoch: 2
  seconds_per_slot: 6
  genesis_delay: 40

additional_services:
  - dora

global_log_level: debug

dora_params:
  image: ethpandaops/dora:gloas-support
  ```

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [ ] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [ ] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [ ] I have added a description with sufficient context for reviewers to understand this PR.
- [ ] I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 22:03:57 +00:00
james-prysm
c298c504ef fixing wrong path name in execution payload bid api (#16690)
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

fixing wrong path name from /eth/v2/beacon/execution_payload/bid to
/eth/v1/beacon/execution_payload_bid

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-17 21:07:35 +00:00
Manu NALEPA
486e479a99 Prevent expensive state replay when computing sync committees members for the current period (#16688)
**What type of PR is this?**
Bug fix

**What does this PR do? Why is it needed?**
Every `EPOCHS_PER_SYNC_COMMITTEE_PERIOD=256` epochs,
`SYNC_COMMITTEE_SIZE=512` validators are randomly chosen to be part of
the sync committee.

When calling the the
[/eth/v1/validator/duties/sync/epoch](https://ethereum.github.io/beacon-APIs/#/Validator/getSyncCommitteeDuties)
endpoint with `epoch` being set to the first epoch of the current
period, the Prysm beacon node:
1. Finds the youngest state in the DB before this epoch
2. Replays (expensive) states up the requested epoch

While this is technically correct, the step `2.` is very resource
consuming.

This pull request leverages the fact that the `current_sync_committee`
and `next_sync_committee` fields do not change within a period.

==> If the requested epoch and the current epoch are within the same
period, then we can fetch `current_sync_committee` and
`next_sync_committee` from the state corresponding to the current epoch,
which is way less expensive.

**Which issues(s) does this PR fix?**

Fixes:
- https://github.com/OffchainLabs/prysm/issues/16686

**Other notes for review**
Please read commit by commit.

With a Nimbus VC connected:
**Before this PR**
<img width="936" height="308" alt="image"
src="https://github.com/user-attachments/assets/b76f588d-dc95-4916-af93-6ea80b092609"
/>

**After this PR**
<img width="941" height="305" alt="image"
src="https://github.com/user-attachments/assets/65302c90-be33-4525-be5c-a13338335d39"
/>

**Test plan**
Read how to reproduce the issue in the linked issue, and check that the
same reproduction steps do not reproduce the issue with this PR.

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-17 14:16:12 +00:00
terence
fbb65f6700 Queue Gloas data column sidecars arriving before their block (#16653)
In Gloas, data column sidecars can arrive via gossip before the block
here is to queue instead of dropping and re-request later

### Design notes
  - Subnet is verified before queuing (reject bad subnet immediately)
- Columns are stored in a fixed-size `[128]` array per block root,
indexed by column index — duplicates for the same index are ignored
- When the block arrives (via `beaconBlockSubscriber` or
`processPendingBlocks`), queued columns are verified against the block's
bid commitments and saved to storage
- Peers that sent columns failing verification (slot mismatch, invalid
sidecar, bad KZG proof) are downscored (PeerID is tracked)
  - A slot ticker prunes entries from past slots every slot boundary 
- RPC column fetch is skipped for blocks that already have pending
gossip columns
- Each Gloas sidecar is ~44 KB at 21 max blobs (21 cells × 2048 bytes +
proofs). 128 columns per block = ~5.5 MB per block root. The slot ticker
ensures at most one slot's worth of pending roots exist at any time.
2026-04-16 16:36:51 +00:00
Manu NALEPA
f0c7633c87 Pubkey cache: Use map+mutex instead of LRU cache (#16654)
**What type of PR is this?**
Optimization

**What does this PR do? Why is it needed?**
Uncompressing/verifying a (validator) public key from bytes is an
expensive operation.
To avoid doing this operation multiple times for the same public key, a
cache mapping raw, compressed public key to uncompressed, verified ones
is created and populated at node start.

**Before this PR**, a LRU cache with a 2M capacity is used.
The issue with this design is the following:
1. If the cache capacity (2M) is higher than the current count of active
public keys, then keys in this cache are never evicted. ==> Using a LRU
cache is useless. This is the case for all devnets, testnets and
mainnet.
2. If the cache capacity (2M) is lower than the current count of active
public keys, because validators attetations and block proposals are
randomly distributed, some keys will be evicted, then very shortly after
re-inserted. (The only valid case for using a LRU here is sync
committees, that last ~27H). ==> Using a LRU cache is useless.

In both cases 1. and 2., using a LRU cache is useless, and could be
replaced by a map (+ mutex for concurrent accesses). Additionally,
compared to a simple map, a LRU cache consumes some extra heap memory.

**After this PR**, the LRU cache is removed and replaced by a map (+
mutex for concurrent accesses.)

**Cache memory usage (source: Hoodi Pyroscope)**
- Before this PR: 222 MB
- After this PR:  158 MB

**==> Gain: 64 MB**

That's not a lot, but it is an easy saving.

**Before this PR**
<img width="940" height="586" alt="image"
src="https://github.com/user-attachments/assets/ef92abf5-e781-44cb-83b0-7db7b52ef371"
/>

**After this PR**
<img width="1018" height="274" alt="image"
src="https://github.com/user-attachments/assets/8261e18c-3edc-4530-a55c-4c9eaa9a6d6c"
/>

<img width="1020" height="922" alt="image"
src="https://github.com/user-attachments/assets/afa07aac-0b28-417b-815e-f00936d04c02"
/>


**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-16 14:14:04 +00:00
Barnabas Busa
321828e775 Fix MaxBuildersPerWithdrawalsSweep in minimal preset (#16623)
## Summary
- The minimal preset was missing the `MaxBuildersPerWithdrawalsSweep`
override, causing it to inherit the mainnet value of `16384` instead of
the correct minimal value of `16`
- This aligns with the [consensus-specs minimal gloas
preset](https://github.com/ethereum/consensus-specs/blob/master/presets/minimal/gloas.yaml#L23)

## Test plan
- [x] `go build ./config/params/` passes
- [ ] Verify minimal preset spec tests pass with the corrected value

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-14 20:19:15 +00:00
james-prysm
e2ffb42abe allow proposer preferences on the same epoch (#16610)
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

based on https://github.com/ethereum/consensus-specs/pull/5035

adds capabilities on the validator client side to submit current epoch
attestations,
- for current epoch submissions, we skip slot 0 and start at slot 1 for
submissions, we also need a 1 slot buffer if we start the validator
client mid epoch and and need to propose during that epoch.
- current epoch submissions don't fire in fulu, only next epoch
submissions fire for gloas at the last epoch of fulu before gloas

kurtosis test by cherry picking changes on epbs-devnet-1 and running
```
participants:
  - el_type: geth
    el_image: ethpandaops/geth:epbs-devnet-0
    cl_type: prysm
    cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
    vc_image: gcr.io/offchainlabs/prysm/validator:latest
    supernode: true
    count: 4
    vc_extra_params:
      - "--verbosity=debug"

network_params:
  fulu_fork_epoch: 0
  gloas_fork_epoch: 2
  seconds_per_slot: 6
  genesis_delay: 40

additional_services:
  - dora

global_log_level: debug

dora_params:
  image: ethpandaops/dora:gloas-support
```

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-14 19:45:40 +00:00
james-prysm
d1bb9018d3 reversing checkpoint api change (#16660)
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

https://github.com/OffchainLabs/prysm/pull/16635 will break clients
checkpoint sync if the first slot of the epoch is missed, but it was
added to resolve some changes in gloas.

With https://github.com/ethereum/consensus-specs/pull/5094 we will be
able to keep the old approach for checkpoint sync endpoints and so the
previous pr 16635 is no longer needed.


**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-14 19:03:51 +00:00
james-prysm
8c70e4bbb1 implementing envelope rest apis (#16522)
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

adds 

- GET /eth/v1/validator/execution_payload_envelope/{slot} endpoint
- POST /eth/v1/beacon/execution_payload_envelope endpoint

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).

---------

Co-authored-by: james-prysm <jhe@offchainlabs.com>
2026-04-14 17:31:40 +00:00
Rupam
c004abc89d return 404 for requests that ask for pre checkpoint sync state (#16615)
<!-- Thanks for sending a PR! Before submitting:

1. If this is your first PR, check out our contribution guide here
https://docs.prylabs.network/docs/contribute/contribution-guidelines
You will then need to sign our Contributor License Agreement (CLA),
which will show up as a comment from a bot in this pull request after
you open it. We cannot review code without a signed CLA.
2. Please file an associated tracking issue if this pull request is
non-trivial and requires context for our team to understand. All
features and most bug fixes should have
an associated issue with a design discussed and decided upon. Small bug
   fixes and documentation improvements don't need issues.
3. New features and bug fixes must have tests. Documentation may need to
be updated. If you're unsure what to update, send the PR, and we'll
discuss
   in review.
4. Note that PRs updating dependencies and new Go versions are not
accepted.
   Please file an issue instead.
5. A changelog entry is required for user facing issues.
-->

**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

- Prevents invalid/time-expensive replay for unavailable historical
slots by returning Not Found instead of trying to replay from genesis.
- Handles replay no-data errors as Not Found, so missing historical data
no longer surfaces as Internal Server Error in HTTP paths (this might
not be required, I just added it for consistency, lmk if i should
remove)
- Adds unit tests for:
i) slot earlier than earliest available
ii) slot before backfill low slot
iii) replay no-data mapping to not-found
iv) shared HTTP error mapping for no-data to 404

**Which issues(s) does this PR fix?**

Addresses #16191

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).

---------

Co-authored-by: Bastin <43618253+Inspector-Butters@users.noreply.github.com>
2026-04-14 15:30:20 +00:00
Aliz Fara
85316c5d16 Fix event subscription timeout handling (#16681)
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

This excludes `/eth/v1/events` from the global `http.TimeoutHandler`
while keeping the timeout behavior for other HTTP routes unchanged.

When `--api-timeout` is set, the timeout wrapper is incompatible with
Prysm's SSE event stream handling and can return `200 OK` with an empty
response body instead of keeping the stream open.

**Which issues(s) does this PR fix?**

Fixes #15710

**Other notes for review**

- Adds focused coverage for the SSE bypass and the unchanged timeout
behavior for non-SSE routes.
- Stabilizes `TestServer_StartStop` by replacing a goroutine log
assertion with `require.Eventually`.
- Validation used during review:
`go test ./api/server/httprest -run 'TestServer_TimeoutHandler' -count=1
-v`

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-14 14:45:03 +00:00
james-prysm
9069afc6d0 Get block v4 (#16488)
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

implements the new GET /eth/v4/validator/blocks/{slot} endpoint, we
don't hook up the validator client to use it yet for post gloas in this
pr.

**Which issues(s) does this PR fix?**

Fixes https://github.com/ethereum/beacon-APIs/pull/580

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-14 03:23:42 +00:00
Sahil Sojitra
9802242cfe perf(auth): optimize auth token handling #15763 (#15793)
<!-- Thanks for sending a PR! Before submitting:

1. If this is your first PR, check out our contribution guide here
https://docs.prylabs.network/docs/contribute/contribution-guidelines
You will then need to sign our Contributor License Agreement (CLA),
which will show up as a comment from a bot in this pull request after
you open it. We cannot review code without a signed CLA.
2. Please file an associated tracking issue if this pull request is
non-trivial and requires context for our team to understand. All
features and most bug fixes should have
an associated issue with a design discussed and decided upon. Small bug
   fixes and documentation improvements don't need issues.
3. New features and bug fixes must have tests. Documentation may need to
be updated. If you're unsure what to update, send the PR, and we'll
discuss
   in review.
4. Note that PRs updating dependencies and new Go versions are not
accepted.
   Please file an issue instead.
5. A changelog entry is required for user facing issues.
-->

**What type of PR is this?**
> Other

**What does this PR do? Why is it needed?**
This PR applies micro-optimizations to the auth token handling code. It
improves efficiency and readability by reducing unnecessary allocations
and adding an early length check before performing constant-time
comparison. [PR#15763](https://github.com/OffchainLabs/prysm/pull/15763)

**Changes Included**
- Use `strings.HasPrefix` + slicing instead of `strings.Split` to avoid
allocations
- Add early length check before `subtle.ConstantTimeCompare`

**Which issues(s) does this PR fix?**
No functional changes or security fixes; this PR improves performance
and code clarity in the auth token handling logic.

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description to this PR with sufficient context for
reviewers to understand this PR.

---------

Co-authored-by: maradini77 <140460067+maradini77@users.noreply.github.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-13 18:20:38 +00:00
Alleysira
e75166cfe7 Fix blob index bounds check (#16640)
**What type of PR is this?**
Bug fix

**What does this PR do? Why is it needed?**

This PR addresses a runtime panic caused by a missing bounds check on
blob indices. I've implemented a fix and would like to hear from you.
Thanks!

##### What does this PR do?
- Add a bound check for `blob.Index`.
- Add 3 tests to show that without the fix prysm will panic.

##### Why is it needed?

`BlobAlignsWithBlock` accesses `commits[blob.Index]` without checking
that `blob.Index < len(commits)`. It only checks `blob.Index <
MaxBlobsPerBlock` (the spec-wide maximum, e.g. 6 for Deneb). If a blob
has an index that passes the spec max check but exceeds the actual
number of commitments in the block, the code panics with an
index-out-of-range runtime error. The added tests confirmed this.
Fortunately, I think this is unreachable because all callers validate
blob indices upstream:
- `blobValidatorFromRootReq` rejects blobs whose index wasn't in the
request
- `newSequentialBlobValidator` enforces strictly sequential indices (0,
1, 2, ...)
- `requestsForMissingIndices` only generates indices 0..len(commits)-1
                                                                      
The fix adds an explicit bounds check as defense-in-depth, so that if a
future caller bypasses upstream validation, the function returns
ErrIncorrectBlobIndex instead of panicking.

Three test functions are added to `blob_test.go`:
- `TestBlobAlignsWithBlock_OOBIndexReturnsError`: blob with `index >=
len(commits)` but `< MaxBlobsPerBlock` returns ErrIncorrectBlobIndex.
Without this fix, this test panics.
- `TestBlobAlignsWithBlock_MaxIndexEdge`: boundary test confirming the
last valid index succeeds and the first OOB index errors.
- `TestBlobAlignsWithBlock_AllValidIndicesSucceed`: all indices in
0..nCommitments-1 succeed without error or panic.

Without the fix:
```bash
$ go test ./beacon-chain/sync/verify/ -v -count=1
=== RUN   TestBlobAlignsWithBlock
=== RUN   TestBlobAlignsWithBlock/happy_path_blob_0
=== RUN   TestBlobAlignsWithBlock/mismatched_roots_blob_0
=== RUN   TestBlobAlignsWithBlock/mismatched_roots_-_fake_blob_0
=== RUN   TestBlobAlignsWithBlock/before_deneb_blob_0
--- PASS: TestBlobAlignsWithBlock (0.00s)
    --- PASS: TestBlobAlignsWithBlock/happy_path_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/mismatched_roots_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/mismatched_roots_-_fake_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/before_deneb_blob_0 (0.00s)
=== RUN   TestBlobAlignsWithBlock_OOBIndexReturnsError
--- FAIL: TestBlobAlignsWithBlock_OOBIndexReturnsError (0.00s)
panic: runtime error: index out of range [3] with length 3 [recovered, repanicked]

goroutine 116 [running]:
testing.tRunner.func1.2({0x12d1aa0, 0xc000363818})
        /home/alleysira/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.1.linux-amd64/src/testing/testing.go:1872 +0x237
testing.tRunner.func1()
        /home/alleysira/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.1.linux-amd64/src/testing/testing.go:1875 +0x35b
panic({0x12d1aa0?, 0xc000363818?})
        /home/alleysira/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.1.linux-amd64/src/runtime/panic.go:783 +0x132
github.com/OffchainLabs/prysm/v7/beacon-chain/sync/verify.BlobAlignsWithBlock({0xc00030de60, {0xf, 0x74, 0x6b, 0x28, 0xa, 0x5a, 0x94, 0xdd, 0x55, ...}}, ...)
        /home/alleysira/pr/prysm/beacon-chain/sync/verify/blob.go:44 +0x5b0
github.com/OffchainLabs/prysm/v7/beacon-chain/sync/verify.TestBlobAlignsWithBlock_OOBIndexReturnsError(0xc0003a2540)
        /home/alleysira/pr/prysm/beacon-chain/sync/verify/blob_test.go:109 +0x557
testing.tRunner(0xc0003a2540, 0x14b91f8)
        /home/alleysira/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.1.linux-amd64/src/testing/testing.go:1934 +0xea
created by testing.(*T).Run in goroutine 1
        /home/alleysira/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.1.linux-amd64/src/testing/testing.go:1997 +0x465
FAIL    github.com/OffchainLabs/prysm/v7/beacon-chain/sync/verify       0.016s
FAIL
```
With the fix the test pass:
```shell
go test ./beacon-chain/sync/verify/ -v -count=1
=== RUN   TestBlobAlignsWithBlock
=== RUN   TestBlobAlignsWithBlock/happy_path_blob_0
=== RUN   TestBlobAlignsWithBlock/mismatched_roots_blob_0
=== RUN   TestBlobAlignsWithBlock/mismatched_roots_-_fake_blob_0
=== RUN   TestBlobAlignsWithBlock/before_deneb_blob_0
--- PASS: TestBlobAlignsWithBlock (0.00s)
    --- PASS: TestBlobAlignsWithBlock/happy_path_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/mismatched_roots_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/mismatched_roots_-_fake_blob_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock/before_deneb_blob_0 (0.00s)
=== RUN   TestBlobAlignsWithBlock_OOBIndexReturnsError
--- PASS: TestBlobAlignsWithBlock_OOBIndexReturnsError (0.00s)
=== RUN   TestBlobAlignsWithBlock_MaxIndexEdge
--- PASS: TestBlobAlignsWithBlock_MaxIndexEdge (0.00s)
=== RUN   TestBlobAlignsWithBlock_AllValidIndicesSucceed
=== RUN   TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_0
=== RUN   TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_1
=== RUN   TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_2
=== RUN   TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_3
--- PASS: TestBlobAlignsWithBlock_AllValidIndicesSucceed (0.00s)
    --- PASS: TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_0 (0.00s)
    --- PASS: TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_1 (0.00s)
    --- PASS: TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_2 (0.00s)
    --- PASS: TestBlobAlignsWithBlock_AllValidIndicesSucceed/index_3 (0.00s)
PASS
ok      github.com/OffchainLabs/prysm/v7/beacon-chain/sync/verify       0.017s
```

**Which issues(s) does this PR fix?**

None.

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-13 17:25:05 +00:00
satushh
8864484230 Fix processBatchedBlocks returning pre-filter block count (#16657)
**What type of PR is this?**

Bug fux

**What does this PR do? Why is it needed?**

Move bwbCount assignment **after** validUnprocessed so peer scoring only
credits actually processed blocks.

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-13 14:19:02 +00:00
terence
5bb13408d5 Use fork-aware deserialization for data columns from disk (#16650)
- `VerifiedRODataColumnFromDisk` now takes an epoch parameter
- Columns at or after the Gloas fork epoch unmarshal as
`DataColumnSidecarGloas`
- Earlier columns continue to unmarshal as `DataColumnSidecar` (Fulu)
- Previously all columns used the Fulu type, which fails for Gloas
2026-04-10 20:48:11 +00:00
Potuz
99327d7422 Fix initial sync bid validation failure (#16652)
During initial sync, state replay skips the last block's execution
payload envelope (no next block to verify delivery). When the parent
envelope was already saved by a previous batch, envelopesForBlocks
skipped it as "already processed", leaving getBatchPrestate unable to
apply it. This caused LatestBlockHash to be stale, failing bid
validation on the next block.

Two fixes:
- envelopesForBlocks: always include the parent envelope even if
persisted
- getBatchPrestate: when parent envelope is in DB, load and apply the
blinded form instead of the broken StateByRootInitialSync(env.BlockHash)
call that passed an execution hash where a beacon block root was
expected

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-10 19:02:37 +00:00
terence
527863e9de Set bid KZG commitments on gloas's data columns (#16649)
- Set bid commitments on verified columns during gossip validation
(`validateDataColumnGloas`)
- Add `setBidCommitments` helper for the RPC fetch path
(`FetchDataColumnSidecars`)
- Track `commitmentsByRoot` on `DataColumnSidecarsParams` so peer
fetches can set commitments before verification
2026-04-10 16:53:10 +00:00
terence
de34b4dfae Skip inclusion proof verification for Gloas data columns (#16647)
- Gloas data column sidecars don't carry block headers or inclusion
proofs
  - Skip `VerifyDataColumnSidecarInclusionProof` for Gloas sidecars
- Skip Gloas columns in the batch verifier `SidecarInclusionProven` loop
2026-04-10 15:18:48 +00:00
terence
ccf61fb91b Decode Gloas data columns using correct protobuf type over RPC (#16648)
- `readChunkedDataColumnSidecar` now branches on fork version
- Gloas columns decode as `DataColumnSidecarGloas`, Fulu as
`DataColumnSidecar`
- Previously all RPC columns decoded as Fulu, causing failures when
non-proposer nodes fetched Gloas columns from peers
2026-04-10 14:38:47 +00:00
terence
e9fdeee7bb Add missing fields to Gloas genesis block bid (#16646)
- The Gloas genesis block's `SignedExecutionPayloadBid` was missing
`PrevRandao` (32 bytes) and `FeeRecipient` (20 bytes)
  - This caused SSZ marshaling failures at genesis
2026-04-10 14:25:44 +00:00
satushh
9da54ce816 Fix package-level logger mutation (#16645)
**What type of PR is this?**

Bug Fix

**What does this PR do? Why is it needed?**

- Fix package-level logger mutation in initial-sync Resync and validator
proposer GetBlock.


**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [ ] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [ ] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [ ] I have added a description with sufficient context for reviewers
to understand this PR.
- [ ] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-09 14:40:44 +00:00
terence
ee9fa34b30 Fix Gloas data column KZG commitments for operation feed (#16643)
- Fix `WARN sync: Failed to get KZG commitments for operation feed
error=data column sidecar is not a fulu type` spam on Gloas devnet
- Gloas data column sidecars don't carry KZG commitments, they live in
the block's execution payload bid. Added `bidCommitmentsGloas` to
`RODataColumn` and populate it in `validateDataColumnGloas` using the
block already fetched from DB
- We want two things 1.) No extra DB lookups 2.) no function signature
changes

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-08 22:01:17 +00:00
terence
cf09469ac9 Add Gloas engine API method versions for devnet (#16642)
- Wire up `engine_newPayloadV5` for Gloas, using it based on slot.
Reuses `ExecutionPayloadDeneb` with
  execution requests (same params as V4, just version bump).
- Add Gloas to `engine_forkchoiceUpdatedV3` and `engine_getPayloadV5`
(shared with fulu).
- Add slot parameter to `NewPayload` interface so the engine client can
select V4 vs V5 at the fork boundary. (this will change later!)
- Add GloasEnabled() config helper and gloasEngineEndpoints for
capability exchange.
2026-04-08 20:02:38 +00:00
Potuz
f3dfcbab2a Use proposer preferences cache for payload attributes after Gloas (#16620)
## Summary
- Adds `ProposerPreferencesCache` to the blockchain service so
`trackedProposer()` can use Gloas gossip preferences (fee recipient, gas
limit) when constructing payload attributes for FCU
- When `PrepareAllPayloads` is enabled, checks the preferences cache
first, falling back to the default burn address
- When a validator is tracked, checks the preferences cache to override
the tracked validator's fee recipient
- Adds `GasLimit` field to `TrackedValidator` struct, populated from
proposer preferences

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 16:35:24 +00:00
terence
10cd675793 Construct data column sidecars from bid in Gloas blocks (#16638)
- Add `PopulateFromBid` as a new `ConstructionPopulator` that extracts
KZG commitments directly from the execution payload bid in Gloas (ePBS)
blocks
- In Gloas, the execution payload arrives separately via the payload
envelope, but the bid's KZG commitments are available in the block
immediately — this allows data column sidecars to be constructed from
the EL (`engine_getBlobsV2`) as soon as the block arrives, without
waiting for the envelope
- Wire `PopulateFromBid` into `processSidecarsFromExecutionFromBlock`
for Gloas blocks, replacing the previous early return that skipped EL
reconstruction entirely

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-08 13:38:22 +00:00
terence
f01575e44c Fix initial sync envelope validation for genesis blocks (#16637)
- Fixes initial sync failing with envelope does not match block when
syncing a Gloas chain from genesis
- Genesis (slot 0) has no separate execution payload envelope, its
execution block hash is embedded in the genesis state. The validation
loop incorrectly tried to match this hash transition against an
envelope, which always failed
2026-04-08 03:08:13 +00:00
satushh
129d6e1088 Fix swapped JSON tags in ChainReorgEvent struct (#16639)
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

The json tags in ChainReorgEvent struct were swapped. 

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [ ] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [ ] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [ ] I have added a description with sufficient context for reviewers
to understand this PR.
- [ ] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-07 11:41:15 +00:00
terence
883d78221f Use ValidatorIndex type for proposer_lookahead in beacon state proto (#16634)
- Adds `cast_type` annotation to `proposer_lookahead` field in
`BeaconStateFulu` and `BeaconStateGloas` protobuf definitions to use
`primitives.ValidatorIndex` instead of raw `uint64`
- Matches the spec type `Vector[ValidatorIndex, ...]` and is consistent
with how `ptc_window` already uses `cast_type` for its validator indices
- Updates `InitializeProposerLookahead` to return
`[]primitives.ValidatorIndex` directly, removing all `uint64` conversion
boilerplate
- Adds `proposerLookaheadVal()` copy method for `ToProto` consistency
with other slice fields
2026-04-07 02:42:24 +00:00
Manu NALEPA
6e4d7fd781 ProcessEffectiveBalanceUpdates: Avoid copying a validator when the computed effective balance is unchanged. (#16631)
**What type of PR is this?**
Bug fix

**What does this PR do? Why is it needed?**
In (electra) `ProcessEffectiveBalanceUpdates`, a `0x00...` validator
with a balance > 33.25 ETH enters in the
```go
if balance+downwardThreshold < val.EffectiveBalance() || val.EffectiveBalance()+upwardThreshold < balance {
...
}
```

condition.

The validator is copied (`newVal = val.Copy()`) and returned, **even if
the effective balance did not actually change**.
As a consequence, this validator is considered as "dirty" in the
validators field trie, and all the corresponding branches are
re-computed when computing the hash trie root of the the validators
field trie of the beacon state.

This PR adopts the same behavior as before Electra:

6f437b561a/beacon-chain/core/electra/effective_balance_updates.go (L32-L63)

and copies/considers dirty the validator only if its effective balance
changed.

**Which issues(s) does this PR fix?**
- https://github.com/OffchainLabs/prysm/issues/16630

**Other notes for review**
The first commit only introduces a new metric showing the issue.
The second commit actually solves the issue.

**Before this PR:**
**~9.400 validators** considered as dirty on mainnet every epoch

<img width="942" height="308" alt="image"
src="https://github.com/user-attachments/assets/31da9c92-aa0f-4d71-a402-92ed62738803"
/>


**After this PR:**
**~15 validators** considered as dirty on mainnet every epoch (reduction
of ~x620).

<img width="946" height="312" alt="image"
src="https://github.com/user-attachments/assets/afc5e72a-ccda-4636-87d9-dab2fbbf5c1c"
/>


**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-06 16:29:31 +00:00
terence
14f5e6f414 Downgrade genesis forkchoice balance underflow warning to debug (#16633)
- Demotes the "node with invalid balance, setting it to zero" warning to
DEBUG level for genesis nodes in forkchoice
- Non-genesis block retain the WARN level since underflow there
indicates a real bug
- This is required for gloas e2e test because it plans to fail on any
warning and error
2026-04-06 14:51:24 +00:00
Potuz
9d084bceb3 Fix finalized and justified state endpoint to not advance the slot (#16635)
Use StateByRoot with the checkpoint root instead of replaying to the
epoch start slot. The previous approach incorrectly advanced the state
beyond the checkpoint block's post-state.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:12:21 +00:00
terence
f79d2efc6e Fix zero head block hash in FCU at gloas genesis (#16629)
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-03 04:06:34 +00:00
terence
9dba7c5319 Check pending deposits before applying builder deposits (#16532)
Add `IsPendingValidator` check to `processDepositRequest` so that
deposit requests with builder credentials are routed to the validator
pending queue when a pending deposit with a valid signature already
exists for the same pubkey

Also updated spec test to alpha3 so we can merge this with green CI/CD

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-02 21:23:21 +00:00
terence
c02c057b7d core: implement cached PTC window in state (#16573)
This adds the PTC cache to the Gloas proto and native beacon state,
updates SSZ/hash-tree-root handling, initializes the cache on Gloas
upgrade, rotates it during epoch processing, and switches payload
committee lookups to read from the cached window instead of recomputing
PTC assignments on demand

Reference: https://github.com/ethereum/consensus-specs/pull/4979
2026-04-02 17:56:02 +00:00
terence
b6ec6a8eec fix: add Gloas genesis block support (#16627)
## Summary

- Add missing `*ethpb.BeaconStateGloas` case to
`NewGenesisBlockForState` type switch
- Create `gloasGenesisBlock()` with the correct Gloas block body
structure (`SignedExecutionPayloadBid` + `PayloadAttestations`)

Fixes the `unknown underlying type for state.BeaconState value` error
when starting a node from a Gloas genesis state.
2026-04-02 17:05:20 +00:00
terence
3ca8c3ba35 Support gloas blob protobuf for readonly (#16618)
- Refactor `RODataColumn` to support both Fulu and Gloas data column
sidecar protobuf types. Fulu-only accessors now return errors instead of
zero values when called on Gloas sidecars
- Wire up Gloas `DataColumnSidecarGloas` across gossip topic mappings,
pubsub decoding, validation, and RPC serving
  - Gloas duplicate check uses `(block_root, index)` per spec
- Precompute and broadcast Gloas data column sidecars during block
proposal, before the execution payload envelope, so receivers pass data
availability checks
- Fix `WriteDataColumnSidecarChunk` to encode the correct SSZ type per
fork
2026-04-02 15:44:41 +00:00
terence
1092c7135f Refactor gloas process_execution_payload into distinct entry points (#16600)
## Summary

- Decompose `process_execution_payload` into four explicit entry points,
one per caller
- Extract shared helpers: `cacheLatestBlockHeaderStateRoot`,
`setLatestBlockHeaderStateRoot`, `validatePayloadConsistency`,
`verifyPostStateRoot`
- Unexport package-internal functions:
`applyExecutionPayloadStateMutations`,
`verifyExecutionPayloadEnvelopeSignature`
- Rename `ApplyBlindedExecutionPayloadEnvelopeForStateGen` →
`ProcessBlindedExecutionPayload`
- Rename `ApplyExecutionPayloadNoVerifySig` →
`ProcessExecutionPayloadWithDeferredSig`

  ## Motivation

The previous code routed all callers through `ApplyExecutionPayload`,
which tried to serve every path at once. Each caller's assumptions were
implicit rather than visible in the code. Now each entry point reads
top-to-bottom as exactly the steps that path requires.

  ## Entry points

| Step | `ProcessExecutionPayload` |
`ProcessExecutionPayloadWithDeferredSig` | `ApplyExecutionPayload` |
`ProcessBlindedExecutionPayload` |
  |---|---|---|---|---|
  | **Caller** | gossip | init-sync | proposer | stategen / replay |
| **Verify signature** |  inline | 🔶 deferred (`SignatureBatch`) |  |
 |
| **Patch header state root** | `cacheLatestBlockHeaderStateRoot`
(computes HTR) | `setLatestBlockHeaderStateRoot` (caller-provided) |
`cacheLatestBlockHeaderStateRoot` (computes HTR) |
`setLatestBlockHeaderStateRoot` (caller-provided) |
| **Validate consistency** | `validatePayloadConsistency` (full) |
`validatePayloadConsistency` (full) | `validatePayloadConsistency`
(probably can be removed but outside the scope) | minimal bid checks
(builder index + block hash) |
| **Verify post-state root** |  `verifyPostStateRoot` | 
`verifyPostStateRoot` |  (caller computes it) |  (trusted) |
| **Envelope type** | `ROSignedExecutionPayloadEnvelope` |
`ROSignedExecutionPayloadEnvelope` | `ROExecutionPayloadEnvelope` |
`ROBlindedExecutionPayloadEnvelope` |
2026-04-02 09:32:11 +00:00
james-prysm
73033a9d67 allowing ptc duties for next epoch on grpc endpoint (#16608)
**What type of PR is this?**

 Bug fix


**What does this PR do? Why is it needed?**

adding next epoch fix for grpc endpoint ( currently unused) 

https://github.com/OffchainLabs/prysm/pull/16591

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-02 07:46:38 +00:00
james-prysm
a7b83c358a Pre fork proposer preferences (#16588)
**What type of PR is this?**

 Bug fix


**What does this PR do? Why is it needed?**

context https://github.com/ethereum/consensus-specs/pull/4947

This pr allows for proposer preferences topic to be subscribed 1 epoch
before gloas as well as allowing for publishing of proposer preferences
before the gloas fork. The digest used is still gloas despite being in
the fulu fork.

validator client submits mid epoch when it's 1 epoch away from fork to
avoid races

tested in kurtosis
```
participants:
  - el_type: geth
    el_image: ethpandaops/geth:epbs-devnet-0
    cl_type: prysm
    cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
    vc_image: gcr.io/offchainlabs/prysm/validator:latest
    supernode: true
    count: 2

network_params:
  fulu_fork_epoch: 0
  gloas_fork_epoch: 2
  seconds_per_slot: 6
  genesis_delay: 40

additional_services:
  - dora

global_log_level: debug

dora_params:
  image: ethpandaops/dora:gloas-support

```

**Which issues(s) does this PR fix?**

Fixes #https://github.com/OffchainLabs/prysm/issues/16587

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-02 02:50:47 +00:00
Potuz
29a0fd6760 Add gRPC endpoint to submit signed execution payload bids (#16614)
## Summary
- Adds `SubmitSignedExecutionPayloadBid` RPC to the
`BeaconNodeValidator` gRPC service
- Broadcasts the signed bid to the P2P gossip network
- Updates all interface implementations (gRPC client, beacon-API
client), and mocks

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-04-01 20:24:23 +00:00
satushh
209e46bab7 PTC duties no longer computed from a pre-Gloas state at the Fulu to Gloas fork boundary (#16619)
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

At fork boundary the PTC was computed from a pre-Gloas state. So this PR
adds a state version check to avoid doing that.

Added extra tests to cover it. 

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [ ] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-01 19:14:46 +00:00
Preston Van Loon
108e2806cb Fastssz update to allow generics (#16628)
**What type of PR is this?**

Other

**What does this PR do? Why is it needed?**

Incorporates fastssz PR 19:
https://github.com/OffchainLabs/fastssz/pull/19.

**Which issues(s) does this PR fix?**

This allows for use of []primitives.ValidatorIndex in ssz code
generation.

**Other notes for review**

Most of the diff is regenerating ssz.go files. Review go.mod and
deps.bzl carefully.

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-04-01 20:44:08 +00:00
Potuz
68c4c36e65 Add beacon API endpoint to publish signed execution payload bids (#16612)
## Summary
- Adds `POST /eth/v2/beacon/execution_payload/bid` beacon API endpoint
- Accepts `SignedExecutionPayloadBid` as JSON or SSZ (Content-Type
based)
- Broadcasts the bid to the P2P gossip network; the existing gossip
subscriber handles caching

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 01:23:53 +00:00
Potuz
67cc68c3bb Potuz/replay post gloas (#16598)
Fix state replay failing on post-CL ancestor states for Gloas blocks

When replaying blocks from an ancestor state that is post-CL (before
execution payload delivery), the first block's bid validation fails
because state.latestBlockHash hasn't been updated with the ancestor's
delivered payload hash. This causes "bid parent block hash mismatch"
errors during forkchoice setup on node restart.

Before the replay loop, check if the first block's bid parentBlockHash
differs from state.latestBlockHash. If so, load and apply the ancestor's
execution payload envelope from DB to bring the state to post-EL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2026-03-30 21:25:41 +00:00
satushh
c33f0d04b7 Re-add next-epoch lookahead for PTC duties (#16591)
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

Add current and next epoch lookahead as per
https://github.com/ethereum/beacon-APIs/pull/592

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [ ] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [ ] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [ ] I have added a description with sufficient context for reviewers
to understand this PR.
- [ ] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-03-30 18:10:27 +00:00
james-prysm
f05972a181 changing log to warn in fallback log (#16606)
**What type of PR is this?**

 Other

**What does this PR do? Why is it needed?**
changing info log to warn for fallback message

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).
2026-03-30 15:55:50 +00:00
Aarsh Shah
7352ae03c6 Fix our flakiest unit tests (#16395)
**What type of PR is this?**
Bug fix


**What does this PR do? Why is it needed?**

This PR fixes the flakiest unit tests in Prysm which are
`TestFilterSubnetPeers` and
`TestService_BroadcastAttestationWithDiscoveryAttempts`.

It also refactors `TestStartDiscV5_DiscoverAllPeers` to use a
require.Eventually to make it less flaky but it still remains flaky. We
can't fully unflake this test as the discV5 library does not expose any
deterministic events we can block on.

It also speeds them up by getting rid of "time.Sleep" and
"require.Eventually" in these tests by blocking on deterministic events
instead.

Details on how each test has been fixed/what was broken have been left
as comments on the corresponding changes.
2026-03-30 14:12:49 +00:00
Potuz
4f34624a54 fix: use attestation slot epoch for fork digest in gossip topic validation (#16604)
The attestation gossip validator was using currentForkDigest() to build
the expected topic prefix. This fails at fork boundaries because the
beacon node subscribes to the next fork's topics one epoch early: a
message arriving on the upcoming fork's topic would be compared against
the current fork digest, causing a spurious reject with the misleading
error "attestation's subnet does not match with pubsub topic".

Use the attestation's own slot epoch to derive the correct fork digest
instead, so the validation matches the topic the attestation was
actually published on.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:25:33 +00:00
Potuz
4e44fdf55e Gloas/forkchoice setup (#16599)
Fix forkchoice tree setup missing full payload nodes on restart

During forkchoice tree reconstruction on node restart,
buildForkchoiceChain never set HasPayload on chain entries, so
InsertChain never created full payload nodes. When a child block's bid
references the parent's delivered payload hash,
resolveParentPayloadStatus
looks for a full parent node that doesn't exist, causing "invalid parent
root" errors.

Add resolveChainPayloadStatus to determine which blocks had payloads
delivered by comparing consecutive bids. For the finalized root (tree
root), check the first chain block's bid to determine if a full node is
needed, and create it via the new MarkFullNode forkchoice method before
inserting the chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:58:41 +00:00