Replace the proposer indices cache usage in data column sidecar
verification with direct state lookahead access. Since data column
sidecars require the Fulu fork, the state always has a ProposerLookahead
field that provides O(1) proposer index lookups for current and next
epoch.
This simplifies SidecarProposerExpected() by removing:
- Checkpoint-based proposer cache lookup
- Singleflight wrapper (not needed for O(1) access)
- Target root computation for cache keys
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
Before this PR, all `.sszs` files containing the data column sidecars
were read an process sequentially, taking some time.
After this PR, every `.sszs` files of a given epoch (so, up to 32 files
with the current `SLOT_PER_EPOCHS` value) are processed in parallel.
**Which issues(s) does this PR fix?**
- https://github.com/OffchainLabs/prysm/issues/16204
Tested on - [Netcup VPS 4000 G11](https://www.netcup.com/en/server/vps).
**Before this PR (3 trials)**:
```
[2026-01-02 08:55:12.71] INFO filesystem: Data column filesystem cache warm-up complete elapsed=1m22.894007534s
[2026-01-02 12:59:33.62] INFO filesystem: Data column filesystem cache warm-up complete elapsed=42.346732863s
[2026-01-02 13:03:13.65] INFO filesystem: Data column filesystem cache warm-up complete elapsed=56.143565960s
```
**After this PR (3 trials)**:
```
[2026-01-02 12:50:07.53] INFO filesystem: Data column filesystem cache warm-up complete elapsed=2.019424193s
[2026-01-02 12:52:01.34] INFO filesystem: Data column filesystem cache warm-up complete elapsed=1.960671225s
[2026-01-02 12:53:34.66] INFO filesystem: Data column filesystem cache warm-up complete elapsed=2.549555363s
```
**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).
There is a race condition introduced in #16149 in which the update to
the NSC happens with a context that may be cancelled by the time the
routine is called. This PR starts a new context with a deadline to call
the routine in the background.
fixes#16205
This PR introduces several simplifications to block processing.
It calls to notify the engine in the background when forkchoice needs to
be updated.
It no longer updates the caches and process epoch transition before
computing payload attributes, since this is no longer needed after Fulu.
It removes a complicated second call to FCU with the same head after
processing the last slot of the epoch.
Some checks for reviewers:
- the single caller of sendFCU held a lock to forkchoice. Since the call
now is in the background this helper can aquire the lock.
- All paths to handleEpochBoundary are now **NOT** locked. This allows
the lock to get the target root to be taken locally in place.
- The checkpoint cache is completely useless and thus the target root
call could be removed. But removing the proposer ID cache is more
complicated and out of scope for this PR.
- lateBlockTasks has pre and post-fulu cased, we could remove pre-fulu
checks and defer to the update function if deemed cleaner.
- Conversely, postBlockProcess does not have this casing and thus
pre-Fulu blocks on gossip may fail to get proposed correctly because of
the lack of the proposer being correctly computed.
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
Validation of `--backfill-oldest-slot` fails for values > 1056767,
because the validation code is comparing the slot/32 to
`MIN_EPOCHS_FOR_BLOCK_REQUESTS` (33024), instead of comparing it to
`current_epoch - MIN_EPOCHS_FOR_BLOCK_REQUESTS`.
**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: Kasey Kirkham <kasey@users.noreply.github.com>
In the event that the target checkpoint of an attestation is for the
previous epoch, and the head state has the same dependent root at that
epoch. The reason being that this guarantees that both seed and active
validator indices are guaranteed to be the same at the checkpoint's
epoch, from the point of view of the attester (even on a different
branch) and the head view.
**What type of PR is this?**
Tooling
**What does this PR do? Why is it needed?**
Renames `httperror` analyzer to `httpwriter` and extends it to the
following functions:
- `WriteError`
- `WriteJson`
- `WriteSsz`
_**NOTE: The PR is currently red because the fix in
https://github.com/OffchainLabs/prysm/pull/16175 must be merged first**_
**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).
SortedForkSchedule should never be empty for a properly initialized
network schedule, but the handler already had a branch to support an
empty result. Without an early return, we wrote a JSON response and then
still accessed schedule[0], which could panic and double-write the HTTP
response in misconfigured setups.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
<!-- 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?**
Performance
**What does this PR do? Why is it needed?**
`PendingBalanceToWithdraw` was used to find the `bal` only to check
later if `bal` is greater than 0 or not. No need to calculate the full
balance and we could just check if `bal` is greater than 0 or not by
using an existing function `HasPendingBalanceToWithdraw`. So this should
help in reducing some unnecessary computation.
`HasPendingBalanceToWithdraw` returns immediately on first match of
non-zero instance, while `PendingBalanceToWithdraw` always iterates
through all entries to compute the sum.
**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).
When computing payload attributes post-Fulu, we do not need to process
slots, nor copy the state if we need to find out if the node is
proposing in the next slot. This prevents an immediate epoch processing
after block 31 is processed unless we are actually proposing.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
When an (potentially aggregated) attestation is received **before** the
block being voted for, Prysm queues this attestation, then processes the
queue when the block has been received.
This behavior is consistent with the [Phase0 specification
](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id).
> [IGNORE] The block being voted for
(attestation.data.beacon_block_root) has been seen (via gossip or
non-gossip sources) (a client MAY queue attestations for processing once
block is retrieved).
Once the block being voted for is processed, previously queued
(potentially aggregated) attestations are then processed, and
broadcasted.
Processing (potentially aggregated) attestations takes some non
negligible time. For this reason, (potentially aggregated) attestations
are deduplicated before being introduced into the pending queue, to
avoid eventually processing duplicates.
Before this PR, two aggregated attestations were considered duplicated
if all of the following conditions were gathered:
1. Attestations have the same version,
2. **Attestations have the same aggregator index (aka., the same
validator aggregated them)**,
3. Attestations have the same slot,
4. Attestations have the same committee index, and
5. Attestations have the same aggregation bits
Aggregated attestations are then broadcasted.
The final purpose of aggregated attestations is to be packed into the
next block by the next proposer.
When packing attestations, the aggregator index is not used any more.
This pull request modifies the deduplication function used in the
pending aggregated attestations queue by considering that multiple
aggregated attestations only differing by the aggregator index are
equivalent (removing `2.` of the previous list.)
As a consequence, the count of aggregated attestations to be introduced
in the pending queue is reduced from 1 aggregated attestation by
aggregator to, in the best case,
[MAX_COMMITTEE_PER_SLOT=64](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#misc-1).
Also, only a single aggregated attestation for a given version, slot,
committee index and aggregation bits will be re-broadcasted. This is a
correct behavior, since no data to be included in a block will be lost.
(We can even say that this will reduce by a bit the total networking
volume.)
**How to test**:
1. Start a beacon node (preferably, on a slow computer) from a
checkpoint.
2. Filter logs containing `Synced new block` and `Verified and saved
pending attestations to pool`. (You can pipe logs into `grep -E "Synced
new block|Verified and saved pending attestations to pool"`.
- In `Synced new block` logs, monitor the `sinceSlotStartTime` value.
This should monotonically decrease.
- In `Verified and saved pending attestations to pool`, monitor the
`pendingAggregateAttAndProofCount` value. It should be a "honest" value.
"honest" is not really quantifiable here, since it depends on the
aggregators. But it's likely to be less than
`5*MAX_COMMITTEE_PER_SLOT=320`.
**Which issues(s) does this PR fix?**
Partially fixes:
- https://github.com/OffchainLabs/prysm/issues/16160
**Other notes for review**
Please read commit by commit, with commit messages.
The important commit is b748c04a67.
**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).
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
When we receive data column sidecars via gossip, if the sidecar does not
respect the validation rules, a scary ERROR log is displayed. We can't
to anything about it, since the error comes from an invalid incoming
sidecar, so there is no need to print an ERROR message.
Node: As all REJECTED gossip message, a DEBUG log is also always
displayed.
Example of ERROR log:
```
[2025-12-18 15:38:26.46] ERROR sync: Failed to decode message error=invalid ssz encoding. first variable element offset indexes into fixed value data
[2025-12-18 15:38:26.46] DEBUG sync: Gossip message was rejected agent=erigon/caplin error=invalid ssz encoding. first variable element offset indexes into fixed value data gossipScore=0 multiaddress=/ip4/141.147.32.105/tcp/9000 peerID=16Uiu2HAmHu88k97iBist1vJg7cPNuTjJFRARKvDF7yaH3Pv3Vmso topic=/eth2/c6ecb76c/data_column_sidecar_30/ssz_snappy
```
(After this PR, the DEBUG one will still be printed.)
**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).
<!-- 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?**
Prysm starting throwing this error `Could not write response message"
error="write tcp 10.104.92.212:5052->10.104.92.196:41876: write: broken
pipe` because a validator got attestation data from a synced node and
submitted attestation to a syncing node, when the node couldn't replay
the state the validator context deadlined and disconnected but the
writer when it finally responded tries to write it gets this broken pipe
error.
applies to `/eth/v2/beacon/pool/attestations` and
`/eth/v1/beacon/pool/sync_committees`
the solution is 2 part.
1. we shouldn't allow submission of an attestation if the node is
syncing because we can't save the attestation without the state
information.
2. we were doing the expensive state call before broadcast before in
rest and now it should match gRPC where it happens afterward in its own
go routine.
Tested manually running kurtosis with rest validators
```
participants:
# Super-nodes
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
count: 2
supernode: true
cl_extra_params:
- --subscribe-all-subnets
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
# Full-nodes
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
validator_count: 63
cl_extra_params:
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
cl_extra_params:
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
validator_count: 13
additional_services:
- dora
- spamoor
spamoor_params:
image: ethpandaops/spamoor:master
max_mem: 4000
spammers:
- scenario: eoatx
config:
throughput: 200
- scenario: blobs
config:
throughput: 20
network_params:
fulu_fork_epoch: 2
bpo_1_epoch: 8
bpo_1_max_blobs: 21
withdrawal_type: "0x02"
preset: mainnet
seconds_per_slot: 6
global_log_level: debug
```
**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).
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
This PR fixes the LC p2p `fork version not recognized` bug. It adds
object mappings for the LC types for Fulu, and fixes tests to cover such
cases in the future.
**What type of PR is this?**
Optimisation
**What does this PR do? Why is it needed?**
While constructing data column sidecars from the execution layer is very
cheap compared to reconstructing data column sidecars from data column
sidecars, it is still efficient to run this construction in parallel.
(**Reminder:** Using `getBlobsV2`, all the cell proofs are present, but
only 64 (out of 128) cells are present. Recomputing the missing cells is
cheap, while reconstruction the missing proofs is expensive.)
This PR:
- adds some metrics
- ensure the construction is done in parallel
**Other notes for review**
Please read commit by commit
The red vertical lines represent the limit between before and after this
pull request
<img width="1575" height="603" alt="image"
src="https://github.com/user-attachments/assets/24811b1b-8e3c-4bf5-ac82-f920d385573a"
/>
The last commit transforms the bottom right histogram to summary, since
it makes no sense any more to have an histogram for values.
Please check "hide whitespace" so this PR is easier to review:
<img width="229" height="196" alt="image"
src="https://github.com/user-attachments/assets/548cb2f4-b6f4-41d1-b3b3-4d4c8554f390"
/>
Updated metrics:
Now, for every **non missed slot**, for a block **with at least one
commitment**, we have either:
```
[2025-12-10 10:02:12.93] DEBUG sync: Constructed data column sidecars from the execution client count=118 indices=0-5,7-16,18-27,29-35,37-46,48-49,51-82,84-100,102-106,108-125,127 iteration=0 proposerIndex=855082 root=0xf8f44e7d4cbc209b2ff2796c07fcf91e85ab45eebe145c4372017a18b25bf290 slot=1928961 type=BeaconBlock
```
either
```
[2025-12-10 10:02:25.69] DEBUG sync: No data column sidecars constructed from the execution client iteration=2 proposerIndex=1093657 root=0x64c2f6c31e369cd45f2edaf5524b64f4869e8148cd29fb84b5b8866be529eea3 slot=1928962 type=DataColumnSidecar
```
<img width="1581" height="957" alt="image"
src="https://github.com/user-attachments/assets/514dbdae-ef14-47e2-9127-502ac6d26bc0"
/>
<img width="1596" height="916" alt="image"
src="https://github.com/user-attachments/assets/343d4710-4191-49e8-98be-afe70d5ffe1c"
/>
**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.
<!-- 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?**
Tests
**What does this PR do? Why is it needed?**
```
--- PASS: TestEndToEnd_MinimalConfig/chain_started (0.50s)
--
--- PASS: TestEndToEnd_MinimalConfig/finished_syncing_0 (0.00s)
--- PASS: TestEndToEnd_MinimalConfig/all_nodes_have_same_head_0 (0.00s)
--- PASS: TestEndToEnd_MinimalConfig/validators_active_epoch_0 (0.00s)
--- FAIL: TestEndToEnd_MinimalConfig/validator_sync_participation_0 (0.01s)
--- PASS: TestEndToEnd_MinimalConfig/peers_connect_epoch_0 (0.11s)
```
This PR attempts to reduce flakes on validator sync participation
failures by skipping the first slot of the block after startup
**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).
If there is a context deadline updating the committee cache, but the
indices have been computed correctly, do not error out but rather return
the indices and log the error.
<!-- 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?**
s.Stater.StateBySlot may replay if it's the current epoch as it's for
values in the db, if we are in the current we should try to get head
slot and use the cache, proposer duties was doing this already but the
other 2 duties endpoints was not. this pr aligns all 3 and introduces a
new `statebyepoch` that just wraps the approach.
I tested by running this kurtosis config with and without the fix to see
that the replays stop, the blockchain progresses, and the upgraded to
fulu is not printed multiple times
```
participants:
# Super-nodes
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
count: 2
supernode: true
cl_extra_params:
- --subscribe-all-subnets
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
# Full-nodes
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
validator_count: 63
cl_extra_params:
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
- el_type: nethermind
cl_type: prysm
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
cl_extra_params:
- --verbosity=debug
vc_extra_params:
- --enable-beacon-rest-api
- --verbosity=debug
validator_count: 13
additional_services:
- dora
- spamoor
spamoor_params:
image: ethpandaops/spamoor:master
max_mem: 4000
spammers:
- scenario: eoatx
config:
throughput: 200
- scenario: blobs
config:
throughput: 20
network_params:
fulu_fork_epoch: 2
bpo_1_epoch: 8
bpo_1_max_blobs: 21
withdrawal_type: "0x02"
preset: mainnet
seconds_per_slot: 6
global_log_level: debug
```
**Which issues(s) does this PR fix?**
Fixes # https://github.com/OffchainLabs/prysm/issues/16135
**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).
**What type of PR is this?**
Tooling
**What does the PR do?**
Every call to `httputil.HandleError` must be followed by a `return`
statement. It's easy to miss this during reviews, so having a static
analyzer that enforces this will make our life easier.
**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>
`validateWithKzgBatchVerifier` could timeout (12s) and once it times out
because `resChan` is unbuffered, the verifier will stuck at following
line at `verifyKzgBatch` as its waiting for someone to grab the result
from `resChan`:
```
for _, verifier := range kzgBatch {
verifier.resChan <- verificationErr
}
```
Fix is to make kzg batch verification non blocking on timeouts by
buffering each request’s buffered size 1
Ensure SubmitAttesterSlashingsV2 returns immediately when the
Eth-Consensus-Version header is missing. Without this early return the
handler calls version.FromString with an empty value and writes a second
JSON error to the response, producing invalid JSON and duplicating error
output. This change aligns the handler with the error-handling pattern
used in other endpoints that validate the version header.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
Calls to `Stater.StateBySlot` and `Stater.State` should be followed by
`shared.WriteStateFetchError` to provide the most robust error handling.
**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).
<!-- 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?**
Design Doc
**What does this PR do? Why is it needed?**
This PR adds a design doc for adding graffiti. The idea is to have it
populated judiciously so that we can get proper information about the
EL, CL and their corresponding version info. At the same time being
flexible enough with the user input.
**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 to this PR with sufficient context for
reviewers to understand this PR.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
This pull request modifies the `PULL_REQUEST_TEMPLATE.md` to ensure the
developer checked that their PR works as expected.
Some contributors push some changes, without even running the modified
client once to see if their changes work as expected.
Avoidable back-and-forth trips between the contributor and the reviewers
could be prevented thanks to running the modified client.
**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: Preston Van Loon <pvanloon@offchainlabs.com>
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
**Which issues(s) does this PR fix?**
**Other notes for review**
Did not delete the fragments as they are still needed to generate v7.1.0
release notes. This release is all cherry-picks which would be included
in v7.1.0
**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.
A TOCTOU issue was reported by EF security in which two attestations
being validated at the same time may result in both of them being
forwarded. The spec says that we need to forward only the first one.
<!-- 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?**
- Remove unnecessary `Copy()` call in `Eth1DataHasEnoughSupport`
- `data.Copy()` was called on every iteration of the vote counting loop,
even though `AreEth1DataEqual` only reads the data and never mutates it.
- Additionally, `Eth1DataVotes()` already returns copies of all votes,
so state is protected regardless.
**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 to this PR with sufficient context for
reviewers to understand this PR.
<!-- 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?**
The for loop in MigrateToCold function was brute force in nature. It
could be improved by just directly jumping by `slotsPerArchivedPoint`
rather than going over every single slot.
```
for slot := oldFSlot; slot < fSlot; slot++ {
...
if slot%s.slotsPerArchivedPoint == 0 && slot != 0 {
```
No need to do the modulo for every single slot.
We could just find the correct starting point and jump by
slotsPerArchivedPoint at a time.
**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 to this PR with sufficient context for
reviewers to understand this PR.
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
The constructor `NewStateRootNotFoundError` incorrectly returned
`StateNotFoundError`. This prevented handlers that rely on
errors.As(err, *lookup.StateRootNotFoundError) from matching and mapping
the error to HTTP 404. The function now returns
StateRootNotFoundError and constructs that type, restoring the intended
behavior for “state root not found” cases.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This PR introduces flag `--ignore-unviable-attestations` (replaces and
deprecates `--disable-last-epoch-targets`) to drop attestations whose
target state is not viable; default remains to process them unless
explicitly enabled.
The head state is guaranteed to have the same shuffling and active
indices if the previous dependent root coincides with the target
checkpoint's in some cases.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
Move the "Not enough connected peers" (for a given subnet) from WARN to
DEBUG
**Rationale:**
The
<img width="1839" height="31" alt="image"
src="https://github.com/user-attachments/assets/44dbdc8d-3e37-42ee-967b-75a7a1fbcafb"
/>
log is (potentially) printed every 5 minutes.
Every 5 minutes, the BN checks if, for a given subnet, the actual count
of peers is at least equal to a minimum one.
If not, this kind of log is printed.
When validators are connected and selected to be an aggregator in the
next epoch, the BN needs to subscribe and find new peers in the
corresponding attestation subnet.
If, right after the beacon is subscribed (but before it had time to find
peers), the "5 min ticker" ticks, then this warning log is displayed,
even if the slot for which the validator is selected as an aggregator is
still minutes away.
For this reason, this log is moved from WARN to DEBUG
**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.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
This pull request removes `NUMBER_OF_COLUMNS` and
`MAX_CELLS_IN_EXTENDED_MATRIX` configuration.
**Other notes for review**
Please read commit by commit, with commit messages.
**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.
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
- Added log prefix to the `genesis` package.
- Added log prefix to the `params` package.
- `WithGenesisValidatorsRoot`: Use camelCase for log field param.
- Move `Origin checkpoint found in db` log from WARN to INFO, since it
is the expected behaviour.
**Other notes for review**
Please read commit by commit
**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.
<!-- 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?**
Allows for starting e2e tests from electra or a specific fork of
interest again. doesn't fix missing execution requests tests, nishant
reverted 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 to this PR with sufficient context for
reviewers to understand this PR.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
The slot parameter in blobCacheEntry.filter was unused and redundant.
All slot/epoch-sensitive checks happen before filter
(commitmentsToCheck), and disk availability is handled via
BlobStorageSummary (epoch-aware).
Changes:
- Drop slot from blobCacheEntry.filter signature.
- Update call sites in availability_blobs.go and blob_cache_test.go.
Mirrors the data_column_cache.filter API (which does not take slot),
reduces API noise, and removes dead code without changing behavior.
<!-- 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?**
Feature
**What does this PR do? Why is it needed?**
| Feature | Semi-Supernode | Supernode |
| ----------------------- | ------------------------- |
------------------------ |
| **Custody Groups** | 64 | 128 |
| **Data Columns** | 64 | 128 |
| **Storage** | ~50% | ~100% |
| **Blob Reconstruction** | Yes (via Reed-Solomon) | No reconstruction
needed |
| **Flag** | `--semi-supernode` | `--supernode` |
| **Can serve all blobs** | Yes (with reconstruction) | Yes (directly) |
**note** if your validator total effective balance results in more
custody than the semi-supernode it will override those those
requirements.
cgc=64 from @nalepae
Pro:
- We are useful to the network
- Less disconnection likelihood
- Straight forward to implement
Con:
- We cannot revert to a full node
- We have to serve incoming RPC requests corresponding to 64 columns
Tested the following using this kurtosis setup
```
participants:
# Super-nodes
- el_type: geth
el_image: ethpandaops/geth:master
cl_type: prysm
vc_image: gcr.io/offchainlabs/prysm/validator:latest
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
count: 2
cl_extra_params:
- --supernode
vc_extra_params:
- --verbosity=debug
# Full-nodes
- el_type: geth
el_image: ethpandaops/geth:master
cl_type: prysm
vc_image: gcr.io/offchainlabs/prysm/validator:latest
cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
count: 2
validator_count: 1
cl_extra_params:
- --semi-supernode
vc_extra_params:
- --verbosity=debug
additional_services:
- dora
- spamoor
spamoor_params:
image: ethpandaops/spamoor:master
max_mem: 4000
spammers:
- scenario: eoatx
config:
throughput: 200
- scenario: blobs
config:
throughput: 20
network_params:
fulu_fork_epoch: 0
withdrawal_type: "0x02"
preset: mainnet
global_log_level: debug
```
```
curl -H "Accept: application/json" http://127.0.0.1:32961/eth/v1/node/identity
{"data":{"peer_id":"16Uiu2HAm7xzhnGwea8gkcxRSC6fzUkvryP6d9HdWNkoeTkj6RSqw","enr":"enr:-Ni4QIH5u2NQz17_pTe9DcCfUyG8TidDJJjIeBpJRRm4ACQzGBpCJdyUP9eGZzwwZ2HS1TnB9ACxFMQ5LP5njnMDLm-GAZqZEXjih2F0dG5ldHOIAAAAAAAwAACDY2djQIRldGgykLZy_whwAAA4__________-CaWSCdjSCaXCErBAAE4NuZmSEAAAAAIRxdWljgjLIiXNlY3AyNTZrMaECulJrXpSOBmCsQWcGYzQsst7r3-Owlc9iZbEcJTDkB6qIc3luY25ldHMFg3RjcIIyyIN1ZHCCLuA","p2p_addresses":["/ip4/172.16.0.19/tcp/13000/p2p/16Uiu2HAm7xzhnGwea8gkcxRSC6fzUkvryP6d9HdWNkoeTkj6RSqw","/ip4/172.16.0.19/udp/13000/quic-v1/p2p/16Uiu2HAm7xzhnGwea8gkcxRSC6fzUkvryP6d9HdWNkoeTkj6RSqw"],"discovery_addresses":["/ip4/172.16.0.19/udp/12000/p2p/16Uiu2HAm7xzhnGwea8gkcxRSC6fzUkvryP6d9HdWNkoeTkj6RSqw"],"metadata":{"seq_number":"3","attnets":"0x0000000000300000","syncnets":"0x05","custody_group_count":"64"}}}
```
```
curl -s http://127.0.0.1:32961/eth/v1/debug/beacon/data_column_sidecars/head | jq '.data | length'
64
```
```
curl -X 'GET' \
'http://127.0.0.1:32961/eth/v1/beacon/blobs/head' \
-H 'accept: application/json'
```
**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 to this PR with sufficient context for reviewers to understand this PR.
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: james-prysm <jhe@offchainlabs.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
I am seeing massive metrics cardinality on error cases.
Example:
```
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682952",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682953",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682954",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682955",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682956",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682957",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682958",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682959",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682960",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682961",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682962",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682966",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682967",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682968",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682969",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682970",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682971",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682972",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682973",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682974",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682975",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682976",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682977",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682978",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682980",method="GET"} 2
http_error_count{code="Not Found",endpoint="/eth/v1/beacon/blob_sidecars/1682983",method="GET"} 2
```
Now it looks like this:
```
# TYPE http_error_count counter
http_error_count{code="Not Found",endpoint="beacon.GetBlockV2",method="GET"} 606
http_error_count{code="Not Found",endpoint="blob.Blobs",method="GET"} 4304
```
**Which issues(s) does this PR fix?**
**Other notes for review**
Other uses of http metrics use the endpoint name rather than the request
URL.
**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.
This change ensures FlagOptions in cmd/beacon-chain/execution/options.go
appends only one endpoint option depending on whether a JWT secret is
present. Previously the code always appended WithHttpEndpoint and then
conditionally appended WithHttpEndpointAndJWTSecret which overwrote the
first option, adding unnecessary allocations and cognitive overhead.
Since WithHttpEndpointAndJWTSecret fully configures the endpoint,
including URL and Bearer auth needed by the Engine API, the initial
WithHttpEndpoint is redundant when a JWT is supplied. The refactor
preserves behavior while simplifying option composition and avoiding
redundant state churn.
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
When unmarshaling a block with fastssz, if the target block's
`ExecutionRequests` field is nil, it will not get populated
```
if b.ExecutionRequests == nil {
b.ExecutionRequests = new(v1.ExecutionRequests)
}
if err = b.ExecutionRequests.UnmarshalSSZ(buf); err != nil {
return err
}
```
This is true for other fields and that's why we initialize them in our
gossip data maps. There is no bug at the moment because even if
execution requests are nil, we initialize them in
`consensus-types/blocks/proto.go`
```
er := pb.ExecutionRequests
if er == nil {
er = &enginev1.ExecutionRequests{}
}
```
However, since we initialize other fields in the data map, it's safer to
do it for execution requests too, to avoid a bug in case the code in
`consensus-types/blocks/proto.go` changes in the future.
**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.
**What type of PR is this?**
Feature
**What does this PR do? Why is it needed?**
This PR adds integrates state-diff into `HasState()`.
One thing to note: we are assuming that, for a given block root, that
has either a state summary or a block in db, and also falls in the state
diff tree, then there must exist a state. This function could return
true, even when there is no actual state saved due to any error.
But this is fine, because we have that assumption throughout the whole
state diff feature.
**Review after #16033 is merged**
**What type of PR is this?**
Other
**What does this PR do? Why is it needed?**
This PR refactors the code to find the corresponding slot of a given
block root using state summary or the block itself, into its own
function `SlotByBlockRoot(ctx, blockroot)`.
Note that there exists a function `slotByBlockRoot(ctx context.Context,
tx *bolt.Tx, blockRoot []byte)` immediately below the new function. Also
note that this function has two drawbacks, which led to creation of the
new function:
- the old function requires a boltdb tx, which is not necessarily
available to the caller.
- the old function does NOT make use of the state summary cache.
edit:
- the old function also uses the state bucket to retrieve the state and
it's slot. this is not something we want in the state diff feature,
since there is no state bucket.
**What type of PR is this?**
Feature
**What does this PR do? Why is it needed?**
This PR integrates the state diff path into the `State()` function from
`db/kv`, which allows reading of states using the state diff db, when
the `EnableStateDiff` flag is enabled.
**Notes for reviewers:**
Files `kv/state_diff_test.go` and `config/features/config.go` only
contain renamings:
- `kv/state_diff_test.go`: rename `setDefaultExponents()` to
`setDefaultStateDiffExponents()` to be less vague.
- `config/features/config.go`: rename `enableStateDiff` to
`EnableStateDiff` to make it public.
<!-- 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?**
Previously, JWT secrets longer than 256 bits could cause client
compatibility issues. For example, Prysm would accept longer secrets
while Geth strictly requires exactly 32 bytes, causing Geth startup
failures when using the same secret file.
This change enforces the Engine API specification requirement that JWT
secrets must be exactly 256 bits (32 bytes), ensuring consistent
behavior across different client implementations.
**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 to this PR with sufficient context for
reviewers to understand this PR.
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
## **Description:**
**What type of PR is this?**
> Bug fix
**What does this PR do? Why is it needed?**
Replaces fixed `time.Sleep(time.Second)` delays in `TestLifecycle` with
active polling to wait for service readiness/shutdown. This improves
test reliability and reduces execution time by eliminating unnecessary
waits when services start/stop faster than expected.
**Which issues(s) does this PR fix?**
N/A - Minor test improvement
**Other notes for review**
- Uses 50ms polling interval with 3s timeout for both startup and
shutdown checks
- Maintains same test logic while making it more efficient and less
flaky
- No functional changes to the service itself
**Acknowledgements**
- [x] 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).
- [x] I have added a description to this PR with sufficient context for
reviewers to understand this PR.
This PR removes the last production usage for: `LastArchivedRoot` by
- extend the P2P config to accept a `StateGen` dependency and wire it up
from the beacon node
- update gossip scoring to read the active validator count via stategen
using last finalized block root
note: i think the correct implementation should process last finalizes
state to current slot, but that's a bigger change i dont want to make in
this PR, i just want to remove usages for `LastArchivedRoot`
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
This PR fixes a bug in the state diff `getBaseAndDiffChain()` method. In
the process of finding the diff chain indices, there could be a scenario
where multiple levels return the same diff slot number not equal to the
base (full snapshot) slot number.
This resulted in multiple diff items being added to the diff chain for
the same slot, but on different levels, which resulted in errors reading
the diff.
Fix: we keep a `lastSeenAnchorSlot` equal to the `BaseAnchorSlot` and
update it every time we see a new anchor slot. We ignore if the current
found anchor slot is equal to the `lastSeenAnchorSlot`.
Scenario example:
exponents: [20, 14, 10, 7, 5]
offset: 0
slots saved: slot 2^11, and slot (2^11 + 2^5)
slot to read: slot (2^11 + 2^5)
resulting list of anchor slots (diff chain indices): [0, 0, 2^11, 2^11,
2^11 + 2^5]
* stop emitting payload attribute events during late block handling when we are not proposing the next slot
* Change the behavior to not even enter FCU if we are not proposing next slot
* Vendor go-bip39 dependency locally to third_party/
The github.com/tyler-smith/go-bip39 repository has been deleted from GitHub
but is still needed for BIP-39 mnemonic functionality in the validator wallet
system. This change vendors v1.1.0 of the library into third_party/go-bip39/
to ensure continued availability.
Changes:
- Copy go-bip39 v1.1.0 source from Go module cache to third_party/go-bip39/
- Create BUILD.bazel files for main package and wordlists subpackage
- Update 5 BUILD.bazel files to reference local vendored version instead of external dependency
- Remove go-bip39 from go.mod and deps.bzl
- All builds and tests pass successfully
The vendored package includes all 9 language wordlists (English, Chinese Simplified/Traditional,
Czech, French, Italian, Japanese, Korean, Spanish) and maintains the original import paths for
compatibility.
* Changelog fraagment
* use go mod replace for vendored lib
* Run gazelle
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* init
* reverting some functions
* rolling back a change and fixing linting
* wip
* wip
* fixing test
* breaking up proofs and cells for cleaner code
* fixing test and type
* fixing safe conversion
* fixing test
* fixing more tests
* fixing even more tests
* fix the 0 indices option
* adding a test for coverage
* small test update
* changelog
* radek's suggestions
* Update beacon-chain/core/peerdas/validator.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* addressing comments on kzg package
* addressing suggestions for reconstruction
* more manu feedback items
* removing unneeded files
* removing unneeded setter
---------
Co-authored-by: james-prysm <jhe@offchainlabs.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Reverted all config.FuluForkEpoch = config.FarFutureEpoch from 8b6f187b15
* Fix tests by referencing electra epoch / slot values in requests and test setup
* Changelog fragment
* wip
* fixing tests
* adding script to update workspace for eth clients
* updating test sepc to 1.6.0 and fixing broadcaster test
* fix specrefs
* more ethspecify fixes
* still trying to fix ethspecify
* fixing attestation tests
* fixing sha for consensus specs
* removing script for now until i have something more standard
* fixing more p2p tests
* fixing discovery tests
* attempting to fix discovery test flakeyness
* attempting to fix port binding issue
* more attempts to fix flakey tests
* Revert "more attempts to fix flakey tests"
This reverts commit 25e8183703.
* Revert "attempting to fix port binding issue"
This reverts commit 583df8000d.
* Revert "attempting to fix discovery test flakeyness"
This reverts commit 3c76525870.
* Revert "fixing discovery tests"
This reverts commit 8c701bf3b9.
* Revert "fixing more p2p tests"
This reverts commit 140d5db203.
* Revert "fixing attestation tests"
This reverts commit 26ded244cb.
* fixing attestation tests
* fixing more p2p tests
* fixing discovery tests
* attempting to fix discovery test flakeyness
* attempting to fix port binding issue
* more attempts to fix flakey tests
* changelog
* fixing import
* adding some missing dependencies, but TestService_BroadcastAttestationWithDiscoveryAttempts is still failing
* attempting to fix test
* reverting test as it migrated to other pr
* reverting test
* fixing test from merge
* Fix `TestService_BroadcastAttestationWithDiscoveryAttempts`.
* Fix again `TestService_Start_OnlyStartsOnce`.
* fixing TestListenForNewNodes
* removing manual set of fulu epoch
* missed a few
* fixing subnet test
* Update beacon-chain/rpc/eth/config/handlers_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* removing a few more missed spots of reverting fulu epoch setting
* updating test name based on feedback
* fixing rest apis, they actually need the setting of the epoch due to the guard
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Remove Beacon API endpoints that were deprecated in Electra
* changelog <3
* build fix
* remove more stuff
* fix post-submit e2e and remove structs
* list endpoints in the changelog
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Use head for block validation when possible
When validating blocks for pubsub, we always copy a state and advance
when we simply need to get a read only beacon state without a copy in
most cases since the head state normally works.
* fix test
* fix tests
* fix more tests
* fix more tests
* Add nil check to be safe
* fix more tests
* add test case
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Only use head if it's compatible with target
* Allow blocks from the previous epoch to be viable for checkpoints
* Add feature flag to make it configurable
* fix tests
* @satushh's review
* Manu's nit
* Use fields in logs
* Set default value of `--blob-batch-limit` to 384.
So, using default values, `--blob-batch-limit * --blob-batch-limit-burst-factor = 384*3 = MAX_REQUEST_BLOB_SIDECARS = 1152.`
* `blobSidecarByRootRPCHandler`: Add rate limiting.
Bacause now the rate limiter validation is done before the request validation,
adapt `TestBlobsByRootValidation` consequently and add new specific tests for
`validateBlobByRootRequest` to cover the now untested case.
* Set default value of `--data-column-batch-limit-burst-factor` to 4.
So, using default values, `--data-column-batch-limit * --data-column-batch-limit-burst-factor = 4096*2 = MAX_REQUEST_DATA_COLUMN_SIDECARS_ELECTRA = 16384`.
* `validateDataColumnsByRootRequest`: Take a count instead of idents.
* `dataColumnSidecarByRootRPCHandler`: Add rate limiting.
* `SidecarProposerExpected`: Add the slot in the single flight key.
* Fix Kasey's comment.
* Revert "Fix Kasey's comment."
This reverts commit 9e3b4b7acf.
* `signatureData`: Add `string` function.
* `RODataColumnsVerifier.ValidProposerSignature`: Ensure the expensive signature verification is only performed once for concurrent requests for the same signature data.
Share flight group
* `parentState` ==> `state`.
* `RODataColumnsVerifier.SidecarProposerExpected: Ensure the expensive index computation is only performed once for concurrent requests.`
* Add `wrapAttestationError`
* Fix Kasey's comment.
* Fix Terence's comment.
* updated path processing data types, refactored ParsePath and fixed tests
* updated generalized index accordingly, changed input parameter path type from []PathElemen to Path
* updated query.go accordingly, changed input parameter path type from []PathElemen to Path
* added descriptive changelog
* Update encoding/ssz/query/path.go
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
* Added documentation for Path struct and renamed to for clarity
* Update encoding/ssz/query/path.go
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* updated changelog to its correct type: Changed
* updated outdated comment in generalized_index.go and removed test in generalized_index_test.go as this one belongs in path_test.go
* Added validateRawPath with strict raw-path validation only - no raw-path fixing is added. Added test suite covering
* added extra tests for wrongly formated paths
---------
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Add a lock for p2p computation of active validator count and limit only to topics that need it.
* Changelog fragment
* Update gossip_scoring_params.go
Wrap errors
* Implement `AvailableBlocks`.
* `blobSidecarByRootRPCHandler`: Do not serve a sidecar if the corresponding block is not available.
* `dataColumnSidecarByRootRPCHandler`: Do not do extra work if only needed for TRACE logging.
* `TestDataColumnSidecarsByRootRPCHandler`: Re-arrange (no functional change).
* `TestDataColumnSidecarsByRootRPCHandler`: Save blocks corresponding to sidecars into DB.
* `dataColumnSidecarByRootRPCHandler`: Do not serve a sidecar if the corresponding block is not available.
* Add changelog
* `TestDataColumnSidecarsByRootRPCHandler`: Use `assert` instead of `require` in goroutines.
https://github.com/stretchr/testify?tab=readme-ov-file#require-package
* added tests for calculating generalized indices
* added first version of GI calculation walking the specified path with no recursion. Extended test coverage for bitlist and bitvectors.
vectors need more testing
* refactored code. Detached PathElement processing, currently done at the beginning. Swap to regex to gain flexibility.
* added an updateRoot function with the GI formula. more refactoring
* added changelog
* replaced TODO tag
* udpated some comments
* simplified code - removed duplicated code in processingLengthField function
* run gazelle
* merging all input path processing into path.go
* reviewed Jun's feedback
* removed unnecessary idx pointer var + fixed error with length data type (uint64 instead of uint8)
* refactored path.go after merging path elements from generalized_indices.go
* re-computed GIs for tests as VariableTestContainer added a new field.
* added minor comment - rawPath MUST be snake case
removed extractFieldName func.
* fixed vector GI calculation - updated tests GIs
* removed updateRoot function in favor of inline code
* path input data enforced to be snake case
* added sanity checks for accessing outbound element indices - checked against vector.length/list.limit
* fixed issues triggered after merging develop
* Removed redundant comment
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
* removed unreachable condition as `strings.Split` always return a slice with length >= 1
If s does not contain sep and sep is not empty, Split returns a slice of
length 1 whose only element is s.
* added tests to cover edge cases + cleaned code (toLower is no longer needed in extractFieldName function
* added Jun's feedback + more testing
* postponed snake case conversion to do it on a per-element-basis. Added more testing focused mainly in snake case conversion
* addressed several Jun's comments.
* added sanity check to prevent length of a multi-dimensional array. added more tests with extended paths
* Update encoding/ssz/query/generalized_index.go
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* Update encoding/ssz/query/generalized_index.go
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* Update encoding/ssz/query/generalized_index.go
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* placed constant bitsPerChunk in the right place. Exported BitsPerChunk and BytesPerChunk and updated code that use them
* added helpers for computing GI of each data type
* changed %q in favor of %s
* Update encoding/ssz/query/path.go
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
* removed the least restrictive condition isBasicType
* replaced length of containerInfo.order for containerInfo.fields for clarity
* removed outdated comment
* removed toSnakeCase conversion.
* moved isBasicType func to its natural place, SSZType
* cosmetic refactor
- renamed itemLengthFromInfo to itemLength (same name is in spec).
- arranged all SSZ helpers.
* cleaned tests
* renamed "root" to "index"
* removed unnecessary check for negative integers. Replaced %q for %s.
* refactored regex variables and prevented re-assignation
* added length regex explanation
* added more testing for stressing regex for path processing
* renamed currentIndex to parentIndex for clarity and documented the returns from calculate<Type>GeneralizedIndex functions
* Update encoding/ssz/query/generalized_index.go
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* run gazelle
* fixed never asserted error. Updated error message
---------
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Define TCP and QUIC as `InternetProtocol` (no functional change).
* Group types. (No functional changes)
* Rename variables and use range syntax.
* Add `p2pMaxPeers` and `p2pPeerCountDirectionType` metrics
* `p2p_subscribed_topic_peer_total`: Reset to avoid dangling values.
* `validateConfig`:
- Use `Warning` with fields instead of `Warnf`.
- Avoid to both modify in place the input value and return it.
* Add `p2p_minimum_peers_per_subnet` metric.
* `beaconConfig` => `cfg`.
https://github.com/OffchainLabs/prysm/pull/15880#discussion_r2436826215
* Add changelog
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* default new blob storage layouts to by-epoch
also, do not log migration message until we see a directory that needs to be migrated
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* manu feedback
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update Earliest available slot when pruning
* bazel run //:gazelle -- fix
* custodyUpdater interface to avoid import cycle
* bazel run //:gazelle -- fix
* simplify test
* separation of concerns
* debug log for updating eas
* UpdateEarliestAvailableSlot function in CustodyManager
* fix test
* UpdateEarliestAvailableSlot function for FakeP2P
* lint
* UpdateEarliestAvailableSlot instead of UpdateCustodyInfo + check for Fulu
* fix test and lint
* bugfix: enforce minimum retention period in pruner
* remove MinEpochsForBlockRequests function and use from config
* remove modifying earliest_available_slot after data column pruning
* correct earliestAvailableSlot validation: allow backfill decrease but prevent increase within MIN_EPOCHS_FOR_BLOCK_REQUESTS
* lint
* bazel run //:gazelle -- fix
* lint and remove unwanted debug logs
* Return a wrapped error, and let the caller decide what to do
* fix tests because updateEarliestSlot returns error now
* avoid re-doing computation in the test function
* lint and correct changelog
* custody updater should be a mandatory part of the pruner service
* ensure never increase eas if we are in the block requests window
* slot level granularity edge case
* update the value stored in the DB
* log tidy up
* use errNoCustodyInfo
* allow earliestAvailableSlot edit when custodyGroupCount doesnt change
* undo the minimal config change
* add context to CustodyGroupCount after merging from develop
* cosmetic change
* shift responsibility from caller to callee, protection for updateEarliestSlot. UpdateEarliestAvailableSlot returns cgc
* allow increase in earliestAvailableSlot only when custodyGroupCount also increases
* remove CustodyGroupCount as it is no longer needed as UpdateEarliestAvailableSlot returns cgc now
* proper place for log and name refactor
* test for Nil custody info
* allow decreasing earliest slot in DB (just like in memory)
* invert if statement to make more readable
* UpdateEarliestAvailableSlot for DB (equivalent of p2p's UpdateEarliestAvailableSlot) & undo changes made to UpdateCustodyInfo
* in UpdateEarliestAvailableSlot, no need to return unused values
* no need to log stored group count
* log.WithField instead of log.WithFields
* Add serialization code for state diffs
Adds serialization code for state diffs.
Adds code to create and apply state diffs
Adds fuzz tests and benchmarks for serialization/deserialization
Co-authored-by: Claude <noreply@anthropic.com>
* Add Fulu support
* Review #1
* gazelle
* Fix some fuzzers
* Failing cases from the fuzzers in consensus-types/hdiff
* Fix more fuzz tests
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add comparison tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Use ConvertToElectra in UpgradeToElectra
* Add comments on constants
* Fix readEth1Data
* remove colons from error messages
* Add design doc
* Apply suggestions from code review
Bast
Co-authored-by: Bastin <43618253+Inspector-Butters@users.noreply.github.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
Co-authored-by: Bastin <43618253+Inspector-Butters@users.noreply.github.com>
* Move ssz_query objects into testing folder (ensuring test objects only used in test environment)
* Add containers for response
* Export sszInfo
* Add QueryBeaconState/Block
* Add comments and few refactor
* Fix merge conflict issues
* Return 500 when calculate offset fails
* Add test for QueryBeaconState
* Add test for QueryBeaconBlock
* Changelog :)
* Rename `QuerySSZRequest` to `SSZQueryRequest`
* Fix middleware hooks for RPC to accept JSON from client and return SSZ
* Convert to `SSZObject` directly from proto
* Move marshalling/calculating hash tree root part after `CalculateOffsetAndLength`
* Make nogo happy
* Add informing comment for using proto unsafe conversion
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fixed metadata extraction on Windows by correctly splitting file paths
* `TestExtractFileMetadata`: Refactor a bit.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* `VerifiedRODataColumnError`: Don't reuse Blob error.
* `VerifiedRODataColumnFromDisk`: Use a specific error when the count of read bytes is lower than expected.
* Add changelog.
* Add basic parsing feature for accessing by index
* Add more tests for 2d byte vector
* Add List case for access indexing
* Handle 2D bytes List example
* Fix misleading cases for CalculateOffsetAndLength
* Use elementSizes[index] if it is the last path element
* Add variable_container_list field for mocking attester_slashings in BeaconBlockBody
* Remove redundant protobuf message
* Better documentation
* Changelog
* Fix `expectedSize` of `VariableTestContainer`: as we added `variable_container_list` here
* Apply reviews from Radek
* reject committee index >= committees_per_slot in unaggregated attestation validation
* Create phrwlk_fix-attestation-committee-index-bound.md
* add a unit test
* fix test
* fixing test
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>
h/t to the NuConstruct team for reporting this. The event feed
incorrectly sends epoch transition flag on head events when the first
slot of the epoch is missing (or reorgs across epoch transition).
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* `TestDataColumnSidecarsByRangeRPCHandler`: Remove commented code.
* Remove double import
* `dataColumnSidecarsByRangeRPCHandler`: Gracefully close the stream if no data to return.
* Tests: Change `require` to `assert` in goroutines in tests.
https://pkg.go.dev/github.com/stretchr/testify/require#hdr-Assertions
* Add changelog.
* Fix `/eth/v1/beacon/blob_sidecars/` beacon API is the fulu fork epoch is set to the far future epoch.
* Fix Terence's comment.
* adding a test
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* Add SizeSSZ as a member of SSZObject
* Temporarily rename dereferencePointer function
* Fix analyzeType: use reflect.Value for analyzing
* Fix PopulateVariableLengthInfo: change function signature & reset pointer
* Remove Container arm for Size function as it'll be handled in the previous branch
* Remove OffsetBytes function in listInfo
* Refactor and document codes
* Remove misleading "fixedSize" concept & Add Uint8...64 SSZTypes
* Add size testing
* Move TestSSZObject_Batch and rename it as TestHashTreeRoot
* Changelog :)
* Rename endOffset to fixedOffset
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* stored CL object to enable the usage Fastssz's HashTreeRoot(). added basic test
* refactorization - using interfaces instead of storing original object
* added tests covering ssz custom types
* renamed hash_tree_root to ssz_interface as it contains MarshalSSZ and UnmarshalSSZ functions
* run gazelle
* renamed test and improved comments
* refactored test and extend to marshalSSZ and UnmarshalSSZ
* added changelog
* updated comment
* Changed SSZIface name to SSZObject. Removed MarshalSSZ and UnmarshalSSZ function signatures from interface as they are not used still. Refactored tests.
* renamed file ssz_interface.go to ssz_object.go. merge test from ssz_interface_test.go into query_test.go.
reordered source SSZObject field from sszInfo struct
* sticked SSZObject interface to HashTreeRoot() function, the only one needed so far
* run gazelle :)
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix allocation size of proofs in ComputeCellsAndProofsFromStructured
the preallocated slice for KZG Proofs was 48x bigger than it needed to
be.
* changelog
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Do not verify block data when calculating rewards
* remove `Get` from function names
* changelog <3
* do not verify sync committee sig in handler
* Revert "remove `Get` from function names"
This reverts commit 770a89d990.
* typo fix
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* feature: Use service context and continue on slasher attestation errors
* Create Galoretka_feature-slasher-feed-use-service-ctx
* Rename Galoretka_feature-slasher-feed-use-service-ctx to Galoretka_feature-slasher-feed-use-service-ctx.md
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* make registerSubscribers idempotent
* clean up debugging changes
* test fix
* rm unused var
* sobbing noises
* naming feedback and separate test for digestActionDone
* gazelle
* manu's feedback
* refactor to enable immediate sub after init sync
* preston comment re panic causing db corruption risk
* ensure we check that we're 1 epoch past the fork
* manu feedback
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `findPeersWithSubnets`: If the `filter` function returns an error for a given peer, log an error and skip the peer instead of aborting the whole function.
* `computeIndicesByRootByPeer`: If the loop returns an error for a given peer, log an error and skip the peer instead of aborting the whole function.
* Add changelog.
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* `buildStatusFromStream`: Use parent context.
* Status tests: Use `t.Context` everywhere.
* `buildStatusFromStream`: Respond statusV2 only if Fulu is enabled.
Without doing so, earliest available slot is never defined, and then `s.cfg.p2p.EarliestAvailableSlot` will block until the context is canceled.
* Send our real earliest available slot when sending a Status request post Fulu instead of `0`.
* Add changelog.
* Prettify logs for byRange/byRoot data column sidecar requests.
* Moving byRoot/byRange data column sidecars requests from peers to TRACE level.
* Move "Peer requested blob sidecar by root not found in db" in TRACE.
* Add changelog.
* Fix Kasey's comment.
* Apply Kasey's suggestion.
* Revert "`createLocalNode`: Wait before retrying to retrieve the custody group count if not present. (#15735)"
This reverts commit 4585cdc932.
* Revert "Fix no custody info available at start (#15732)"
This reverts commit 80eba4e6dd.
* Add context to `EarliestAvailableSlot` and `CustodyGroupCount` (no functional change).
* Remove double imports.
* `EarliestAvailableSlot` and `CustodyGroupCount`: Wait for custody info to be initialized.
* exclude unscheduled forks from the schedule
* update tests that relied on fulu being far future
* don't mess with the version->epoch mapping
* LastFork cheats the tests by filtering by far_future_epoch
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* ignore version/digest mismatch if far future
* bonus: this log generates a lot of noise, bump it down to trace
* unit test
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Avoid unnecessary calls to ExitInformation()
ExitInformation runs a loop over the whole validator set. This is needed
in case that there are slashings or exits to be processed in a block (we
could be caching or avoid this entirely post-Electra though). This PR
removes these calls on normal state transition to this function. h/t to
@terencechain for finding out this bug.
In addition, on processing withdrawal requests and registry updates, we
kept recomputing the exit information at the same time that the state is
updated and the function that updates the state already takes care of
tracking and updating the right exit information. So this PR removes the
calls to compute this exit information on a loop. Notice that this bug
has been present even before we had a function `ExitInformation()` so I
will document here to help the reviewer
Our previous behavior is to do this in a loop
```
st, err = validators.InitiateValidatorExit(ctx, st, vIdx, validators.ExitInformation(st))
```
This is a bit problematic since `ExitInformation` loops over the whole validator set to compute the exit information (and the total active balance) and then the function `InitiateValidatorExit` actually recomputes the total active balance looping again over the whole validator set and overwriting the pointer returned by `ExitInformation`.
On the other hand, the funciton `InitiateValidatorExit` does mutate the state `st` itself. So each call to `ExitInformation(st)` may actually return a different pointer.
The function ExitInformation computes as follows
```
err := s.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error {
e := val.ExitEpoch()
if e != farFutureEpoch {
if e > exitInfo.HighestExitEpoch {
exitInfo.HighestExitEpoch = e
exitInfo.Churn = 1
} else if e == exitInfo.HighestExitEpoch {
exitInfo.Churn++
}
```
So it simply increases the churn for each validator that has epoch equal to the highest exit epoch.
The function `InitiateValidatorExit` mutates this pointer in the following way
if the state is post-electra, it disregards completely this pointer and computes the highest exit epoch and updates churn inconditionally, so the pointer `exitInfo.HighestExitEpoch` will always have the right value and is not even neded to be computed before. We could even avoid the fist loop even. If the state is pre-Electra then the function itself updates correctly the exit info for the next iteration.
* Only care about exits pre-Electra
* Update beacon-chain/core/transition/transition_no_verify_sig.go
Co-authored-by: terence <terence@prysmaticlabs.com>
* Radek's review
---------
Co-authored-by: terence <terence@prysmaticlabs.com>
* attempting to improve duties v2
* removing go routine
* changelog
* unnessesary variable
* fixing test
* small optimization existing early on CommitteeAssignments function
* fixing small bug
* fixes performance issues with duties v2
* fixed changelog
* gofmt
* Sort sidecars by index before calling `RecoverCellsAndKZGProofs`.
Reason: Starting at `c-kzg-4844 v2.1.2`, the library needs input to be sorted.
* Update `c-kzg-4844` to `v2.1.3`
* Update `c-kzg-4844` to `v2.1.5`
* additional log information around invalid payloads
* fix test with reversed require.ErrorIs args
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* slasherkv: Set a 1 minute timeout on PruneAttestationOnEpoch operations to prevent very large bolt transactions.
* Fix CI
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* fix: replace fmt.Printf with proper test error handling in web3signer test
* Update keymanager_test.go
* Create DeVikingMark_fix-web3signer-test-error-handling.md
* Change wrap message to avoid the could not...: could not...: could not... effect.
Reference: https://github.com/uber-go/guide/blob/master/style.md#error-wrapping.
* Log: remove period at the end of the latest sentence.
* Dirty quick fix to ensure that the custody group count is set at P2P service start.
A real fix would involve a chan implement a proper synchronization scheme.
* Add changelog.
* Update rules_go to v0.54.1
* Fix NotEmpty assertion for new protobuf private fields.
* Update rules_go to v0.55.0
* Update protobuf to 28.3
* Update rules_go to v0.57.0
* Update go to v1.25.0
* Changelog fragment
* Update go to v1.25.1
* Update generated protobuf and ssz files
* Support Fulu genesis block
* `NewGenesisBlockForState`: Factorize Electra and Fulu, which share the same `BeaconBlock`.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* `Broadcasted data column sidecar` log: Add `blobCount`.
* `broadcastAndReceiveDataColumns`: Broadcast and receive data columns in parallel.
* `ProposeBeaconBlock`: First broadcast/receive block, and then sidecars.
* `broadcastReceiveBlock`: Add log.
* Add changelog
* Fix deadlock-option 1.
* Fix deadlock-option 2.
* Take notifier out of the critical section
* only compute common info once, for all sidecars
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Add bitvector field for FixedTestContainer
* Handle Bitvector type using isBitfield flag
* Add Bitvector case for Stringify
* Add bitlist field for VariableTestContainer
* Add bitlistInfo
* Changelog
* Add bitvectorInfo
* Remove analyzeBit* functions and just inline them
* Fix misleading comments
* Add comments for bitlistInfo's Size
* Apply reviews from Radek
* Fix misleading log msg on shutdown
gRPCServer.GracefulStop blocks until it has been shutdown. Logging
"Initiated graceful stop" after it has been completed is misleading.
Names are added to the message to discern services. Also, a minimum test
is added mainly to verify the change made with this commit.
* Add changelog fragment file
* Capitalize log messages
* Update endtoend test for fixed log messages
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* `reconstructSaveBroadcastDataColumnSidecars`: Use the `s.columnIndicesToSample` instead of recoding its content.
ddd
* Rename `custodyColumns` ==> `columnIndicesToSample`.
* `DataColumnStorage.Save`: Remove wrong godoc.
* Implement `receiveDataColumnSidecars` and transform `receiveDataColumnSidecar` as a subcase of the plural version.
* `dataColumnSubscriber`: Add godoc and remove only once used variable.
* `processDataColumnSidecarsFromExecution`: Use single flight directly in the function.
So the caller does not have any more the responsability to deal with multiple simultaneous calls.
* `processDataColumnSidecarsFromReconstruction`: Guard against a single flight.
In `dataColumnSubscriber`, trig in parallel `processDataColumnSidecarsFromReconstruction` and `processDataColumnSidecarsFromExecution`.
Stop when the first of them is successful.
* `processDataColumnSidecarsFromExecution`: Use `receiveDataColumnSidecars` instead of `receiveDataColumnSidecar`.
* Implement and use `broadcastAndReceiveUnseenDataColumnSidecars`.
* Add changelog.
* Fix James' comment.
* Fix James' comment.
* `processDataColumnSidecarsFromReconstruction`: Log reconstruction duration.
* fix: use assigned committee index in attestation data after Electra
* update change log
* update add unit test
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Change InsertChain
InsertChain uses `ROBlock` since #14571, this allows it to insert the
last block of the chain as well. We change the semantics of InsertChain
to include all blocks and take them in increasing order.
* Fix tests
* Use slices.Reverse
* PeerDAS: Implement sync
* Fix Potuz's comment.
* Fix Potuz's comment.
* Fix Potuz's comment.
* Fix Potuz's comment.
* Fix Potuz's comment.
* Implement `TestFetchDataColumnSidecarsFromPeers`.
* Implement `TestSelectPeers`.
* Fix James' comment.
* Fix flakiness in `TestSelectPeers`.
* Revert "Fix Potuz's comment."
This reverts commit c45230b455.
* Revert "Fix James' comment."
This reverts commit a3f919205a.
* `selectPeers`: Avoid map with key but empty value.
* Fix Potuz's comment.
* Add DataColumnStorage and SubscribeAllDataSubnets flag.
* getBlobsV2: retry if reconstruction isnt successful
* test: engine client and sync package, metrics
* lint: fmt and log capitalisation
* lint: return error when it is not nil
* config: make retry interval configurable
* sidecar: recover function and different context for retrying
* lint: remove unused field
* beacon: default retry interval
* reconstruct: load once, correctly deliver the result to all waiting goroutines
* reconstruct: simplify multi goroutine case and avoid race condition
* engine: remove isDataAlreadyAvailable function
* sync: no goroutine, getblobsv2 in absence of block as well, wrap error
* exec: hardcode retry interval
* da: non blocking checks
* sync: remove unwanted checks
* execution: fix test
* execution: retry atomicity test
* da: updated IsDataAvailable
* sync: remove unwanted tests
* bazel: bazel run //:gazelle -- fix
* blockchain: fix CustodyGroupCount return
* lint: formatting
* lint: lint and use unused metrics
* execution: retry logic inside ReconstructDataColumnSidecars itself
* lint: format
* execution: ensure the retry actually happens when it needs to
* execution: ensure single responsibility, execution should not do DA check
* sync: don't call ReconstructDataColumnSidecars if not required
* blockchain: move IsDataAvailable interface to blockchain package
* execution: make reconstructSingleflight part of the service struct
* blockchain: cleaner DA check
* lint: formatting and remove confusing comment
* sync: fix lint, test and add extra test for when data is actually not available
* sync: new appropriate mock service
* execution: edge case - delete activeRetries on success
* execution: use service context instead of function's for retry
* blockchain: get variable samplesPerSlot only when required
* remove redundant function and fix name
* fix test
* fix more tests
* put samplesPerSlot at appropriate place
* tidy up IsDataAvailable
* correct bad merge
* fix bad merge
* remove redundant flag option
* refactor to deduplicate sidecar construction code
* - Add godocs
- Rename some functions to be closer to the spec
- Add err in return of commitments
* Replace mutating public method (but only internally used) `Populate` but private not mutating method `extract`.
* Implement a unique `processDataColumnSidecarsFromExecution` instead 2 separate functions from block and from sidecar.
* `ReceiveBlock`: Wrap errors.
* Remove useless tests.
* `ConstructionPopulator`: Add tests.
* Fix tests
* Move functions to be consistent with blobs.
* `fetchCellsAndProofsFromExecution`: Avoid useless flattening.
* `processDataColumnSidecarsFromExecution`: Stop using DB cache.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* create lc cache to track branches
* save lc stuff
* remove finalized data from LC cache on finalization
* read lc stuff
* edit tests
* changelog
* linter
* address commments
* address commments 2
* address commments 3
* address commments 4
* lint
* address commments 5 x_x
* set beacon lcStore to mimick registrable services
* clean up the error propagation
* pass the state to saveLCBootstrap since it's not saved in db yet
* remove "experimental" from backfill flag name
* backwards-compatible alias
* changelog
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `computeIndicesByRootByPeer`: Add 1 slack epoch regarding peer head slot.
* `FetchDataColumnSidecars`: Switch mode.
Before this commit, this function returned on error as long as at least ONE requested sidecar was not retrieved.
Now, this function retrieves what it can (best effort mode) and returns an additional value which is the map of missing sidecars after running this function.
It is now the role of the caller to check this extra returned value and decide what to do in case some requested sidecars are still missing.
* `fetchOriginDataColumnSidecars`: Optimize
Before this commit, when running `fetchOriginDataColumnSidecars`, all the missing sidecars had to been retrieved in a single shot for the sidecars to be considered as available. The issue was, if for example `sync.FetchDataColumnSidecars` returned all but one sidecar, the returned sidecars were NOT saved, and on the next iteration, all the previously fetched sidecars had to be requested again (from peers.)
After this commit, we greedily save all fetched sidecars, solving this issue.
* Initial sync: Do not fetch data column sidecars before the retention period.
* Implement perfect peerdas syncing.
* Add changelog.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Update beacon-chain/sync/data_column_sidecars.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Update beacon-chain/sync/data_column_sidecars.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Update beacon-chain/sync/data_column_sidecars.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Update after Potuz's comment.
* Fix Potuz's commit.
* Fix James' comment.
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Add flag for colocation whitelisting. --p2p-ip-colocation-whitelist
This change updates the peer IP colocation checking to respect the
configured CIDR whitelist (--p2p-ip-colocation-whitelist flag).
Changes:
- Added IPColocationWhitelist field to peers.StatusConfig
- Added ipColocationWhitelist field to Status struct to store parsed IPNets
- Parse CIDR strings into net.IPNet in NewStatus constructor
- Updated isfromBadIP method to skip colocation limits for whitelisted IPs
- Pass IPColocationWhitelist from Service config when creating Status
The IP colocation whitelist allows operators to exempt specific IP ranges
from the colocation limit, useful for deployments with known trusted
address ranges or legitimate node clustering.
Only check if an IP is in the whitelist when the colocation limit
is actually exceeded, rather than checking for every IP. This is
more efficient and matches the intended behavior.
* Changelog fragment
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* @kasey feedback: Move IP colocation parsing to the node construction
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Implement KZG proof batch verification for data column gossip validation
* Manu's feedback
* Add tests
* Update beacon-chain/sync/batch_verifier.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/batch_verifier.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/kzg_batch_verifier_test.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/kzg_batch_verifier_test.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/kzg_batch_verifier_test.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/kzg_batch_verifier_test.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update beacon-chain/sync/kzg_batch_verifier_test.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Fix tests
* Kasey's feedback
* `validateWithKzgBatchVerifier`: Give up after a full slot.
Before this commit:
After 100 ms, an un-batched verification is launched concurrently to the batched one.
As a result, a stressed node could start to be even more stressed by the multiple verifications.
Also, it is always hard to choose a correct timeout value.
100ms may be OK for a given node with a given BPO version, and not ok for the same node with a BPO version with 10x more blobs.
However, we know this gossip validation won't be useful after a full slot duration.
After this commit:
After a full slot duration, we just ignore the incoming gossip message.
It's important to ignore it and not to reject it, since rejecting it would downscore the peer sending this message.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Calculate max epoch and churn for slashing once
* calculate once for proposer and attester slashings
* changelog <3
* introduce struct
* check if err is nil in ProcessVoluntaryExits
* rename exitData to exitInfo and return from functions
* cleanup + tests
* cleanup after rebase
* Potuz's review
* pre-calculate total active balance
* remove `slashValidatorFunc` closure
* Avoid a second validator loop
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* remove balance parameter from slashing functions
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: potuz <potuz@prysmaticlabs.com>
* adding web 3 signer changes for fulu
* missed adding fulu values
* add accounting for fulu version
* updated web3signer version and fixing linting
* Update validator/keymanager/remote-web3signer/types/requests_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/keymanager/remote-web3signer/types/mock/mocks.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek suggestions
* removing redundant check and removing old function, changed changelog to reflect
* gaz
* radek's suggestion
* fixing test as v1 proof is no longer used
* fixing more tests
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
When peers return invalid data during initial sync, log the specific
validation failure reason. This helps identify:
- Whether peer exceeded requested block count
- Whether peer exceeded MAX_REQUEST_BLOCKS protocol limit
- Whether blocks are outside the requested slot range
- Whether blocks are out of order (not increasing or wrong step)
Each log includes the specific condition that failed, making it easier
to debug whether the issue is with peer implementations or request
validation logic.
* Add vectorInfo
* Add 2D bytes field for test
* Add tag_parser for parsing SSZ tags
* Integrate tag parser with analyzer
* Add ByteList test case
* Changelog
* Better printing feature with Stringer implementation
* Return error for non-determined case without printing other values
* Update tag_parser.go: handle Vector and List mutually exclusive (inspired by OffchainLabs/fastssz)
* Make linter happy
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Subscription: Get fanout peers in all data column subnets when at least one validator is connected
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Apply suggestion from @nalepae
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Updated test structure to @nalepae suggestion
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add VariableTestContainer in ssz_query.proto
* Add listInfo
* Use errors.New for making an error with a static string literal
* Add listInfo field when analyzing the List type
* Persist the field order in the container
* Add actualOffset and goFieldName at fieldInfo
* Add PopulateFromValue function & update test runner
* Handle slice of ssz object for marshalling
* Add CalculateOffsetAndLength test
* Add comments for better doc
* Changelog :)
* Apply reviews from Radek
* Remove actualOffset and update offset field instead
* Add Nested container of variable-sized for testing nested path
* Fix offset adding logics: for variable-sized field, always add 4 instead of its fixed size
* Fix multiple import issue
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fix next epoch proposer duties
* Do not update state's slot when computing the proposer
Also do not call Fulu's proposer lookahead if the requested epoch is not
current or next.
* retract Terence's test
* Fix tests
* removing epoch check to pass spec test
* reverting rollback and fixing test setup
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* propose block changes from peerdas branch
* breaking out broadcast code into its own helper, changing fulu broadcast for rest api to properly send datasidecars
* renamed validate blobsidecars to validate blobs, and added check for max blobs
* gofmt
* adding in batch verification for blobs"
* changelog
* adding kzg tests, moving new kzg functions to validation.go
* linting and other small fixes
* fixing linting issues and adding some proposer tests
* missing dependencies
* fixing test
* fixing more tests
* gaz
* removed return on broadcast data columns
* more cleanup and unit test adjustments
* missed removal of unneeded field
* adding data column receiver initialization
* Update beacon-chain/rpc/eth/beacon/handlers.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* partial review feedback from manu
* gaz
* reverting some code to peerdas as I don't believe the broadcast code needs to be reused
* missed removal of build dependency
* fixing tests and adding another test based on manu's suggestion
* fixing linting
* Update beacon-chain/rpc/eth/beacon/handlers.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/blockchain/kzg/validation.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek's review changes
* adding missed test
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Swap the wrong arguments in a call
I saw that the names of the passed arguments and the ones of the
function parameters don't match, so I suspect that it's a bug.
* Add changelog
* Add validation for the fillInForkChocieMissingBlocks checkpoints.
* Add test for checkpoint epoch validation in fillInForkChoiceMissingBlocks.
* Use a sentinel error rather than error string
---------
Co-authored-by: kasey <489222+kasey@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
By default when starting a node, we load the finalized checkpoint from
db and set it as head. When the chain has not been finalizing for a
while and the user does not start from the latest head, it may still be
benefitial to start from the latest justified checkpoint that has to be
a descendant of the finalized one.
* `FetchDataColumnSidecars`: If possible, try to reconstruct after retrieving sidecars from peers if not some are still missing.
* `randomPeer`: Deterministic randomness.
Before this commit, `randomPeer` was non derterministic, even with a deterministic random source. There reason is we iterated over a map (which is fully random) and then stopped the iteration on a chosen random index (which can be deterministic if the random source is deterministic.)
After this commit, `randomPeer` and all its callers are fully deterministic when using a deterministic random source.
* Fix Potuz's comment.
* Fix James' comment.
* `tryReconstructFromStorageAndPeers`: Improve godoc.
* Add basic PathElement
* Add ssz_type.go
* Add basic sszInfo
* Add containerInfo
* Add basic analyzer without analyzing list/vector
* Add analyzer for homogeneous collection types
* Add offset/length calculator
* Add testutil package in encoding/ssz/query
* Add first round trip test for IndexedAttestationElectra
* Go mod tidy
* Add Print function for debugging purpose
* Add changelog
* Add testonly flag for testutil package & Nit for nogo
* Apply reviews from Radek
* Replace fastssz with prysmaticlabs one
* Add proto/ssz_query package for testing purpose
* Update encoding/ssz/query tests to decouple with beacon types
* Use require.* instead of assert.*
* Fix import name for proto ssz_query package
* Remove uint8/uint16 and some byte arrays in FixedTestContainer
* Add newline for files
* Fix comment about byte array in ssz_query.proto
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* `startBaseServices`: Warm data column storage cache.
* `TestFindPeers_NodeDeduplication`: Use `t.context`.
* `BUILD.bazel`: Moge `# gazelle.ignore` at the top of the file.
Rationale: This directive is applied to the whole file, regardless its position in the file.
* Improve `TestConstructGenericBeaconBlock`: Courtesy of Terence
* Add `TestDataColumnStoragePath_FlagSpecified`.
* `appFlags`: Move `flags.SubscribeAllDataSubnets` (cosmetic).
* `appFlags`: Add `storage.DataColumnStoragePathFlag`.
* Add changelog.
* Fix subnet peer discovery
Currently computeAllNeededSubnets is called only once when the subnets
are subscribed. It should have been called regularly.
* changelog
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* adding what I think could be a fix for find peer
* removing uneeded comment
* unit tests
* linting
* gofmt
* changelog
* Update beacon-chain/p2p/discovery_test.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update changelog/james-prysm_fix-find-peers.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fixing test import
* applying suggestions
* fixing typo
* manu feedback
* accidently checked in files
* addressing manu's edgecase, old bug
* moving tests from service-test.go to subnets_test.go and adding coverage for receiving bad existing node with higher seq
* cleanup
* updating for clarity
* missingPeerCount should increment if we are removing the peer from map
* manu's recommendations on defective subnet rollback edge case
* rollback introduced too much complication as well as a new bug so we are removing it
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update consensus spec to v1.6.0-alpha.4 and implement data column support for forkchoice spectests
* Apply suggestion from @prestonvanloon
Co-Authored-By: Preston Van Loon <pvanloon@offchainlabs.com>
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* refactor: use auto-generated HashTreeRoot functions in htrutil.go
* refactor: use type alias for Transaction & use SliceRoot for TransactionsRoot
* changelog
* fix: TransactionsRoot receives raw 2d bytes as an argument
* fix: handle nil argument
* test: add nil test for fork and checkpoint
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* initialize genesis data asap at node start
* add genesis validation tests with embedded state verification
* Add test for hardcoded mainnet genesis validator root and time from init() function
* Add test for UnmarshalState in encoding/ssz/detect/configfork.go
* Add tests for genesis.Initialize
* Move genesis/embedded to genesis/internal/embedded
* Gazelle / BUILD fix
* James feedback
* Fix lint
* Revert lock
---------
Co-authored-by: Kasey <kasey@users.noreply.github.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* Fix validateConsensus
Reported by NuConstruct
The stater package looks for a stateroot using the head state from the
blockchain package. However, this state is very unlikely to have the
poststateroot since that's only added after slot processing. I assume
that essentially any REST endpoint that uses this mechanism to get head
is broken if it needs to gather a state by stateroot.
This PR is a placeholder to verify this is the issue, here I just check
if the NSC already has the post-state since that will have already the
processing state cached.
* Add changelog
* add fallback
* Fix tests
* Add entry for sequence number in chain-metadata bucket & Basic getter/setter
* Mark p2p-metadata flag as deprecated
* Fix metaDataFromConfig: use DB instead to get seqnum
* Save sequence number after updating the metadata
* Fix beacon-chain/p2p unit tests: add DB in config
* Add changelog
* Add ReadOnlyDatabaseWithSeqNum
* Code suggestion from Manu
* Remove seqnum getter at interface
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Fix race on ReceibeBlock
In the event two routines for `ReceiveBlock` are triggered with the same
block (it may happen if one routine is triggered over gossip and the
other in init-sync) it may happen that the second routine believes it's
syncing the block for the first time. This is because the cache on
`blocksBeingSynced` is not checked to be set and the block may still not
be put in forkchoice by the first routine.
In the normal case this would not cause any trouble as the second
forkchoice insertion is a noop by design. However, if the second routine
times out or has any error in processing (for example the engine will
return an error if we try to send FCU to an older head) then the second
routine will attempt to remove the inserted block from forkchoice and
this bricks the node since forkchoice refuses to remove a valid node,
the root is removed inconditionally from db and the node ends up with a
root that is not in db and remains in forkchoice.
This PR just prevents the race.
As a followup perhaps we can gate the rollback function from db to nodes
that are effectively not in forkchoice, alternatively, force removal
from forkchoice when rolling back from db (although this version is
complicated due to possible accounting issues on forkchoice).
* Fix lint
* Assign max_cell_proofs_length the correct value
* Add changelog fragment
* Run update-go-pbs.sh
* Run update-go-ssz.sh
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Currently the payload attribute events is triggered on
`forkchoiceUpodateWithExecution`. However when we import an early block,
we do not call this function, we make two calls to FCU, the first one is
on a locked path at the end of `postBlockProcess` and this call is made
without any payload attributes to avoid updating the shuffling caches.
The second call is made on `handleSecondFCUCall` which calls directly
`notifyForkchoiceUpdate` bypassing the call to
`forkchoiceUpdateWithExecution`, but this call is the one that actually
computes the payload attributes. So the event handler is never called
with the new attributes.
This PR moves the event trigger to the same place where we actually call
FCU with the computed payload attributes.
Some considerations with forkchoice locking logic: since the calls are
always in a go routine, anyway the routine will wait to forkchoice to be
unlocked to proceed.
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* fix: submitPoolSyncCommitteeSignatures reponse inconsistent
* update: bazel build file
* update: add changelog fragment file
* update api/server/structs/BUILD.bazel format
* update the unit test
* update: the error format
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit adds a Prometheus histogram metric to measure the processing
duration of the PublishBlockV2 beacon API endpoint in milliseconds.
The metric covers the complete request processing time including:
- Request validation and parsing
- Block decoding (SSZ/JSON)
- Broadcast validation checks
- Block proposal through ProposeBeaconBlock
- All synchronous operations and awaited goroutines
Background operations that run in goroutines (block broadcasting, blob
sidecar processing) are included in the timing since the main function
waits for their completion before returning.
Files changed:
- beacon-chain/rpc/eth/beacon/metrics.go: New metric definition
- beacon-chain/rpc/eth/beacon/handlers.go: Timing instrumentation
- beacon-chain/rpc/eth/beacon/BUILD.bazel: Added metrics.go and Prometheus deps
- changelog/potuz_add_publishv2_metric.md: Changelog entry
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* Log when downscoring a peer.
* `validateSequenceNumber`: Downscore peer in function, clarify and add logs
* `AddConnectionHandler`: Send majority code to the outer scope (no funtional change).
* `disconnectBadPeer`: Improve log.
* `sendRPCStatusRequest`: Improve log.
* `findPeersWithSubnets`: Add preventive peer filtering.
(As done in `s.findPeers`.)
* `Stop`: Use one `defer` for the whole function.
Reminder: `defer`s are executed backwards.
* `Stop`: Send a goodbye message to all connected peers when stopping the service.
Before this commit, stopping the service did not send any goodbye message to all connected peers. The issue with this approach is that the peer still thinks we are alive, and behaves so by trying to communicate with us. Unfortunatly, because we are offline, we cannot respond. Because of that, the peer starts to downscore us, and then bans us. As a consequence, when we restart, the peer refuses our connection request.
By sending a goodbye message when stopping the service, we ensure the peer stops to expect anything from us. When restarting, everything is allright.
* `ConnectedF` and `DisconnectedF`: Workaround very probable libp2p bug by preventing outbound connection to very recently disconnected peers.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* `AddDisconnectionHandler`: Handle multiple close calls to `DisconnectedF` for the same peer.
* removing ssz-only flag
* gaz
* reverting other uses of sszonly
* gaz
* adding kasey and radek's suggestions
* update changelog
* adding test
* radek advice with new headers and tests
* adding logs and fixing comments
* adding logs and fixing comments
* gaz
* Update validator/client/beacon-api/rest_handler_client.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update api/apiutil/header.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update api/apiutil/header.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek's comments
* adding another failing case based on radek's suggestion
* another unit test
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Subnets subscription: Avoid dynamic subscribing blocking in case not enough peers per subnets are found.
* `subscribeWithParameters`: Use struct to avoid too many function parameters (no functional changes).
* Optimise subnets search.
Currently, when we are looking for peers in let's say data column sidecars subnets 3, 6 and 7, we first look for peers in subnet 3.
If, during the crawling, we meet some peers with subnet 6, we discard them (because we are exclusively looking for peers with subnet 3).
When we are happy, we start again with peers with subnet 6.
This commit optimizes that by looking for peers with satisfy our constraints in one look.
* Fix James' comment.
* Fix James' comment.
* Fix James' comment.
* Fix James' commnet.
* Fix James' comment.
* Fix James' comment.
* Fix James's comment.
* Simplify following James' comment.
* Fix James' comment.
* Update beacon-chain/sync/rpc_goodbye.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update config/params/config.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/sync/subscriber.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Fix Preston's comment.
* Fix Preston's comment.
* `TestService_BroadcastDataColumn`: Re-add sleep 50 ms.
* Fix Preston's comment.
* Update beacon-chain/p2p/subnets.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Convert genesis times from seconds to time.Time
* Fixing failed forkchoice tests in a new commit so it doesn't get worse
Fixing failed spectest tests in a new commit so it doesn't get worse
Fixing forkchoice tests, then spectests
* Fixing forkchoice tests, then spectests. Now asking for help...
* Fix TestForkChoice_GetProposerHead
* Fix broken build
* Resolve TODO(preston) items
* Changelog fragment
* Resolve TODO(preston) items again
* Resolve lint issues
* Use consistant field names for sinceSlotStart (no spaces)
* Manu's feedback
* Renamed StartTime -> UnsafeStartTime, marked as deprecated because it doesn't handle overflow scenarios.
Renamed SlotTime -> StartTime
Renamed SlotAt -> At
Handled the error in cases where StartTime was used.
@james-prysm feedback
* Revert beacon-chain/blockchain/receive_block_test.go from 1b7844de
* Fixing issues after rebase
* Accepted suggestions from @potuz
* Remove CanonicalHeadSlot from merge conflicts
---------
Co-authored-by: potuz <potuz@prysmaticlabs.com>
* Reword DV selection proofs
* Add changelog
* Expect 1 call to DomainData in DV update duties test
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* moving the ticker from chain start to right before the main loop and also after the wait for activation edge case
* fixing unit test
* adding in a unit test
* adding in comment based on potuz's feedback
* Add log capitalization analyzer and apply fixes across codebase
Implements a new nogo analyzer to enforce proper log message capitalization and applies the fixes to all affected log statements throughout the beacon chain, validator, and supporting components.
Co-Authored-By: Claude <noreply@anthropic.com>
* Radek's feedback
---------
Co-authored-by: Claude <noreply@anthropic.com>
* always init service through NewService
* move head state cache to service struct
* changelog
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* poc changes for safe validator shutdown
* simplifying health routine and adding safe shutdown after max restarts reached
* fixing health tests
* fixing tests
* changelog
* gofmt
* fixing runner
* improve how runner times out
* improvements to ux on logs
* linting
* adding in max healthcheck flag
* changelog
* Update james-prysm_safe-validator-shutdown.md
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/runner.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/service.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/runner.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/runner.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* addressing some feedback from radek
* addressing some more feedback
* fixing name based on feedback
* fixing mistake on max health checks
* conflict accidently checked in
* go 1.23 no longer needs you to stop for the ticker
* Update flags.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* wip no unit test for recursive healthy host find
* rework healthcheck
* gaz
* fixing bugs and improving logs with new monitor
* removing health tracker, fixing runner tests, and adding placeholder for monitor tests
* fixing event stream check
* linting
* adding in health monitor tests
* gaz
* improving test
* removing some log.fatals
* forgot to remove comment
* missed fatal removal
* doppleganger should exit the node safely now
* Update validator/client/health_monitor.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek review
* Update validator/client/validator.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/validator.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/health_monitor.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/health_monitor.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/health_monitor.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/client/validator.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek feedback
* read up on more suggestions and making fixes to channel
* suggested updates after more reading
* reverting some of this because it froze the validator after healthcheck failed
* fully reverting
* some improvements I found during testing
* Update cmd/validator/flags/flags.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* preston's feedback
* clarifications on changelog
* converted to using an event feed instead of my own channel publishing implementation, adding relevant logs
* preston log suggestion
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Topic mapping: Groupe `const` and `var`.
Cosmetic change, no functional change.
* `TopicFromMessage`: Do not assume anymore that all Fulu specific topics are V3 only.
* Proto: Remove unused `DataColumnIdentifier` and add new `StatusV2`.
`DataColumnIdentifier` was removed in the spec here: https://github.com/ethereum/consensus-specs/pull/4284. Eventually, we stopped using it in Prysm, but never removed the corresponding proto message.
The new `StatusV2` is introduced in the spec here: https://github.com/ethereum/consensus-specs/pull/4374
* `readChunkedDataColumnSideCar` ==> `readChunkedDataColumnSidecar`.
* `rpc_send_request.go`: Reorganize file (no function change).
* `readChunkedDataColumnSidecar`: Add `validationFunctions` parameter and add tests.
* `dataColumnsRPCMinValidSlot`: Add new test case.
* peerDAS: Implement `dataColumnSidecarByRangeRPCHandler`.
* `rateLimitingAmount`: Define out of the function.
* Fix James' comment.
* Fix James' comment.
* Add the new Fulu state with the new field
* fix the hasher for the fulu state
* Fix ToProto() and ToProtoUnsafe()
* Add the fields as shared
* Add epoch transition code
* short circuit the proposer cache to use the state
* Marshal the state JSON
* update spectests to 1.6.0-alpha.1
* Remove deneb and electra entries from blob schedule
This was cherry picked from PR #15364
and edited to remove the minimal cases
* Fix minimal tests
* Increase deadling for processing blocks in spectests
* Preston's review
* review
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* remove usages of params from proto packages
* make it harder to mess up the order of request limit args
* remove errant edit (Terence review)
* fix missed updates after sig change
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `verifyBlobCommitmentCount`: Print max allowed blob count in error message.
* `TestPersist`: Use `fieldparams.RootLength` instead of `32`.
* `TestDataColumnSidecarsByRootReq_Marshal`: Remove blank line.
* `ConvertPeerIDToNodeID`: Improve readability by using one line per field.
* `parseIndices`: Return `[]int` instead of `[]uint64`.
Rational: These indices are used in
`func (m *SparseMerkleTrie) MerkleProof(index int) ([][]byte, error)`
that requires `int` and not `uint64`.
This `MerkleProof` function is used at a lot of places in the codebase.
==> Changing the signature of `parseIndices` is simpler than changing the signature of `MerkleProof`.
* adding in proto for getdutiesv2
* adding in GetDutiesV2
* updating changelog and mock
* fixing tests
* breaking up function into smaller functions for gocognit
* reverting some changes so we can break it into a separate PR for validator client only
* reverted too much adding mock change back in
* removing reserved based on preston's feedback
* adding duties tests back in
* Update beacon-chain/rpc/prysm/v1alpha1/validator/duties.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* updating based on preston's feedback
* updating build for new files
* maybe there's some flake with how the state is used, trying with it moved
* reverting config override
* reverting all changes to get duties v1 based on preston's feedback
* Update proto/prysm/v1alpha1/validator.proto
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* addressing partial feedback
* adding small comment
* reorganizing function based on feedback
* removing unused field
* adding some more unit tests
* adding attribute for pubkeys to span
* preston's feedback
* fixing current to next
* probably safer to register current period now
* Update beacon-chain/core/helpers/beacon_committee.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* adding in preston's comment
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix getCommittees when slot not in given epoch
* add changelog file
* add unit test & fix changelog file format
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* 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>
* wip
* more wip
* commenting out builder redefinition of payload types
* removing unneeded commented out code and unused type conversions
* fixing unit tests and removing irrelevant unit tests
* gaz
* adding changelog
* Update api/server/structs/conversions_block_execution.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update api/server/structs/conversions_block_execution.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Revert some changes to test files, change the minimum to support the new type changes
* Remove commented block
* fixing import
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* PeerDAS: Implement the validation pipeline for data column sidecars received via gossip
* Fix Terence's comment
* Fix Terence's comment.
* Fix Terence's comment.
* Add blob schedule support
* Feedback
* Fix e2e test
* adding in temporary fix until web3signer is supported for blob schedule in config
* Add fallback
* Uncomment blob schedule from plcae holder fields for test
* Log blob limit increase
* Sort
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* Added a symlink to the Docker image from /bin/sh -> /bin/bash
* Added changelog fragment
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* Force duties update on received blocks.
- Change the context on UpdateDuties to be passed by the calling
function.
- Change the context passed to UpdateDuties to not be dependent on a
slot context.
- Change the deadlines to be forced to be an entire epoch.
- Force duties to be initialized when receiving a HeadEvent if they
aren't already.
- Adds a read lock on the event handling
* review
* Add deadlines at start and healthyagain
* cancel once
* Use otelgrpc for tracing grpc server and client.
* Changelog fragment
* gofmt
* Use context in prometheus service
* Remove async start of prometheus service
* Use random port to reduce the probability of concurrent tests using the same port
* Remove comment
* fix lint error
---------
Co-authored-by: Bastin <bastin.m@proton.me>
* include block in attr event and use stategen
* use no-copy state cache for proposal in same epoch
* only advance to the start of epoch
---------
Co-authored-by: Kasey <kasey@users.noreply.github.com>
* Add equivocation detection logic; broadcast slashing immediately on equivocation
* nit: comments
* move equivocation detection to validateBeaconBlockPubSub
* include broadcasting logic within the helper function
* fix lint
* Add unit tests for equivocation detection
* remove comment that are not required
* Add changelog file
* Add descriptive comment for detectAndBroadcastEquivocation
* use head block instead of block cache for equivocation detection
* add more equivocation unit tests; update a mock to include HeadState error
* update the order of the checks
* move slashing before state fetch; update Tests
* update changelog
* use verifyProposerSlashing to verify and reject block; remove verifySlashableBlock; update tests
* Update changelog
* nit: cleaner error check
* nit: clean up
* revert code logic; update string check; add a unit test
* improve errors; merge tests
* Update a unit test
* fix lint
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Implement all needed KZG wrappers for peerDAS in the `kzg` package.
This way, If we need to change the KZG backend, the only package to
modify is the `kzg` package.
* `.bazelrc`: Add `build --compilation_mode=opt`
* Remove --compilation_mode=opt, use supranational blst headers.
* Fix Terence's comment.
* Fix Terence`s comments.
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* separate block/blob peer scoring
* Preston's test coverage feedback
* test to ensure we don't combine distinct errors
---------
Co-authored-by: Kasey <kasey@users.noreply.github.com>
* adding in guard and tests
* adding in review from slack
* reverting error wrapping
* fixing tests
* fixing more tests
* removing defer cleanups
* Update beacon-chain/rpc/eth/validator/handlers_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/rpc/eth/beacon/handlers_pool.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* fixing test and adding some coverage for validator_test.go for function
* gaz
* adding happy path test
* fixing buildkite removing test helper dependency
* fixing tests
* gaz
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Add support for electra fork epoch
* Fix tests
* fixing tests without needing to override electra fork config
* reverting electra fork override on blob test too, replacing with custom timefetcher
* reverting old changelog
* Fix genesis time
* Move mainnet test into mainnet_config_test.go
* Update spec test to v1.5.0-beta.5
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* 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
* add lcStore to Node
* changelog entry
* add atomic getters and setters for the store
* change store fields visibility to private
* refactor method names and add tests
* remove get from getters
* Trigger Consolidation
* Finally have it working
* Fix Build
* Revert Change
* Fix Context
* Finally have consolidations working
* Get Evaluator Working
* Get Withdrawals Working
* Changelog
* Finally Passes
* New line
* Try again
* fmt
* fmt
* Fix Test
* removing redundant loop
* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* removing unused import
* replacing with more used function
* resolving Unsafe cast from uint64 to int error
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* cleanup
* fixing optimal sort order for struct
* reverting clictx change based on kasey's feedback
* adding in fix for old trace file flag
* more cleanup for clarity
* optimizing if statement check and fixing wallet open on web enable
* optimizing if statement check and fixing wallet open on web enable
* some more cleanup and bug fix on open wallet
* reverting debug.go changes will handle in a separate PR
* removing useless comment
* changing useWeb to enableAPI
* fixing tests and linting
* manu feedback and one optimization removing auth token check
* gaz
* wip
* fixing unit tests
* changing is aggregator function
* wip
* fully removing the use of committee from validator client, adding a wrapper type for duties
* fixing tests
* fixing linting
* fixing more tests
* changelog
* adding some more tests
* Update proto/prysm/v1alpha1/validator.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek's feedback
* removing accidently checked in
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Implement static analysis to prevent panics
* Add nopanic to nogo
* Fix violations and add exclusions
Fix violations and add exclusions for all
* Changelog fragment
* Use pass.Report instead of pass.Reportf
* Remove strings.ToLower for checking init method name
* Add exclusion for herumi init
* Move api/client/beacon template function to init and its own file
* Fix nopanic testcase
* feat(event-stream): Add block_gossip topic support
* feat(event-stream): Add block_gossip topic support
* feat(event-stream): Add block_gossip topic support
* feat: add block gossip topic support to beacon api event stream
* fix: sync_fuzz_test panic
* fix: check for nil operationNotifier before sending block gossip
The operationNotifier was not being checked for nil before being used,
which could lead to a panic if it was not initialized. This commit adds
a nil check to prevent the panic.
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* adding in check for non prysm node and moving the prysm endpoint to the prysm beacon client
* fixing a bug connecting to a non prysm client and moving the prysm api call to the prysm beacon client
* changelog
* fixing linting
* Update validator/client/metrics.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update seen unaggregated att cache to Electra
* changelog <3
* pass full att
* revert extracting length check
* check if 1 bit set
* test fix
* adding end to end unit test saving unaggregated electra att and then verifying that it's already seen in the cache
* Terence's feedback
* return false on errors
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* Add feature flag to start from any beacon block in db
The new feature flag called --sync-from takes a string that can take
values:
- `head` or
- a 0x-prefixed hex encoded beacon block root.
The beacon block root or the head block root has to be known in db and
has to be a descendant of the current justified checkpoint.
* Fix Bugs In Sync From Head (#15006)
* Fix Bugs
* Remove log
* missing save
* add tests
* Kasey review #1
* Kasey's review #2
* Kasey's review #3
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Return the genesis block root from last validated checkpoint if zero
When starting a node we load the last validated checkpoint. On tests or a new node this checkpoint can have the zero blockroot (it returns the finalized checkpoint). This PR ensures that it returns the genesis block root instead.
It can't affect runnning code since the root is only used at startup in `setup_forkchoice`. But it may affect tests because now `OptimisticForRoot` will error out if there is no genesis block root set on db.
* Terence review
* fix test
* clean up block-slot-indices on block deletion
* also remove parent root index entry
* treat parent root index as packed key (like slot idx)
* fix bug where input slice is modified, with test
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Update rules_go to v0.53.0
* Update staticcheck to v0.6.0
* Update to go 1.24.0
* Update github.com/trailofbits/go-mutexasserts to latest
* Use rules_go @ cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9
* Provide the go binary to SszGen.
https://github.com/bazel-contrib/rules_go/pull/4173
* Unskip SA9003
* Update github ci checks to go1.24.0
* CI: Update gosec to v2.22.1 and golangci to v1..64.5
* Temporarily disable usetesting lint check for go1.24
* gosec: Disable G115 - integer overflow conversion
* gosec: Ignore G407 for "hardcoded" IV. It's not hardcoded.
* Fix uses of rand.Seed. This is a no-op in go1.24 and deprecated since go1.20.
* Changelog fragment
* Decompose Electra block attestations
* comments
* changelog <3
* remove redundant comparison
* typo in comment
* fix changelog section name
* review from James and Sammy
* continue pruning on error
* only prune when committees are cached
* fix bad assignments in test
* fix pruner timing issue with batch pruning
* add changelog entry
* add batchSize and number of slots deleted to debug logs
* fix lint
* prune in small batches in one prune cycle
* remove noisy logs
* fix number of batches to prune and return early if there's nothing to delete
* use context with timeout
* fix lint by ignoring nil err return
* Beacon flags: Comment on deprecated section
* Beacon flags: Organize flags relevant to logging, comment on logging section
* Beacon flags: Organize flags relevant to p2p, comment on p2p section
* Beacon flags: Introduce db flag section, organize flags relevant to db, comment on db section
* Beacon flags: Introduce builder flag section, organize flags relevant to builder, comment on builder section
* Beacon flags: Introduce sync flag section, organize flags relevant to sync, comment on sync section
* Beacon flags: Introduce execution layer flag section, organize flags relevant to execution layer, comment on execution layer section
* Beacon flags: Introduce monitoring flag section, organize flags relevant to monitoring, comment on monitoring section
* Beacon flags: Organizing remaining flags in cmd and beacon-chain sections
* Beacon flags: Introduce slasher flag section, organize flags relevant to slasher, comment on slasher section
* Move slasher flag from features to the slasher section
* Changelog fragment
* Beacon flags: Reorganize sections
* Move MaxGoroutines to debug section
* bundle handlers test
* ssz support for optimistic and finality updates APIs
* changelog PR link
* delete helpers
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fixed otelhttp client setups.
Note: This may not be the best solution as the http client is defined in many places. There should be a canoncial http client with the proper setup.
* Changelog fragment
* go mod tidy and gazelle
* created new converstions_execution files moving the from and to consensus functions for execution related items, also created a placeholder for block_execution with the intent of adding execution types there
* moving execution types from block.go to block_execution.go
* migrating more types and logic
* adding all the to consensus functions for payloads
* changelog
* linting
* updating unit tests for conversions
* fixing linting
* forgot to fix test
* updating name based on feedback
* wip electra e2e
* add Deneb state to `validatorsParticipating`
* Run bazel
* add Electra state to `validatorsParticipating`
* fixing some e2e issues
* more evaluator fixes and changelog
* adding in special condition to pass electra epoch participation
* fixing typo
* missed updating forks for e2e tests
* reverting change current release fork
* missed updating e2e config for test
* updating to latest devnet 5 to fix unit tests
* go mod tidy
* fixing branch, temporary will need to update geth version later
* update to goethereum v1.15.0
* changing changelog to reflect update in geth dependency
* fixing test failures
* adding fix for range request limit during transition period between forks
* enabling validator rest for Electra
* rolling back error message
* adding fixed change logs
* fixing dependencies based on nishant's comments, deps.bzl should be updated not workspace
* partially reverting incorrect change
* removing fixes from change log, handled in separate prs
* removing comment
* updating update fraction field to the corrected spec value from prague
* Update testing/endtoend/evaluators/fork.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
---------
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* refactored code and added in checks for blinded endpoints
* changelog
* cleaning up some comments and error messages
* fixing linting
* adding clarifying comment
* Add tests for TestSendBlobsByRangeRequest. Currently not working with sequential blob validation.
* Copy Root First
* Allow Test For Maximum Amount of Blobs
* Fails with the Same error
* Fix Last Test Assertion
* Add in Fix
* Changelog
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* Add metrics for pruned proofs & pending deposits
* Add PruneAllProofs & PruneAllPendingDeposits
* Add simple unit tests
* Add DepositPruner interface
* Add pruning logic at post finalization task
* Move pruner logic into new file(deposit_pruner.go)
Rationale:
As deposit_fetcher.go contains all pruning logics, it would be better to separate its interest into fetcher/inserter/pruner.
* Gofmt
* Add reference link for deprecating eth1 polling
* Add changelog
* Apply reviews from nisdas and james
* add pre and post deposit request tests
* nishant's comment
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* organize blob directories by period and epoch
* changelog
* remove Indices and replace with Summary
* old PR feedback
* log to advise about the speed of blob migration
* rename level->layer (hoping term is more clear)
* assert path in tests for increased legibility
* lint
* lint
* remove test covering a newly impossible error
* improve feedback from flag validation failure
* Try to clean dangling dirs epoch->flat migration
* lint
* Preston feedback
* try all layouts and short-circuit if base not found
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Update Beacon API events to Electra
* changelog <3
* fix issues
* send notifications from pending att queue
* Revert "send notifications from pending att queue"
This reverts commit 545408f6cf.
* change field IDs in `AggregateAttestationAndProofElectra`
* fix typo in `validator.proto`
* correct slashing indices length and shashings length
* check length in indexed attestation's `ToConsensus` method
* use `fieldparams.BLSSignatureLength`
* Add length checks for execution request
* fix typo in `beacon_state.proto`
* fix typo in `ssz_proto_library.bzl`
* fix error messages about incorrect types in block factory
* add Electra case to `BeaconBlockContainerToSignedBeaconBlock`
* move PeerDAS config items to PeerDAS section
* remove redundant params
* rename `PendingDepositLimit` to `PendingDepositsLimit`
* improve requests unmarshaling errors
* rename `get_validator_max_effective_balance` to `get_max_effective_balance`
* fix typo in `consolidations.go`
* rename `index` to `validator_index` in `PendingPartialWithdrawal`
* rename `randomByte` to `randomBytes` in `validators.go`
* fix for version in a comment in `validator.go`
* changelog <3
* Revert "rename `index` to `validator_index` in `PendingPartialWithdrawal`"
This reverts commit 87e4da0ea2.
* wip skip eth1data voting after electra
* updating technique
* adding fix for electra eth1 voting
* fixing linting on test
* seeing if reversing genesis state fixes problem
* increasing safety of legacy check
* review feedback
* forgot to fix tests
* nishant's feedback
* nishant's feedback
* rename function a little
* Update beacon-chain/core/helpers/legacy.go
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
* fixing naming
---------
Co-authored-by: Jun Song <87601811+syjn99@users.noreply.github.com>
* EIP-7549: slasher
* update chunks and detection
* update tests
* encode+decode
* timer
* test fixes
* testing the timer
* Decouple pool from service
* update mock
* cleanup
* make review easier
* comments and changelog
* Don't mark blocks as invalid on context deadlines
When processing state transition, if the error is because of a context
deadline, do not mark it as invalid.
* review
* fix changelog
* fix: early return for gathering local deposits when EIP-6110 is applied
* Add an entry on CHANGELOG.md
* Fix weird indent at CHANGELOG.md
* Add changelog
* Fix CHANGELOG.md
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Before this commit, this kind of logs were possible:
```
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_0/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_1/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_2/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_3/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_4/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_5/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_6/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_7/ssz_snappy
[2025-01-22 17:18:48] DEBUG sync: Could not search for peers error=node filter: no subnet exists for provided topic: /eth2/d1f05cae/blob_sidecar_8/ssz_snappy
```
Note this bug has no real other impact than logging these errors: Since all nodes are subscribed to these subnets, as soon as some peers are found, there is no more issue.
Why not using `s.subscribe` instead of `s.subscribeWithParameters`?
Blobs subnets were before considered as static subnets. But since Electra, the number of subnets is a function of the epoch.
So it's better to use `s.subscribeWithParameters` than 2 specific but almost identic functions in `s.subscribe`.
Why `filterPeerForBlobSubnet` is the only one returning always `true`?
Because blobs subnets are actually the only subnets which are both dynamic AND which have to be subscribed by all the nodes.
So, `filterPeerForBlobSubnet` does not filter out any node.
188a2ff818/specs/fulu/fork.md (upgrading-the-state)
Before this commit, the `UpgradeToFulu` did not really respect the specification. This commit fixes that.
How can we be sure now the specification is really respected?
As long as the equivalent of https://github.com/ethereum/consensus-spec-tests/tree/master/tests/mainnet/electra/fork/fork/pyspec_tests are not released, we cannot be sure.
However, with this commit, Prysm and Lighthouse do agree with the post state after the Fulu fork (which is not the case without this commit).
So either both Prysm and Lighthouse are both right,
either the are both wrong (but in the exact same way, which has a pretty low likelyhood).
* Use `SingleAttestation` for Fulu in p2p attestation map.
* Fix `TestExtractDataType`.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* updating blockv2 to handle electra blocks
* adding aggregate attesation and proof electra
* gaz
* changelogs
* updating web3signer dependency
* test mock was flipped
* fixing hex value
* accidently checked in dependency changes
* preston feedback
* readding old metrics to not break linting
* review feedback and changelog
* gaz
* updating the goethereum dependency
* fixing dependencies
* reverting workspace
* more fixes, work in progress
* trying with upgraded geth version
* fixing deprecated functions except for the time related ones on eth1 distance due to time issues
* fixing time issues
* gaz
* fixing test and upgrading some dependencies and reverting others
* Disable cgo in hid, delete old vendored usb library
* changelog
* rolling back dependencies
* fixing go mod tidy
* Geth v1.13.6
* fix tests
* Add ping interval, set to 500ms for tests. This didnt work
* Update to v1.14.8
* Spread it out to different bootnodes
* Fix it
* Remove Memsize
* Update all out of date dependencies
* Fix geth body change
* Fix Test
* Fix Build
* Fix Tests
* Fix Tests Again
* Fix Tests Again
* Fix Tests
* Fix Test
* Copy USB Package for HID
* Push it up
* Finally fix all tests with felix's changes
* updating geth dependency
* Update go-ethereum to v1.14.11
* fixing import
* reverting blob change
* fixing Implicit memory aliasing in for loop.
* WIP changes
* wip getting a little further on e2e runs
* getting a little further
* getting a little further
* setting everything to capella
* more partial fixes
* more fixes but still WIP
* fixing access list transactions"
* some cleanup
* making configs dynamic
* reverting time
* skip lower bound in builder
* updating to geth v1.14.12
* fixing verify blob to pointer
* go mod tidy
* fixing linting
* missed removing another terminal difficulty item
* another missed update
* updating more dependencies to fix cicd
* fixing holiman dependency update
* downgrading geth to 1.14.11 due to p2p loop issue
* reverting builder middleware caused by downgrade
* fixing more rollback issues
* upgrading back to 1.14.12 after discussing with preston
* mod tidy
* gofmt
* partial review feedback
* trying to start e2e from bellatrix instead
* reverting some changes
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev>
Co-authored-by: nisdas <nishdas93@gmail.com>
* Update blobs by range rpc topics to v1
* Update blobs by range rpc topics to v1
* RPC handler comments: Use "Added", "Modified" and "Upgraded".
- Added: No message with this message name was previously existing.
- Upgraded: A message with this message name was existing in the previous fork, but the schema version is upgraded in the current fork.
- Modified: The couple message name, schema version is the same than in the previous fork, but the implementation of the handler is modified in the current fork.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Prepare for future fork boilerplate.
* Implement the Fulu fork boilerplate.
* `Upgraded state to <fork> log`: Move from debug to info.
Rationale:
This log is the only one notifying the user a new fork happened.
A new fork is always a little bit stressful for a node operator.
Having at least one log indicating the client switched fork is something useful.
* Update testing/util/helpers.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fix Radek's comment.
* Fix Radek's comment.
* Update beacon-chain/state/state-native/state_trie.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/state/state-native/state_trie.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fix Radek's comment.
* Fix Radek's comment.
* Fix Radek's comment.
* Remove Electra struct type aliasing.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Issue before this commit:
The `currentSlot` in the `getSubnetsToSubscribe` is really set to the current slot. So, even if the `registerSubscribers` function is called
one epoch in advance, as done in `registerForUpcomingFork`, then
`currentSlot` will still be - really - the current slot.
==> The new blobs subnets will be subscribed only at the start of the
Electra fork, and not one epoch in advance.
With this commit:
The new blobs subnets will be effectively subscribed one epoch in advance.
* Re-organize thet content of the `*.proto` files.
The content of the `*.proto` files is sorted by hard fork,
then with a top-down fashion.
Sorting first by hard fork lets the reader to easily see new or modified fields.
Then, sorting with a top-down fashion lets the user to first see the big picture,
then to dive into details.
Also, the `new in <hard fork>` mentions are only written for the given hard fork.
Thus, it'll avoid in the future the majority of the fields, not initially
present in phase 0, to have the `new in <hard fork> mention`.
This commit does not bring any new functional change.
* Update proto/prysm/v1alpha1/attestation.proto
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update proto/prysm/v1alpha1/beacon_state.proto
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fix Radek's comment.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Use 16 bit random value
* enforce 0x02 credentials for consolidations
* Limit consolidating balance by validator effective balance
* Update max blob commitment size
* Fix next sync committee indices
* Bytes to little endian
* Handle proposer computations in between forks
* Fix config and tests
Fix tests
Fix tests
* Fix test stream events by properly set effective balance
Fix test stream events by properly set effective balance
* Preallocate buffers to avoid repeated allocations
* Potuz's feedback
* Use 16 bit random value
* enforce 0x02 credentials for consolidations
* Limit consolidating balance by validator effective balance
* Update max blob commitment size
* Fix next sync committee indices
* Bytes to little endian
* Handle proposer computations in between forks
* Fix config and tests
Fix tests
Fix tests
* Fix test stream events by properly set effective balance
Fix test stream events by properly set effective balance
* Preallocate buffers to avoid repeated allocations
* Potuz's feedback
* Fix change log
* Rename existing AttestationCache
* Cache with simple Add
* fix import cycle
* logic for unaggregated, aggregated and block attestations
* some small fixes
* remove Seen
* finishing touches
* feature flag
* extract forkchoice atts to separate type
* gate new functionality behind feature flag
* revert test files
* preparing for review
* change Id to [32]byte
* Potuz's review
* Potuz's review pt 2
* Nishant's review
* keep flat list of atts
* fix ForkchoiceAttestations() function
* Tests for Add, GetAll, Count
* Tests for remaining functions
* use DeepEqual
* fix tests
* documentation
* changelog <3
* v2 handlers
* nil check for forkchoice atts
* guard against 0 bits set
* fix failing test
* Preston's review
* better godocs
* move flag settings out of individual tests
* add tests with better or worst old update
* remove whitespace
* add zero fields for default update at deneb block in electra
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Refactor subnets subscriptions.
* Remove totally static/dynamic distinction.
* Unsubscribing from topic: Use INFO instead of log.
==> So we have something symmetrical with subscriptions.
* Address Nishant's comment.
Rationale:
Before this commit, the internal loop exited if:
- the expected amount of peers is found, or,
- the iterator returns `false` (exhaustion), or
- `batchSize` iterations are done.
The issue with the iterations count is, in case not enough
peer are found AND `iterator.Next` always returns `true`,
we don't control WHEN the loop is going to stop.
The root cause is we don't control the time needed to
run the `iterator.Next` function, which is a function of
`devp2P (geth)`.
The value of `batchSize (2000)` was chosen arbitrarily.
It turns out the time needed to run `iterator.Next` can go from a few micro seconds to a few hundreds of milliseconds.
==> In small networks (example: E2E tests), it was possible for the loop not to exit during several dozen of seconds.
With this commit, we replace the `batchSize` by a `batchPeriod`, ensuring the loop will never
run longer than `batchPeriod`, even in a small network.
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Add missed exit checks to consolidation processing
* Use safe add
* gaz
* Pass spec tests (except single attestation)
Revert params.SetupTestConfigCleanupWithLock(t)
* Update earlist exit epoch for upgrade to electra
* Validate that each committee bitfield in an aggregate contains at least one non-zero bit
* Add single attestation
* Add single attestation to ssz static
* Fix typo
Co-authored-by: Md Amaan <114795592+Redidacove@users.noreply.github.com>
* Update UpgradeToElectra comments
* Add no lint dupword
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
Co-authored-by: Md Amaan <114795592+Redidacove@users.noreply.github.com>
* Make it the default
* Changelog
* Remove outdated flag
* Update `go-libp2p` to `v0.36.5` and `webtransport-go` to `master`.
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* `listenForNewNodes` and `FindPeersWithSubnet`: Stop using `Readnodes` and use iterator instead.
It avoids infinite loop in small devnets.
* Update beacon-chain/p2p/discovery.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
---------
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* Use slot to determine version
* gaz
* solve cyclic dependency
* Radek' review
* unit test
* gaz
* use require instead of assert
* fix test
* fix test
* fix TestGetAggregateAttestation
* fix ListAttestations test
* James' review
* Radek' review
* add extra checks to GetAttesterSlashingsV2
* fix matchingAtts
* improve tests + fix
* fix
* stop appending all non electra atts
* more tests
* changelog
* revert TestProduceSyncCommitteeContribution changes
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
* Check if validator exists when applying pending deposit
* Add test TestProcessPendingDepositsMultiplesSameDeposits
* keep a map of added pubkeys
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* adding nil checks on interface
* changelog
* add linting
* adding missed checks
* review feedback
* attestation bits should not be in nil check
* fixing nil checks
* simplifying function
* fixing some missed items
* more missed items
* fixing more tests
* reverting some changes and fixing more tests
* adding in source check back in
* missed test
* sammy's review
* radek feedback
* Cast to String Without Allocating
* Make it its own method
* Changelog
* Gosec
* Add benchmark, fuzz test, and @kasey's implementation.
* Gosec
* Fix benchmark test names
* Kasey's Suggestion
* Radek's Suggestion
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* implementing new decisions around exectuion requests
* fixing test fixture
* adding in more edge case checks and tests
* changelog
* fixing unsafe type cast
* Update beacon-chain/execution/engine_client_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update proto/engine/v1/electra_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* updating based on preston's feedback and adding more tests for edge cases
* adding more edgecases, and unit tests
* fixing tests
* missed some export changes
* adding more tests
* Update proto/engine/v1/electra.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* reducing complexity of function based on feedback
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Update bazel-lib
* Update rules_oci
* Compress pkg_tar
* Add a note about 401 download for distroless/cc-debian11
* Update CHANGELOG.md
* Re-upload distroless/cc-debian11 to prysmaticlabs/distroless/cc-debian11 such that the image is public.
Ran the following command:
gcrane cp 'gcr.io/distroless/cc-debian11@sha256:b82f113425c5b5c714151aaacd8039bc141821cdcd3c65202d42bdf9c43ae60b' gcr.io/prysmaticlabs/distroless/cc-debian11:latest
* Back out "Update rules_oci"
This backs out commit 64200fb25e.
* Use engine api get-blobs for block subscriber
Debug
changelog
add proto marshal and unmarshal
Kasey's feedback
* Feedback
* Preston's feedback
* Exist argument should not be hardcoded with kzg count
* new type for tests where errors are only logged
* StreamHandler waits for write loop exit
* add test case for writer timeout
* add changelog
* add missing file
* logging fix
* fix logging test to allow info logs
* naming/comments; make response controller private
* simplify cancel defers
* fix typo in test file name
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* wip
* gaz
* rename field
* sammy review
* updating execution api request and reverting response back
* fixing linting
* changelog
* changelog
* adding in serialization of requests
* code cleanup
* adding some happy path tests and fixing mock
* mock still broken
* fixing linting
* updating name on proto
* missed naming
* placeholder fix for TestClient_HTTP
* removing duplicate change log
* adding in test for get payloadv4 as well as some tests
* added tests for execution client testing, fixed encode type
* adding comment for placeholder test
* fixing test and addressing feedback
* feedback
* flipping the test names, was used in reverse
* feedback from kasey
* reverting switch back to if statements to fix bug
* lint
* 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>
* Add Current Changes To Routine
* Add In New Test
* Add Feature Flag
* Add Discovery Rebooter feature
* Do Not Export Mutex And Use Zero Value Mutex
* Wrap Error For Better Debugging
* Fix Function Name and Add Specific Test For it
* Manu's Review
* sse implementation that sheds stuck clients
* Radek and James feedback
* Refactor event streamer code for readability
* less-flaky test signaling
* test case where queue fills; fixes
* add changelog entry
* james and preston feedback
* swap our Subscription interface with an alias
* event.Data can be nil for the payload attr event
* deepsource
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* allow users to publish blobs
Allowing users to publish blobs before publishing blocks, gives the blobs a head start. They can begin to propagate around the network while the block is being validated.
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
* Update beacon-chain/rpc/prysm/beacon/handlers.go
---------
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* removing extra container for ssz blob sidecar response
* gaz and changelog
* gaz
* fixing dependencies
* fixing test
* updating values based on feedback"
* version bump on k8s io client-go and apimachinery
* bazel file served
* fixing build issues
* some changes in noops functions
* Update CHANGELOG.md
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Use read only validators on ApplyToEveryValidator
* Use ReadFromEveryValidator on slashing
* change changelog
* Revert "Use ReadFromEveryValidator on slashing"
This reverts commit 74c055bddb56e0573075c71df8a40f1c6a9bfdfd.
* looking at ways to reduce validator registration calls
* small mistake, should be epoch start
* adding more optimizations for reducing registration calls while covering more edgecases
* linting
* adding change log and force full push override
* fixing bug and adding tests
* changing if statement just to be safe
* potuz feedback for easier readability
* more review feedback for simplicity
* more review suggestions from potuz
* fix unit test
* reduce redundancy
* Update CHANGELOG.md
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* small nitpick
* fixing typo
* updating logs
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* e2e release test breaks due to changes in flag naming
* changing approach to fix
* adding some small alias test
* fixing test, changelog, and flag name
* Update config_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* wip passing e2e
* reverting temp comment
* remove unneeded comments
* fixing merge errors
* fixing more bugs from merge
* fixing test
* WIP moving code around and fixing tests
* unused linting
* gaz
* temp removing these tests as we need placeholder/wrapper APIs for them with the removal of the gateway
* attempting to remove dependencies to gRPC gateway , 1 mroe left in deps.bzl
* renaming flags and other gateway services to http
* goimport
* fixing deepsource
* git mv
* Update validator/package/validator.yaml
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/package/validator.yaml
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update cmd/beacon-chain/flags/base.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update cmd/beacon-chain/flags/base.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update cmd/beacon-chain/flags/base.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* addressing feedback
* missed lint
* renaming import
* reversal based on feedback
* fixing web ui registration
* don't require mux handler
* gaz
* removing gRPC service from validator completely, merged with http service, renames are a work in progress
* updating go.sum
* linting
* trailing white space
* realized there was more cleanup i could do with code reuse
* adding wrapper for routes
* reverting version
* fixing dependencies from merging develop
* gaz
* fixing unit test
* fixing dependencies
* reverting unit test
* fixing conflict
* updating change log
* Update log.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* gaz
* Update api/server/httprest/server.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* addressing some feedback
* forgot to remove deprecated flag in usage
* gofmt
* fixing test
* fixing deepsource issue
* moving deprecated flag and adding timeout handler
* missed removal of a flag
* fixing test:
* Update CHANGELOG.md
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* addressing feedback
* updating comments based on feedback
* removing unused field for now, we can add it back in if we need to use the option
* removing unused struct
* changing api-timeout flag based on feedback
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* change LCUpdate to use LCHeader
* fix api struct usages
* fix api struct finalized_header
* add lightclientheader to proto structs
* fix proto usages
* fix proto usages in events
* fix uppercase field in protobuf defenition
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Adds a wrapper package
* Gazelle
* Add in Empty Span
* Revert It Back
* Add back reference
* Set It As Empty
* fix missing import
* remove redundant alias
* remove unused
---------
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: Saolyn <sammy@rosso.red>
* hardcoded GenesisValidatorsRoot
* added in mainnet.config
* updated desc
* added it in all testnets
* minor change
* added roots instead of empty and fn to compute byte32 from hex
* added in e2e testnet_config
* fixed test
* minor fix
* removed fn and added bytes output directly
* Add test for genesis validator root mainnet value
* removed root from minimal and testnet
* removed root
* Update CHANGELOG.md
* Fix bazel package visiblity
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Preston Van Loon <preston@pvl.dev>
* PR to update workflow check dependencies
* Updated build checkout version to v4
* Updated to go 1.23.0
* Updated lint version to v1.60.3
* Revert to 1.22.3
* Updated go to 1.23
* revert
* Updated setup-go to v5
* Update lint to 1.60.2
* Revert changes
* Update Lint version to v1.60.3
* Update lint to go 1.23.0
* Update golanci.yml to 1.23.0
* Revert and keep to golang 1.22.4
* Disable mnd
* Downgrade to current version
* Add update to go 1.26
* Update to go 1.22.6
* Update .golangci.yml to 1.22.6
* Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage
* bugfix for checking stringslice flag to use isSet
* fix: replace `BeaconBlockHeader` in `createLightClientBootstrap` with `LightClientHeader`
* minor fix in `handlers_test.go`
* check if `beacon` is `nil` instead of `header`
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* create light-client-updates bucket
* Electra committe validation for aggregate and proof (#14317)
* Electra committe validation for aggregate and proof
* review
* update comments
* Refactor get local payload (#14327)
* Refactor get local payload
* Fix go lint: new line
* add lightclient db kv functions
* lightclient db tests
* move blockchain/lightclient.go to core/light-client package
* add comparison check for start and end period
* create testing/utils/lightcilent.go
* lightclient db tests
* fix imports and usages
* fix imports and usages in process_block_helpers
* fix bazel dependencies
* remove unnecessary nil check
* add more tests for lightclient kv functions
* refactor tests
* refactor kv.LightClientUpdates
* fix db to return every update that is available in the requested range
* run gazzele fix
* return empty map in case of empty db
* fix goimports errors
* goimports
* Revert "Auxiliary commit to revert individual files from aa7ce6f37cb6767cf11642b022b2ce59d42ae621"
This reverts commit 33c707f5bd164386449dc14ff27d95ad5f195161.
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: terence <terence@prysmaticlabs.com>
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
* feat: implement function `PayloadProof` to calculate proof of execution payload
* remove comments
* feat: implement function to compute field roots of
* feat: implement function to compute `BeaconBlock` field roots and add tests
* fix dependencies
* check if interface implements the assserted type
* fix: lint
* replace `ok != true` with `!ok`
* remove unused parameter from `PayloadProof`
* remove test and move `PayloadProof` to `blocks/proofs.go`
* remove `PayloadProof` from `fieldtrie`
* replace `fieldtrie.ProofFromMerkleLayers` with `trie.ProofFromMerkleLayers`
* Update container/trie/sparse_merkle.go
* update dependencies
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* Allow blobs in Electra
* Add Test
* Add Error for unknown request type
* Fix Test
* fix tests
* clean up logic
---------
Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
* feat: (WIP)implement ``ComputeFieldRootsForBlockBody`` function to compute roots of fields in BlockBody
* calculate field roots upto ``deposits``
* add some required constants fix some errors
* implement ``ComputeFieldRootsForBlockBody`` function for all fields in ``BeaconBlockBody``
* populate `fieldRoots` based on block body version
* fix constants
* `bazel run //:gazelle -- fix`
* remove nested `if`s
* formatting 1
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* formatting 2
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* remove unrequired check
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* update naming 1
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
* update function name
* add test for Phase0 block body
* update Phase0 test
* update phase0 test without setting any fields
* fix some errors in Phase0 test
* don't set fields
* add altair test
* add tests upto Electra
* fix the function for deneb and newer forks
* update dependencies
* add checks to ensure interface implements the asserted type
---------
Co-authored-by: Radosław Kapka <radoslaw.kapka@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* 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>
* 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
* 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>
* 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
* 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'
* 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
* fixing marshalling and adding more to unit test
* updating missed consolidation requests
* renaming variables
* adding test gen
* reverting config change
* `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>
* 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
* 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-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>
* `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
* 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>
* 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
* 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>
* 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>
* 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>
* 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
* 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
* 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 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>
* 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>
* 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>
* 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
* 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>
* 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
* GET
* POST
* Revert "Auxiliary commit to revert individual files from 615feb104004d6a945ededf5862ae38325fc7ec2"
This reverts commit 55cf071c684019f3d6124179154c10b2277fda49.
* comment fix
* deepsource
* Beacon-api: broadcast blobs in the event of seen block
* Fix parameters
* Fix test
* Check forkchoice
* Ran go format
* Revert "Ran go format"
This reverts commit 091e77e81d6e2b9861fecc27c0bad1898033f9a3.
* James feedback
* Radek's feedback
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Fix bad tests
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* allow other pkgs to check for blobs in pruning cache
* address deepsource complaints
* custom error to simplify test setup
* add AllAvailable method
* make storage summary slot field private
* unit test and off-by-one fix
* remove comment with copy of tested function
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Revert "Modify the algorithm of `updateFinalizedBlockRoots` (#13486)"
This reverts commit 32fb183392.
* migration to fix index corruption from pr 13486
* bail as soon as we see 10 epochs without the bug
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Remove check for duplicates in pending attestation queue
The current queue will only save 1 unaggregated attestation for a pending block because we wrap the object into a SignedAggregatedAttestationAndProof with a zeroed aggregator.
* fix tests
* add max/min span visualisation tool cli
* go mod tidy
* lint imports
* remove typo
* fix epoch table value
* fix deepsource
* add dep to bazel
* fix dep import order
* change command name from span to slasher-span-display
* change command args style using - instead of _
* sed s/CONFIGURATION/SLASHER PARAMS//
* change double neg to double pos condition
* remove unused anonymous func
* better function naming
* add range condition
* [deepsource] Fix Empty slice literal used to declare a variable
GO-W1027
* correct typo
* do not show incorrect epochs due to round robin
* fix import
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
ValidateClock in ValidateAttestationTime is useless
The check is that the attSlot is not > than the currentslot + 128 slots.
Later there's a check that the attSlot start time is not > than current slot
start time + clockDisparity.
if attSlot > than currentSlot + 128 slots, then the second check would fail
anyway.
The lattest check already guarantees that the attSlot cannot be larger than the
currentSlot, therefore it may never happen that attEpoch > currentEpoch. We just
need to check for Deneb that attEpoch >= currentEpoch - 1.
Removes also some duplicated variables like the attestation epoch being computed
twice.
* refactor batch verifier to share with pending queue
* unit test for batch verifier
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* 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>
* create the log file along with its parent directory if not present
* only give ReadWritePermissions to the log file
* use io/file package to create the parent directories
* fix ci related issues
* add regression tests
* run gazelle
* fix tests
* remove print statements
* gazelle
* Remove failing test for MkdirAll, this failure is not expected
---------
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>
* add log message if in da check at slot end
* don't bother logging late da check start
* break up defer with a var, too dense all together
* pass slot instead of block ref
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* addressing errors on events endpoint
* reverting timeout on get health
* fixing linting
* fixing more linting
* Update validator/client/beacon-api/beacon_api_validator_client.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/rpc/eth/events/events.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* reverting change and removing line on context done which creates a superfluous response.WriteHeader error
* gofmt
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* make it very big
* use new pruning implementation
* handle pre deneb
* revert cache change
* less verbose
* gaz
* Update beacon-chain/operations/attestations/prune_expired.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* gofmt
* be safer
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* handle special case of batch size=1
* unit test case for backfill batch len=1
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* flag to set an older backfill slot target
* wire up flag to main cli and usage
* fix deepsource complaints
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `subscribeStaticWithSubnets`: Fix docstring.
* `buildOptions`: Avoid `options` mutations.
* `dv5Cfg`: Avoid mutation.
* `RefreshENR`: Use default for all but Phase0.
* `udp4`, `udp6`: Create enum.
* `p2p.Config`: `BootstrapNodeAddr`==> `BootstrapNodeAddrs`.
* `p2p.Config`: `Discv5BootStrapAddr` ==> `Discv5BootStrapAddrs`.
* `TestScorers_BadResponses_Score`: Improve.
* `BeaconNode`: Avoid mutation.
* `TestStore_TrustedPeers`: Remove blankline.
* Remove blank identifiers.
* `privKey`: Keep the majority of code with low indentation.
* `P2PPreregistration`: Return error instead of fatal log.
* `parseBootStrapAddrs` => `ParseBootStrapAddrs` (export)
* `p2p.Config`: Remove `BootstrapNodeAddrs`.
* `NewService`: Avoid mutation when possible.
* `Service`: Remove blank identifier.
* `buildOptions`: Avoid `log.Fatalf` (make deepsource happy).
* `registerGRPCGateway`: Use `net.JoinHostPort` (make deepsource happy).
* `registerBuilderService`: Make deepsource happy.
* `scorers`: Add `NoLock` suffix (make deepsource happy).
* `scorerr`: Add some `NoLock`suffixes (making deepsource happy).
* `discovery_test.go`. Remove init.
Rationale:
`rand.Seed` is deprecated: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator.
This makes deepsource happy as well.
* `createListener`: Reduce cyclomatic complexity (make deepsource happy).
* `startDB`: Reduce cyclomatic complexity (make deepsource happy).
* `main`: Log a FATAL on error.
This way, the error message is very readable.
Before this commit, the error message is the less readable
message in the logs.
* `New`: Reduce cyclomatic complexity (make deepsource happy).
* `main`: Avoid `App` mutation, and make deepsource happy.
* Update beacon-chain/node/node.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* `bootnodes` ==> `BootNodes` (Fix PR comment).
* Remove duplicate `configureFastSSZHashingAlgorithm` since already done in `configureBeacon`. (Fix PR comment)
* Add `TestCreateLocalNode`. (PR comment fix.)
* `startModules` ==> `startBaseServices (Fix PR comment).
* `buildOptions` return errors consistently.
* `New`: Change ordering.
---------
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* use real blob verifier in forkchoice spectest
* wip
* Use real blob sidecar for test
* Set file db correctly
* correctly handle blob cases where valid=false
* work-around spectest's weird Fork in genesis state
* gaz
* revert T-money's log level change
* rm whitespace
* unskip minimal test
* Preston's feedback
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* add them
* Ensure activation epoch does not overflow
* add them all in
* better check for overflow
* fix tests
* fix tests
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* `EpochFromString`: Use already defined `Uint64FromString` function.
* `Test_uint64FromString` => `Test_FromString`
This test function tests more functions than `Uint64FromString`.
* Slashing protection history: Remove unreachable code.
The function `NewKVStore` creates, via `kv.UpdatePublicKeysBuckets`,
a new item in the `proposal-history-bucket-interchange`.
IMO there is no real reason to prefer `proposal` than `attestation`
as a prefix for this bucket, but this is the way it is done right now
and renaming the bucket will probably be backward incompatible.
An `attestedPublicKey` cannot exist without
the corresponding `proposedPublicKey`.
Thus, the `else` portion of code removed in this commit is not reachable.
We raise an error if we get there.
This is also probably the reason why the removed `else` portion was not
tested.
* `NewKVStore`: Switch items in `createBuckets`.
So the order corresponds to `schema.go`
* `slashableAttestationCheck`: Fix comments and logs.
* `ValidatorClient.db`: Use `iface.ValidatorDB`.
* BoltDB database: Implement `GraffitiFileHash`.
* Filesystem database: Creates `db.go`.
This file defines the following structs:
- `Store`
- `Graffiti`
- `Configuration`
- `ValidatorSlashingProtection`
This files implements the following public functions:
- `NewStore`
- `Close`
- `Backup`
- `DatabasePath`
- `ClearDB`
- `UpdatePublicKeysBuckets`
This files implements the following private functions:
- `slashingProtectionDirPath`
- `configurationFilePath`
- `configuration`
- `saveConfiguration`
- `validatorSlashingProtection`
- `saveValidatorSlashingProtection`
- `publicKeys`
* Filesystem database: Creates `genesis.go`.
This file defines the following public functions:
- `GenesisValidatorsRoot`
- `SaveGenesisValidatorsRoot`
* Filesystem database: Creates `graffiti.go`.
This file defines the following public functions:
- `SaveGraffitiOrderedIndex`
- `GraffitiOrderedIndex`
* Filesystem database: Creates `migration.go`.
This file defines the following public functions:
- `RunUpMigrations`
- `RunDownMigrations`
* Filesystem database: Creates proposer_settings.go.
This file defines the following public functions:
- `ProposerSettings`
- `ProposerSettingsExists`
- `SaveProposerSettings`
* Filesystem database: Creates `attester_protection.go`.
This file defines the following public functions:
- `EIPImportBlacklistedPublicKeys`
- `SaveEIPImportBlacklistedPublicKeys`
- `SigningRootAtTargetEpoch`
- `LowestSignedTargetEpoch`
- `LowestSignedSourceEpoch`
- `AttestedPublicKeys`
- `CheckSlashableAttestation`
- `SaveAttestationForPubKey`
- `SaveAttestationsForPubKey`
- `AttestationHistoryForPubKey`
* Filesystem database: Creates `proposer_protection.go`.
This file defines the following public functions:
- `HighestSignedProposal`
- `LowestSignedProposal`
- `ProposalHistoryForPubKey`
- `ProposalHistoryForSlot`
- `ProposedPublicKeys`
* Ensure that the filesystem store implements the `ValidatorDB` interface.
* `slashableAttestationCheck`: Check the database type.
* `slashableProposalCheck`: Check the database type.
* `slashableAttestationCheck`: Allow usage of minimal slashing protection.
* `slashableProposalCheck`: Allow usage of minimal slashing protection.
* `ImportStandardProtectionJSON`: Check the database type.
* `ImportStandardProtectionJSON`: Allow usage of min slashing protection.
* Implement `RecursiveDirFind`.
* Implement minimal<->complete DB conversion.
3 public functions are implemented:
- `IsCompleteDatabaseExisting`
- `IsMinimalDatabaseExisting`
- `ConvertDatabase`
* `setupDB`: Add `isSlashingProtectionMinimal` argument.
The feature addition is located in `validator/node/node_test.go`.
The rest of this commit consists in minimal slashing protection testing.
* `setupWithKey`: Add `isSlashingProtectionMinimal` argument.
The feature addition is located in `validator/client/propose_test.go`.
The rest of this commit consists in tests wrapping.
* `setup`: Add `isSlashingProtectionMinimal` argument.
The added feature is located in the `validator/client/propose_test.go`
file.
The rest of this commit consists in tests wrapping.
* `initializeFromCLI` and `initializeForWeb`: Factorize db init.
* Add `convert-complete-to-minimal` command.
* Creates `--enable-minimal-slashing-protection` flag.
* `importSlashingProtectionJSON`: Check database type.
* `exportSlashingProtectionJSON`: Check database type.
* `TestClearDB`: Test with minimal slashing protection.
* KeyManager: Test with minimal slashing protection.
* RPC: KeyManager: Test with minimal slashing protection.
* `convert-complete-to-minimal`: Change option names.
Options were:
- `--source` (for source data directory), and
- `--target` (for target data directory)
However, since this command deals with slashing protection, which has
source (epochs) and target (epochs), the initial option names may confuse
the user.
In this commit:
`--source` ==> `--source-data-dir`
`--target` ==> `--target-data-dir`
* Set `SlashableAttestationCheck` as an iface method.
And delete `CheckSlashableAttestation` from iface.
* Move helpers functions in a more general directory.
No functional change.
* Extract common structs out of `kv`.
==> `filesystem` does not depend anymore on `kv`.
==> `iface` does not depend anymore on `kv`.
==> `slashing-protection` does not depend anymore on `kv`.
* Move `ValidateMetadata` in `validator/helpers`.
* `ValidateMetadata`: Test with mock.
This way, we can:
- Avoid any circular import for tests.
- Implement once for all `iface.ValidatorDB` implementations
the `ValidateMetadata`function.
- Have tests (and coverage) of `ValidateMetadata`in
its own package.
The ideal solution would have been to implement `ValidateMetadata` as
a method with the `iface.ValidatorDB`receiver.
Unfortunately, golang does not allow that.
* `iface.ValidatorDB`: Implement ImportStandardProtectionJSON.
The whole purpose of this commit is to avoid the `switch validatorDB.(type)`
in `ImportStandardProtectionJSON`.
* `iface.ValidatorDB`: Implement `SlashableProposalCheck`.
* Remove now useless `slashableProposalCheck`.
* Delete useless `ImportStandardProtectionJSON`.
* `file.Exists`: Detect directories and return an error.
Before, `Exists` was only able to detect if a file exists.
Now, this function takes an extra `File` or `Directory` argument.
It detects either if a file or a directory exists.
Before, if an error was returned by `os.Stat`, the the file was
considered as non existing.
Now, it is treated as a real error.
* Replace `os.Stat` by `file.Exists`.
* Remove `Is{Complete,Minimal}DatabaseExisting`.
* `publicKeys`: Add log if unexpected file found.
* Move `{Source,Target}DataDirFlag`in `db.go`.
* `failedAttLocalProtectionErr`: `var`==> `const`
* `signingRoot`: `32`==> `fieldparams.RootLength`.
* `validatorClientData`==> `validator-client-data`.
To be consistent with `slashing-protection`.
* Add progress bars for `import` and `convert`.
* `parseBlocksForUniquePublicKeys`: Move in `db/kv`.
* helpers: Remove unused `initializeProgressBar` function.
When a late block arrives and the beacon is proposing the next block, we
perform several checks to allow for the next block to reorg the incoming
late block.
Among those checks, we check that the parent block has been heavily
attested (currently 160% of the committee size).
We perform this check in these circumstances:
- When the late block arrives
- At 10 seconds into the slot
- At 0 seconds into the next slot (at proposing time)
The problem is that for blocks that arrive between 4 seconds and 10
seconds, the parent block will not have yet this expected weight since
attestations from the current committee were not imported yet, and thus
Prysm will send an FCU with payload attributes anyway at this time.
What happens is that Prysm keeps the EL building different blocks based
on different parents at the same time, when later in the next slot it
calls to propose, it will reorg the late block anyway and the EL would
have been computing a second payload uselessly.
This PR enables this check only when calling `ShouldOverrideFCU` after
10 seconds into the slot which we do only after having imported the
current attestations. We may want to actually remove this check entirely
from `ShouldOverrideFCU` and only keep it in `ProposerHead`.
Shout out to Anthithesis for reporting an issue that led to this
discoverly.
* employ a val reader to prevent constant copies
* clean it up and fix tests
* gaz
* radek's review
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Improve package documentation.
* `processAttestations`: Improve logging.
* Add `Benchmark_checkSurroundVotes` benchmark.
* Implement `saveChunksToDisk` as remplacement of `saveUpdatedChunks`.
The idea is to open only on DB transaction for all validator chunk indexes instead of
one DB transaction per validator chunk index.
It saves the overhead due to transaction start/stop of the DB.
Result of `Benchmark_checkSurroundVotes`:
- Before this commit: 133 seconds
- After this commit: 5.05 seconds
* `LoadSlasherChunks` and `SaveSlasherChunks`: Batch.
* `loadChunks` ==> `loadChunksFromDisk`
* `updatedChunkByChunkIndex`: Don't update if `latestEpochWritten == currentEpoch `.
* `updatedChunkByChunkIndex`: Load all needed chunks once.
* `latestEpochWritten` ==> `latestEpochUpdated`.
* `checkSurroundVotes`: Dump to disk at most every `25_600` chunks.
* `SaveAttestationRecordsForValidators`: Batch.
* `batchSize`: Use as package const and add comment.
* pending broadcast err if missing blobs and 0 peers
* compute request first for len check
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `getChunk` ==> `getChunkFromDatabase`.
* `loadChunks`: Rename variables.
* `Update`: Use explicit arguments.
* `detect_attestations.go`: Reduce abstraction layers.
* `loadAndUpdateChunks`: Change arguments order.
* `updatedChunkByChunkIndex`: Update all known validators in the chunk.
* `LastEpochWrittenForValidators`: Avoid avoidable `for`loop.
* `chunks.go`: Ensure implementations respect the interface.
* `LastEpochWrittenForValidators`: Stop considering lack of epoch as genesis epoch.
* `updatedChunkByChunkIndex`: Don't update latest updated epoch.
And add a bunch of tests.
* Improve slasher cold boot duration.
Before this commit, on a slasher cold boot (aka, without any db),
the `updatedChunkByChunkIndex` function looped for all validators
AND for all epochs between the genesis epoch and the current epoch.
This could take several dozen of minutes, and it is useless since the
min/max spans are actually a circular buffer with a limited lenght.
Cells of min/max spans can be overwritten (with the same value)
plenty of times.
After this commit, the `updatedChunkByChunkIndex` function loops
for all validators AND AT most 'historyLength' lenght.
Every cell of min/max spans are written AT MOST once.
Time needed for slasher boot goes from `O(nm)` to "only" `O(m)`, where:
- `n` is the number of epochs since the genesis.
- `m` is the number of validators.
* First take at updating everything to v5
* Patch gRPC gateway to use prysm v5
Fix patch
* Update go ssz
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* retrieve and save blobs during backfill
* Update beacon-chain/sync/backfill/batch.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/sync/backfill/blobs.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/sync/backfill/metrics.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* make blobSync initialization path a little safer
* use bytes.Equal to avoid extra allocation
* stop using log.Fatal and other little cleanups
* wrap up post blob sync actions in batch mutator
* unit test coverage on verifier
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* `LastEpochWrittenForValidators`: Use golang if.
* `SaveLastEpochsWrittenForValidators`: Refactor.
* `SaveLastEpochsWrittenForValidators`: Fix when `epochByValIndex` > `batchSize`.
Before this commit, `TestStore_LastEpochWrittenForValidators` works if `validatorsCount <= 10000`
and stops working if `validatorsCount > 10000`.
* Slasher: Detect surrounded votes in multiple batches.
Fixes https://github.com/prysmaticlabs/prysm/issues/13591.
* `Test_processAttestations`: Remove duplicated tests.
* Sort indexed attestations by data root.
* `processAttestations`: Don't return duplicate slashings anymore.
Fix https://github.com/prysmaticlabs/prysm/issues/13592.
* `AttesterDoubleVote`: Rename fields.
* Detect double votes in different batches.
In order to do that:
1. Each attestation of the batch is tested against the other attestations of the batch.
2. Each attestation of the batch is tested against the content of the database.
2. Attestations are saved into the database.
Fixes https://github.com/prysmaticlabs/prysm/issues/13590.
* `helpers.go`: Improve naming consistency.
* `detect_attestations.go`: Improve readability.
* `receive.go`: Add `attsQueueSize` in log message.
* `checkSlashableAttestations`: Improve logging.
`avgBatchProcessingTime` is not displayed any more if not batch is
processed.
* `loadChunks`: Use explicit `chunkKind` and `chunkIndices`.
* `getChunk`: Use specific `chunkIndex` and `chunkKind`.
* `validatorIndicesInChunk` -> `validatorIndexesInChunk`.
* `epochUpdateForValidator`: Use explicit arguments.
* `getChunk`: Change order of arguments.
* `latestEpochWrittenForValidator`: Use `ok` parameter.
So the default value is not any more considered as the absence of
value.
* `applyAttestationForValidator`: Use explicit arguments.
* `updateSpans`: Use explicit arguments.
* `saveUpdatedChunks`: Use explicit arguments.
* `checkSurrounds`: Use explicit arguments.
We see here that, previously, in `checkSlashableAttestations`,
`checkSurrounds` was called with the default value of `slashertypes`: `MinSpan`.
Now, we set it expliciterly at `MinSpan`, which may explicit a bug.
* `epochUpdateForValidator`: Set modified by the function argument first.
* `applyAttestationForValidator`: Set mutated argument `chunksByChunkIdx`first.
* `applyAttestationForValidator`: Rename variables.
* `Test_processQueuedAttestations`: Fix test.
Two tests were actually exactly the same.
* `updateSpans`: Keep happy path in the outer scope.
Even if in this case the "happy" path means slashing.
* `checkSurrounds`: Rename variable.
* `getChunk`: Avoid side effects.
It adds a few lines for callers, but it does not modify any more
arguments and it does what it says: getting a chunk.
* `CheckSlashable`: Flatten.
* `detect_attestations_test.go`: Simplify.
* `CheckSlashable`: Add error log in case of missing attestation.
* `processQueuedAttestations`: Extract a sub function.
So testing will be easier.
* `processAttesterSlashings` and `processProposerSlashings`: Improve.
* `processAttesterSlashings`: Return processed slashings.
* `createAttestationWrapper`: Rename variables.
* `signingRoot` ==> `headerRoot` or `dataRoot`.
Before this commit, there is two typse of `signing root`s floating around.
- The first one is a real signing root, aka a hash tree root computed from an object root and
a domain. This real signing root is the object ready to be signed.
- The second one is a "false" signing root, which is actually just the hash tree root of an object. This object is either the `Data` field of an attestation, or the `Header` field of a block.
Having 2 differents objects with the same name `signing root` is quite confusing.
This commit renames wrongly named `signing root` objects.
* `createAttestationWrapper` => `createAttestationWrapperEmptySig`.
So it's clear for the user that the created attestation wrapper has an empty signature.
* Implement `createAttestationWrapper`.
* `processAttestations`: Return processed attester slashings.
* Test `processAttestations` instead of `processQueuedAttestations`.
By testing `processAttestations` instead of `processQueuedAttestations`, we get rid of a lot of tests fixtures, including the 200 ms sleep.
The whole testing duration is shorter.
* `Test_processAttestations`: Allow multiple steps.
* `Test_processAttestations`: Add double steps tests.
Some new failing tests are commented with a corresponding github issue.
* `NextChunkStartEpoch`: Fix function comment.
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* `chunks.go`: Avoid templating log messages.
* `checkSlashableAttestations`: Simplify duration computation.
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Add coreutils to docker images
* add coreutils dependencies
* Add a prysmaticlabs.com/uploads backup of the deb files
* Run gazelle and fix issues
* Remove broken tar, change http_archive deps to debian_archive, remove http mirrors in favor of snapshot
* Add comments about which deps are required by other deps
* Slasher: Ensure all gorouting are stopped before running `Stop` actions.
Fixes#13550.
In tests, `exitChan` are now useless since waitgroup are used to wait
for all goroutines to be stopped.
* `slasher.go`: Add comments and rename some variables. - NFC
* `detect_blocks.go`: Improve. - NFC
- Rename some variables.
- Add comments.
- Use second element of `range` when possible.
* `chunks.go`: Remove `_`receivers. - NFC
* `validateAttestationIntegrity`: Improve documentation. - NFC
* `filterAttestations`: Avoid `else`and rename variable. - NFC
* `slasher.go`: Fix and add comments.
* `SaveAttestationRecordsForValidators`: Remove unused code.
* `LastEpochWrittenForValidators`: Name variables consistently. - NFC
Avoid mixes between `indice(s)`and `index(es)`.
* `SaveLastEpochsWrittenForValidators`: Name variables consistently. - NFC
* `CheckAttesterDoubleVotes`: Rename variables and add comments. - NFC
* `schema.go`: Add comments. - NFC
* `processQueuedAttestations`: Add comments. - NFC
* `checkDoubleVotes`: Rename variable. - NFC
* `Test_processQueuedAttestations`: Ensure there is no error log.
* `shouldNotBeSlashable` => `shouldBeSlashable`
* `Test_processQueuedAttestations`: Add 2 test cases:
- Same target with different signing roots
- Same target with same signing roots
* `checkDoubleVotesOnDisk` ==> `checkDoubleVotes`.
Before this commit, `checkDoubleVotes` did two tasks:
- Checking if there are any slashable double votes in the input
list of attestations with respect to each other.
- Checking if there are any slashable double votes in the input
list of attestations with respect to our database.
However, `checkDoubleVotes` is called only in
`checkSlashableAttestations`.
And `checkSlashableAttestations` is called only in:
- `processQueuedAttestations`, and in
- `IsSlashableAttestation`
Study of case `processQueuedAttestations`:
---------------------------------------------
In `processQueuedAttestations`, `checkSlashableAttestations`
is ALWAYS called after
`Database.SaveAttestationRecordsForValidators`.
It means that, when calling `checkSlashableAttestations`,
`validAtts` are ALREADY stored in the DB.
Each attestation of `validAtts` will be checked twice:
- Against the other attestations of `validAtts` (the portion of
deleted code)
- Against the content of the database.
One of those two checks is redundent.
==> We can remove the check against other attestations in `validAtts`.
Study of case `Database.SaveAttestationRecordsForValidators`:
----------------------------------------------------------------
In `Database.SaveAttestationRecordsForValidators`,
`checkSlashableAttestations` is ALWAYS called with a list of
attestations containing only ONE attestation.
This only attestaion will be checked twice:
- Against itself, and an attestation cannot conflict with itself.
- Against the content of the database.
==> We can remove the check against other attestations in `validAtts`.
=========================
In both cases, we showed that we can remove the check of attestation
against the content of `validAtts`, and the corresponding test
`Test_checkDoubleVotes_SlashableInputAttestations`.
* `Test_processQueuedBlocks_DetectsDoubleProposals`: Wrap proposals.
So we can add new proposals later.
* Fix slasher multiple proposals false negative.
If a first batch of blocks is sent with:
- validator 1 - slot 4 - signing root 1
- validator 1 - slot 5 - signing root 1
Then, if a second batch of blocks is sent with:
- validator 1 - slot 4 - signing root 2
Because we have two blocks proposed by the same validator (1) and for
the same slot (4), but with two different signing roots (1 and 2), the
validator 1 should be slashed.
This is not the case before this commit.
A new test case has been added as well to check this.
Fixes#13551
* `params.go`: Change comments. - NFC
* `CheckSlashable`: Keep the happy path without indentation.
* `detectAllAttesterSlashings` => `checkSurrounds`.
* Update beacon-chain/db/slasherkv/slasher.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* Update beacon-chain/db/slasherkv/slasher.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* `CheckAttesterDoubleVotes`: Keep happy path without indentation.
Well, even if, in our case, "happy path" mean slashing.
* 'SaveAttestationRecordsForValidators': Save the first attestation.
In case of multiple votes, arbitrarily save the first attestation.
Saving the first one in particular has no functional impact,
since in any case all attestations will be tested against
the content of the database. So all but the first one will be
detected as slashable.
However, saving the first one and not an other one let us not
to modify the end to end tests, since they expect the first one
to be saved in the database.
* Rename `min` => `minimum`.
Not to conflict with the new `min` built-in function.
* `couldNotSaveSlashableAtt` ==> `couldNotCheckSlashableAtt`
---------
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* backfill service
* fix bug where origin state is never unlocked
* support mvslice states
* use renamed interface
* refactor db code to skip block cache for backfill
* lint
* add test for verifier.verify
* enable service in service init test
* cancellation cleanup
* adding nil checks to configset juggling
* assume blocks are available by default
As long as we're sure the AvailableBlocker is initialized correctly
during node startup, defaulting to assuming we aren't in a checkpoint
sync simplifies things greatly for tests.
* block saving path refactor and bugfix
* fix fillback test
* fix BackfillStatus init tests
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Check init sync before getting payload attributes
This PR adds a helper to forkchoice to return the delay of the latest
imported block. It also adds a helper with an heuristic to check if the
node is during init sync. If the highest imported node was imported with
a delay of less than an epoch then the node is considered in regular
sync. If on the other hand, in addition the highest imported node is
more than two epochs old, then the node is considered in init Sync.
The helper to check this only uses forkchoice and therefore requires a
read lock. There are four paths to call this
1) During regular block processing, we defer a function to send the
second FCU call with attributes. This function may not be called at
all if we are not regularly syncing
2) During regular block processing, we check in the path
`postBlockProces->getFCUArgs->computePayloadAttributes` the payload
attributes if we are syncing a late block. In this case forkchoice is
already locked and we add a call in `getFCUArgs` to return early if not
regularly syncing
3) During handling of late blocks on `lateBlockTasks` we simply return
early if not in regular sync (This is the biggest change as it takes
a longer FC lock for lateBlockTasks)
4) On Attestation processing, in UpdateHead, we are already locked so we
just add a check to not update head on this path if not regularly
syncing.
* fix build
* Fix mocks
* removing timeout on wait for activation, instead switched to an event driven approach
* fixing unit tests
* linting
* simplifying return
* adding sleep for the remaining slot to avoid cpu spikes
* removing ifstatement on log
* removing ifstatement on log
* improving switch statement
* removing the loop entirely
* fixing unit test
* fixing manu's reported issue with deletion of json file
* missed change around writefile at path
* gofmt
* fixing deepsource issue with reading file
* trying to clean file to avoid deepsource issue
* still getting error trying a different approach
* fixing stream loop
* fixing unit test
* Update validator/keymanager/local/keymanager.go
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* fixing linting
---------
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* do not check optimistic status if cached attestation
* Gazelle
* Gazelle again
* fix nil panics
* more nil checks
* more nil checks
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* Defragment head state
* change log level
* change it to be more efficient
* add flag
* add tests and clean up
* fix it
* gosimple
* Update container/multi-value-slice/multi_value_slice.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek's review
* unlock it
* remove from fc lock
---------
Co-authored-by: rkapka <rkapka@wp.pl>
* Break out several helpers from `postBlockProcess`
In addition fix a bug found by @terencechain where we should use a slot
context instead of the parent context in the second FCU call.
* Remove calls for tracked proposer
getPayloadAttribute already takes care of this
Also compute correctly the time into voting window
* call with attributes only when incoming block is canonical
* check for empty payload instead of only nil
* add unit tests
* move log for non-canonical block
* return early if the incoming block does not change head
* Pass fcuArgs as arguments
* lint
* Initial code for head event streaming
* handle events and error
* keepalive event
* tests
* generate new mock
* remove single case select
* cleanup
* explain eventByteLimit
* use 2 channels in test
* review
* more review
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Define `cli.App` without mutation.
No functional change.
* `usage.go`: Clean `appHelpTemplate`.
No functional change is added.
Modifications consist in adding prefix/suffix `-` to improve readability of
the template without adding new lines in template inference.
We now see some inconsistencies of the template:
- `if .App.Version` is around the `AUTHOR` section.
- `if .App.Copyright` is around both `COPYRIGHT` and `VERSION` sections.
- `if len .App.Authors` is around nothing.
* `usage.go`: Surround version and author correctly.
* `usage.go`: `AUTHOR` ==> `AUTHORS`
* `usage.go`: `GLOBAL` --> `global`.
* `--grpc-max-msg-size`: Remove double default.
* VC: Standardize help message.
- Flags help begin with a capital letter and end with a period.
- If a flag help begins with a verb, it is conjugated.
- Expermitemtal, danger etc... mentions are between parenthesis.
* VC help message: Wrap too long lines.
* Remove unsafe proposer indices cache
* Simplify FCU #1
This PR starts the process of gradually simplifying FCU
It removes the responsibility of getting the state and block from this
function and informing if head has changed. It is only called when the
imported block has actually become head.
* Add a call to FCU in edge cases
* init
- getLocalPayload does not use the proposer ID from the cache but takes
it from the block
- Fixed tests in blockchain package
- Fixed tests in the RPC package
- Fixed spectests
EpochProposers takes 256 bytes that can be avoided to be copied, but
this optimization is not clear to be worth it.
assginmentStatus can be optimized to use the cached version from the
TrackedValidatorsCache
We shouldn't cache the proposer duties when calling getDuties but when
we update the epoch boundary instead
* track validators on prepare proposers
* more rpc tests
* more rpc tests
* initialize grpc caches
* Add back fcu log
Also fix two existing bugs wrong parent hash on pre Capella and wrong
blockhashes on altair
* use beacon default fee recipient if there is none in the vc
* fix validator test
* radek's review
* push always proposer settings even if no flag is specified in the VC
* Only register with the builder if the VC flag is set
Great find by @terencechain
* add regression test
* Radek's review
* change signature of registration builder
* use different keys for the proposer indices cache
* Add a way to get the proposer indices from a checkpoint
* fix fuzzing tests
* use htr instead of body root
* move comment
* For golangci-lint, enable all by default
* Use latest golangci-lint here too
* Use v1.55.2 instead of latest
* Remove usestdlibvars from list
---------
Co-authored-by: terence <terence@prysmaticlabs.com>
* Use a cache of one entry to build attestation
* Gazelle
* Enforce on RPC side
* Rm unused var
* Potuz feedback, dont use pointer
* Fix tests
* Init fetcher
* Add in-progress
* Add back missing lock
* Potuz feedback
* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Enable mirror linter and fix findings
* Use latest version of golangci-lint
* Use v1.55.2 instead of latest
---------
Co-authored-by: terence <terence@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix all cases
* update web3signer
* current progress
* fix it finally
* push it back to capella
* remove hard-coded forks
* fix failing tests
* gaz
* fix dumb bug
* fix bad test setup
* change back
* Hook to slot stream instead of block stream on the VC
* Implement StreamSlots in the BN
* mock update
* fix tests
* don't return from stream
* Terence's review
* deepsource second complain
---------
Co-authored-by: rkapka <rkapka@wp.pl>
* fixing account import checking wallet twice, and adding sub folder search with a depth of 2
* removing uneeded check
* fixing unit test
* adding reset cache to fix potential flake
* improving test based on feedback
* Add sanity checks for bundle from builder
* Add more checks to BlobsBundle.ToProto()
* Fix minor typo
* Fix tests & add new ones
* Add tests for ToProto
* Add "not" to error message
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* removing fake wrappers
* fixing conficts and missed tests
* fixing more conflicts
* addressing missed unit test
* fixing nogo error
* fixing more unit tests
* fixing more tests
* `filterAndCacheActiveKeys`: Add test cases
- Validator is in unknown status (to be fitered out)
- Validator is in pending status,
with activation period > current period (to be filtered out)
- Validator is in pending status,
with activation period == current period (to be kept)
* `filterAndCacheActiveKeys`: Keep exiting keys
Initially:
-------
If a validator is in exiting (so, with status==EXITING != ACTIVE) state,
it will be filtered out by the `filterAndCacheActiveKeys` function.
The validator won't be registered to the beacon node.
If this exiting validator has to propose a block:
- the block will be proposed using local block building only.
- the fee recipient will be the one set in the beacon node.
(Additionally, if the beacon node Prysm without any
fee recipient defined at the beacon node level, the fee recipient
will default on the `0x00000...` burn address.)
This commit modifies the `filterAndCacheActiveKeys` function
by stopping filtering out exiting validators.
* Update staticcheck to latest
* Add static checks while ignoring for third party / external stuff
* Added a hack to keep go mod happy.
* disable SA2002
* Pin go mod tidy checker image to golang:1.20-alpine
* making needed changes to beacon API based on removal of blobsidecar from block contents
* fixing tests and reverting some changes to be addressed later
* fixing generated code from protos
* gaz
* fixing get blob handler and adding blob storage to the blob service
* updating unit tests
* WIP
* wip tests
* got tests passing but needs cleanup
* removing gomod and gosum changes
* fixing more tests
* fixing more tests
* fixing more tests
* gaz
* moving some proto types around
* removing unneeded unit test
* fixing proposer paths
* adding more tests
* fixing more tests
* improving more unit tests
* updating one blob only unit test
* changing arguments of buildBlobSidecar
* reverting a change based on feedback
* terence's review items
* fixing test based on new develop changes
* radek's comments
* addressed more comments from radek
* adding in blobs to test data
* fixing casing in test
* removing extra line
* fixing issue from bad merge
* Update beacon-chain/rpc/eth/beacon/handlers_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/rpc/eth/beacon/handlers_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/rpc/eth/beacon/handlers_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/rpc/eth/blob/handlers.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* moving core getblob business logic to blocker based on radek's comment
* fixing mock blocker
* gaz
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* scaffolding for verification package
* WIP blob verification methods
* lock wrapper for safer forkchoice sharing
* more solid cache and verification designs; adding tests
* more test coverage, adding missing cache files
* clearer func name
* remove forkchoice borrower (it's in another PR)
* revert temporary interface experiment
* lint
* nishant feedback
* add comments with spec text to all verifications
* some comments on public methods
* invert confusing verification name
* deep source
* remove cache from ProposerCache + gaz
* more consistently early return on error paths
* messed up the test with the wrong config value
* terence naming feedback
* tests on BeginsAt
* lint
* deep source...
* name errors after failure, not expectation
* deep sooource
* check len()==0 instead of nil so empty lists work
* update test for EIP-7044
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* refactoring to add a routes unit test for rest handlers
* gaz
* updating names for functions
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* add jwt-id flag
* optimize unit test for jwt-id
* Add jwt-id to help text
* gofmt
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* forkchoice.Getter wrapper with locking wrappers
* comments
* lint
* only expose fast fc getters
* potuz feedback re rlock
* update mocks for new fc method
* appease deepsource
* add missing exported func comment
* yeet errors to make the linter happy
* even more devious _discard
* rm TargetRoot
* derp
* handle nil error in _discard
* deep source
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* `TestStore_GenesisValidatorsRoot_ReadAndWrite`: Make all test cases independents.
In a test with multiple test cases, each test case should be independents.
(aka: Removing test case `A` should not impact test case `B`)
* `SaveGenesisValidatorsRoot`: Allow to overwrite the genesis validator root if the root is the same.
* `ProposalHistoryForSlot`: Add `signingRootExists`
Currently, it is not possible with `ProposalHistoryForSlot` to know if a
proposal is stored with and `0x00000....` signing root or with an empty
signing root. Both cases result to `proposalExists == true` and
`signingRoot == 0x00000`.
This commit adds a new return boolean: `signingRootExists`.
If a proposal has been saved with a `0x00000...` signing root, then:
- `proposalExists` is set to `true`, and
- `signingRootExists` is set to `true`, and
- `signingRoot` is set to `0x00000...`
If a proposal has been saved with an empty signing root, then:
- `proposalExists` is set to `true`, and
- `signingRootExists` is set to `false`, and
- (`signingRoot` is set to `0x00000...`)
* `ImportStandardProtectionJSON`: When importing EIP-3076 Slashing Protection Interchange Format, do not filter any more slashable keys.
Note: Those keys are still saved into the black-listed public keys list.
There is two reason not to do so:
- The EIP-3076 test cases do not know about Prysm's internal black-listed public keys list.
Tests will expect, without looking into this internal black-listed public keys list,
to deny a further signature. If we filter these keys from the DB (even if we keep them
into the black-listed keys list), then some tests will fail.
- If we import a interchange file containing slashable keys and we filter them, then,
if we re-export the DB, those slashing offences won't appear in the exported interchange
file.
* `transformSignedBlocks`: Store an 0-len byte slice
When importing an EIP-3076 interchange format, and when no
signing root is specified into the file, we currently store a
`0x00000.....` signing root.
In such a case, instead storing `0x00000...`, this commit stores
a 0-len byte array, so we can differentiate real `0x000.....` signing
root and no signing-root at all.
* `slashableProposalCheck`: Manage lack of sign root
Currently, `slashableProposalCheck` does not really make a difference
between a `0x0000.....` signing root and a missing signing root.
(Signing roots can be missing when importing an EIP-3076 interchange
file.)
This commit differentiate, for `slashableProposalCheck`, `0x0000....`
signing root and a missing signing root.
* `AttestationRecord.SigningRoot`: ==> `[]byte`
When importing attestations from EIP-3076 interchange format,
the signing root of an attestation may be missing.
Currently, Prysm consider any missing attestation signing root as
`0x000...`.
However, it may conflict with signing root which really are equal to
`0x000...`.
This commit transforms `AttestationRecord.SigningRoot` from `[32]byte` to
`[]byte`, and change the minimal set of functions (sic) to support this
new type.
* `CheckSlashableAttestation`: Empty signing root
Regarding slashing roots, 2 attestations are slashable, if:
- both signing roots are defined and differs, or
- one attestation exists, but without a signing root
* `filterSlashablePubKeysFromAttestations`: Err sort
Rergarding `CheckSlashableAttestation`, we consider that:
- If slashable == NotSlashable and err != nil, then CheckSlashableAttestation
failed.
- If slashable != NotSlashable, then err contains the reason why the attestation
is slashable.
* `setupEIP3076SpecTests`: Update to `v5.3.0`
This commit:
- Updates the version of EIP-3076 tests to `v.5.2.1`.
- Setups on anti-slashing DB per test case, instead per step.
* `ImportStandardProtectionJSON`: Reduce cycl cmplxt
* `AttestationHistoryForPubKey`: copy signing root
BoltDB documentation specifies:
| Byte slices returned from Bolt are only valid during a transaction.
| Once the transaction has been committed or rolled back then the memory
| they point to can be reused by a new page or can be unmapped
| from virtual memory and you'll see an unexpected fault address panic
| when accessing it.
* fixing squashing changes, migrates beacon , account, and auth endpoints on validator client
* adding accounts endpoints
* fixing tests and query endpoints
* adding auth endpoint and fixing unit tests
* removing unused files and updating node file to skip gRPC
* ineffectual assignment fix
* rolling back a change to fix e2e
* fixing issues with ui
* updating with webui version 2.0.5
* updating package name flag in readme
* removing restore assets functions
* adding nomemcopy flag to see if vulenerability scan passes
* making data non compressed to avoid copy vulnerability
* Update beacon-chain/rpc/eth/shared/structs_validator.go
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* updating site_data, and skipping static analysis on file
* adding back deprecation comment notice
* updating workflows to ignore generated
* addressing radek comments
* missed a conversion
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Add test helpers to produce commitments and proofs
* go mod tidy
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add deletion
* Gaz
* Return on removal
* Test cleanup
* Simply blob deletion
* Add test case to prove that deleting a root that doesn't exist will not return an error
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Run Beacon API evaluator at slot 3
* Revert "Auxiliary commit to revert individual files from f80b444688ed1acb267ee8bf00ba602d1f890cc7"
This reverts commit 0d3d7a4113533ac0516efe12d09cc3b9d78793f1.
* Add construct_generic_block_test test to build file
* Use the right require library
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* converting wallet calls to pure http
* fixing proto and gaz
* adding routes and fixing test
* fixing error handling
* fixing protos after conflict with develop
* adding deprecation notice
* fixing route test
* review feedback
* addressing more comments
* updating comment to be more clear
* fixing web_api proto
* Update default value of `max-builder-epoch-missed-slots`
* remove the default value
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add Save blob and tests
* Remove locks
* Remove test cleanup
* Fix go mod
* Cleanup
* Add checksum
* Add file hashing to fileutil
* Move test
* Check data when exists
* Add one more test
* Rename
* Gaz
* Add packaged level comment
* Save full sidecar + reviews
* Use path builder in test
* Use other BlobSidecar
* Cleanup
* Fix gosec
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* WIP
* fixing tests
* fixing bazel
* fixing api client
* fixing tests
* fixing more tests and bazel
* fixing trace and more bazel issues
* fixing router path function definitions
* fixing more tests and deep source issues
* adding delete test
* if a route is provided, reregister before the catch all on the middleware.
* fixing linting
* fixing deepsource complaint
* gaz
* more deepsource issues
* fixing missed err check
* changing how routes are registered
* radek reviews
* Update validator/rpc/handlers_keymanager.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* Update validator/rpc/handlers_keymanager.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* fixing unit test after sammy's review
* adding radek's comments
---------
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* Fix block proposals in the REST validator client
* fix graffiti test
* return empty graffiti
* fallback to old endpoints
* logs
* handle 404
* everything passes
* review from James
* log undecoded value
* test fixes and additions
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This cancel function is currently a no-op due to the blank identifier.
One might argue that the cancel func should be restored from no-op by
replacing the blank identifier with the proper variable. When the parent
context is cancelled, however, all the functions down the call tree with
the context will be notified of the cancellation anyway. Removing the
cancel function would not change any outcome under the current
implementation.
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* wip removing call to execution client for transition configuration
* updating bazel and execution engine proto
* removing more spots where the call was added
* removing unused metric
* Better Beacon API evaluator part 1
* rename package
* more endpoints
* rename package back
* more endpoints
* small improvements
* remove the need for `params`
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Add zero length check on indices during NextSyncCommitteeIndices computation. Fixes#13051
* Move the error further up the stack
* Fix TestSubmitAggregateAndProof_IsAggregatorAndNoAtts
* Delete TestServer_ListAssignments_NoResults. That is an impossible scenario that now returns an error
* Fix exported names that start with a package name
* A few more renames
* Fix exported names that start with a package name
* A few more renames
* Radek's feedback
* Fix conflict
* fix keymanager test
* Fix comments
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add pending blobs queue for missing parent block
* Prune sidecars older than previous slot
* Prune sidecar based on time
* Tests
* Fix state notifier
* Wait for chain to start
* Remove logs
* Remove bad logs
* James feedback
* Fix conflict
* Rm outdated check
* Potuz's feedback
* Kasey's feedback
* Use 11s mark
* Use secs
* Add pending blobs queue for missing parent block
* Prune sidecars older than previous slot
* Prune sidecar based on time
* Tests
* Fix state notifier
* Wait for chain to start
* Remove logs
* Remove bad logs
* James feedback
* Fix conflict
* Rm outdated check
* Potuz's feedback
* Kasey's feedback
* Use 11s mark
* Use secs
* Add test case for duplicates
* Radek's feedback
* Fix test
* wip
* adding deneb block
* adding in support for blobs and fixing unit tests for deneb
* fixing linting
* gaz
* adding support for new web3signer version
* fixing tag name
* addressing feedback
* fixing tests
* adding unit test for review
* updating test name
* updating unit tests and length logic
* adding in lengthfor root
* adjusting max blob length
* fixing mock
* fixing another mock
* gaz
* adding network configs
* removing duplicate
* changing based on nishant's feedback
* Update validator/keymanager/remote-web3signer/v1/requests.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* Update validator/keymanager/remote-web3signer/metrics.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* sammy's suggestions
* removing temp file
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* beacon-chain:rpc/eth/shared: prevent mutiple error messages
This commit prevents the error writing function from writing multiple
JSON objects. An error message with more than one JSON object will not
unmarshal into the default error response.
* beacon-chain/rpc/eth/beacon: add a test case for missing state
This commit adds a test on beacon states finality checkpoints endpoint
to cover a case when state is not found.
* beacon-chain/rpc/eth: update error response to meet the spec
This commit updates error message on beacon states finality
checkpoints endpoint to ensure that the response complies to
Ethereum Beacon-API specification.
* beacon-chain/rpc/eth/shared: add build dependency
* beacon-chain/rpc/eth/shared: update test on state not found
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Add more blob and block checks for by range
* Update beacon-chain/sync/initial-sync/blocks_fetcher.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/sync/initial-sync/blocks_fetcher.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update beacon-chain/sync/initial-sync/blocks_fetcher_test.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* adding in block rewards to represent consensus payload
* Update beacon-chain/rpc/eth/validator/handlers_block.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* radek's comments
* more review changes
* adding more tests for forks
* gaz
* updating names
* gaz
* fixing imports
* fixing variable name
* gaz
* fixing test
* renaming variables to match data
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* beacon-chain/execution: no need to reread and unmarshal the eth1Data multitimes
Signed-off-by: jsvisa <delweng@gmail.com>
* beacon-chain/execution: rename to validPowchainData
Signed-off-by: jsvisa <delweng@gmail.com>
* beacon-chain/execution: no return eth1Data if error
Signed-off-by: jsvisa <delweng@gmail.com>
* beacon-chain/execution: return eth1data even if genstate is nil
Signed-off-by: jsvisa <delweng@gmail.com>
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* in progress...
* in progress...
* remove log
* log root
* Revert "Auxiliary commit to revert individual files from f12a609ea2a2f1e87e97321f3a717cd324b5ae97"
This reverts commit 5ae35edb6477d8d0ea4e94b273efc6590484da85.
* cleanup
* remove log
* remove whitespace
* remove logs
* more stuff
* copy
* always rebuild trie
* revert
* add state
* init state
* fix all
* uintptr
* move slice to new package
* lock in `Detach`
* remove constraint
* reorder
* blockroots and stateroots
* fill roots in empty()
* fix hasher
* implement slice for balances and inactivity scores
* detach in setters
* Revert "implement slice for balances and inactivity scores"
This reverts commit 59eb9df8d7.
# Conflicts:
# beacon-chain/state/state-native/setters_validator.go
* use counter to track states
* typos
* rename interface
* balances
* gauge
* some improvements
* first try with map
* fix
* inactivity scores in progress
* fix test
# Conflicts:
# beacon-chain/state/state-native/helpers_test.go
* test fixes
* ToProto fix
* copy roots
* validators
* build fixes
* fix bug in `ToProto`
* fix fuzz test
* fix bug in slice getters
* fix state equality checks
* make tests pass
* make tests pass
* more test updates
* Revert "Auxiliary commit to revert individual files from 34e7344bff08a589e6341bb1829e3cb74159e878"
This reverts commit ecd64efa8917f37ca41460e0356ff007fe55dd9d.
* Revert "make tests pass"
This reverts commit 0cf00f19ee.
* Revert "make tests pass"
This reverts commit 521b65e1d2.
* pass tests
* deepequal identifiable types
* Deflake `cloners_test.go`
* feature flag for block roots
* feature flag
* remove recursive locks
* reduce complexity of rootSelector
* fix randao mixes root
* some fixes
* revisit tests
* revert change to field trie helpers
* initialize field map for tests
* remove whitespace
* initialize roots with proper length
* more fixes
* out of bounds message fix
* optimize length calculation
* remove call to Len in PubkeyAtIndex
* don't log deposits
* unit tests
* unit tests
* fix
* comments
* test fixes
* id
* remove Enumerator interface
* review feedback
* simplify field trie
* bring back fieldtrie package
* fix bazel file
* use handle32ByteArrays for root computation
* fix locks
* metrics
* bzl
* simplify some things
* use htr in state test
* remove code from require package
* gzl
* more htr
* Fuzzing of the multi-value slice
* assert values
* getter optimizations
* use At when reading from validators
* Nishant's review
* restore safe copy
* remove empty line
* build fix
* restore how we get root at index for deafult mode
* more review comments
* optimize default behavior
* simplify Slice calls
* test fix
* remove unnecessary package
* remove unused setter
* make fieldMap unexported
* some improvements in state package
* call `Slice` instead of manually copying
* unlock in ReadFromEveryValidator
* Potuz's comments
* lock the state when reading from all validators
# Conflicts:
# beacon-chain/state/state-native/getters_validator.go
* add back preston's changes
* add index
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Add bazel-zig-cc for a hermetic cc toolchain
* gazelle
* Remove llvm
* remove wl
* Add new URLs for renamed repo
* gazelle
* Update to v2.0.0-rc1
* bump to rc2
* Proof of concept multi-arch containers for beacon-chain
* TODO and gaz
* Refactor to starlark macro. Use a version of bash that actually works
* progress
* gaz
* multirun to use multiple repositories, but doesn't work with tag stamping
* Revert "multirun to use multiple repositories, but doesn't work with tag stamping"
This reverts commit 93afa76f65.
* Add targets for all supported docker images and temporarily set the repository to prysm-dev for testing
* use a temporary fix to see if it works on buildkite
* Revert "use a temporary fix to see if it works on buildkite"
This reverts commit ddc79283ca.
* testing a cURL fix
* try fix with my fix
* Revert "try fix with my fix"
This reverts commit bb7521bf47.
* Revert "testing a cURL fix"
This reverts commit 8a4782110f.
* try tip of main branch for rules_oci
* update to 1.2.0
* Update rules_oci to v1.3.0
* Update rule_oci to 1.3.4
* Disable experimental_remote_downloader
* Remove extra zig bazelrc
* Move image deps to its own file
* PR feedback
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add a flag to configure blob retention epoch period
* Add test
* Kasey's feedback
* More Kasey's feedback
* Fix lint and tests
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add warning with a small genesis state
* 1<<10 is 1Kb
* Add genesis state loading with hash information
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* GetFinalityCheckpoints and GetGenesis
* bzl
* remove unused func
* use const as base path
* bring back headers
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* remove unused function
* remove the actual method
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* keep track of block being synced
* gazelle
* use maps
* shutup deepsource
* change godoc
* Radek's review
* Do not process block twice if it's already being processed
* add unit test
* fork state endpoint
* removing generated files
* fixing linting
* fixing tests using old type
* moving the response object to a new file under shared
* fixing test
* gaz
* fixing generated code
* gaz
* fixing linting
* rolling back some changes
* reverting generated changes
* fixing spacing
* linting
* updating protos after develop merged
* addressing radek's comments
* addressing more radek comments
* function to merge and validate saved/new blobs
* Make it an error to call save with an empty slice
* rename func to match type, undo var rename
* satisfy deepsource; cheap len check before compare
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* reject blocks with more commitments than spec
* add details of excess commitments to error
* good catch, linter
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* add DA check to batched sync path
also fixes a da period calculation bug in the reg sync path.
* update comment
function original took a slot instead of an epoch, but was rewritten to use epoch to avoid the need to import the slot math package
Co-authored-by: terencechain <terence@prysmaticlabs.com>
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* db: fix save blob sidecar using wrong prefix
* tests: add more
* tests: check blobs no longer there
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* fix(sync/rpc): use blobs by root when requesting block
Fix: use blobs by root for pending block queue (option B)
* fix: skip htr if block is older than deneb
* binary search is the wrong tool for the job, derp
* restore protection from array index panics
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* beacon-chain/execution: use pointer instead of value to reduce value copy
Signed-off-by: jsvisa <delweng@gmail.com>
* beacon-chain/execution: fix unit test
Signed-off-by: jsvisa <delweng@gmail.com>
---------
Signed-off-by: jsvisa <delweng@gmail.com>
* add in github workflow for fuzzing that runs with cron
* every day
* go version
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Remove prysm_web_ui http_archive from WORKSPACE
* Remove go_embed_data_dependencies() from WORKSPACE
* Remove go_embed_data target from validator/web/BUILD.bazel
* Remove # gazelle:ignore site_data.go annotation from validator/web/BUILD.bazel
* Run bazel run //:gazelle
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Use last optimistic status on batches
* more descriptive errors
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Update rules_go to v0.40.0
* Update gazelle to v0.26.0
* Update gazelle to v0.27.0
* Update gazelle to v0.28.0
* Update gazelle to v0.29.0
* Update gazelle to v0.30.0
* Update gazelle to v0.31.0
* update NSC together with epoch boundary caches
* block when updating caches
* reviews
* removal of very useful helper because the reviewers requested it :)
* use IsEpochEnd
* HTTP Beacon API: `/eth/v1/validator/contribution_and_proofs`
* add comment to invalid test case
* fix validation and test
* review
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* adding fix for nethermind's findings on gaslimit =0 on some default setups
* adding in default gaslimit check
* fixing linting on complexity
* fixing cognitive complexity linting marker
* fixing unit test and bug with referencing
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Paralellize hashing of large lists
* add unit test
* add file
* do not parallelize on low processor count
* revert minimal proc count
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Return historical roots in Capella state
* test fix
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
We randomly observe this failure when running unit test
go test -test.v -run=^TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages
=== RUN TestSignatureBatch_AggregateBatch
=== RUN TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages
signature_batch_test.go:643: AggregateBatch() Descriptions got = [test signature bls aggregated signature test signature bls aggregated signature test signature bls aggregated signature], want [bls aggregated signature test signature bls aggregated signature test signature bls aggregated signature test signature]
--- FAIL: TestSignatureBatch_AggregateBatch (0.02s)
--- FAIL: TestSignatureBatch_AggregateBatch/common_and_uncommon_messages_in_batch_with_multiple_messages (0.02s)
The problem is that the signature sort forgets to swap the description when a
swap occurs. This commit adds the description swap when swap occurs.
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* WIP
* WIP
* adding in migration function
* updating mock validator and gaz
* adding descriptive logs
* fixing mocking
* fixing tests
* fixing mock
* adding changes to handle enable builder settings
* fixing tests and edge case
* reduce cognative complexity of function
* further reducing cognative complexity on function
* WIP
* fixing unit test on migration
* adding more tests
* gaz and fix unit test
* fixing deepsource issues
* fixing more deesource issues missed previously
* removing unused reciever name
* WIP fix to migration logic
* fixing loging info
* reverting migration logic, converting logic to address issues discussed on slack, adding unit tests
* adding test for builder setting only not saved to db
* addressing comment
* fixing flag
* removing accidently missed deprecated flags
* rolling back mock on pr
* fixing fmt linting
* updating comments based on feedback
* Update config/features/flags.go
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
* fixing based on feedback on PR
* Update config/validator/service/proposer_settings.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update validator/client/runner.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update validator/db/kv/proposer_settings.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* adding additional logs to clear up some steps based on feedback
* fixing log
* deepsource
* adding comments based on review feedback
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Update protobuf and protobuf deps
* gazelle
* enforce c++14
* bump to c++17 since practically all modern compilers support it
* update protobuf again to resolve mac issues, bump c++20
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Cache next epoch proposers at epoch boundary
* Fix new lines
* Use UpdateProposerIndicesInCache
* dont set state slot
* Update beacon_committee.go
* dont set state slot
* genesis epoch check
* Rm check
* fix: rm logging ctx
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* feat: move update to background
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Add bazel-zig-cc for a hermetic cc toolchain
* gazelle
* Remove llvm
* remove wl
* Add new URLs for renamed repo
* gazelle
* Update to v2.0.0-rc1
* bump to rc2
* Some PR feedback
* use v2.0.0 from rc2
* Disable hermetic builds for mac and windows.
* bump bazel version, add darwin hack
* fix
* Add the no-op emtpy cc toolchain code
* typo and additional copy
* update protobuf and fix vaticle warning
* Revert "update protobuf and fix vaticle warning"
This reverts commit 7bb4b6b564.
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* handler
* very much work in progress
* remove Polish
* thinking
* working but differs from LH
* remove old stuff
* review from Potuz
* validator performance beacon server
* Revert "validator performance beacon server"
This reverts commit 42464cc6d3.
* reuse precompute calculations
* todos
* production quality
* add json tags to AttestationRewards
* Potuz's review
* extract vars
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* adding optmization
* addressing comments
* adding a test and fixing change in assignments.go
* making some changes based on review of the code
* removing irrelevant test
* changing formatting
* wip have update duties handle all validators updated
* removing function and adding tests
* removing unnessesary test
* fixing unit test
* gaz
* removing number on wait group
* trying lower threshold to reduce timeout
* testing removal of test to resolve timeout on buildkite
* gaz
* removing test that is breaking buildkite on timeouts, will need to return to revaluate difference between buildkite and local mock
* addressing feedback
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Use next slot cache for sync committee
* RWMutex
* change mutex for last cached state
* feat: change mutex
* test: add db
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* add new thing
* only have it for late blocks
* comments
* change to lock
* add test
* Update beacon-chain/state/state-native/state_test.go
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* adding small ux improvement
* gaz
* rolling back dir test changes
* Update validator/accounts/accounts_import.go
* adding review suggestion
* missed else part of statement
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Add epoch number and root in not a checkpt in forkchoice log
* Update beacon-chain/blockchain/process_attestation_helpers.go
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Fix test
* Fix typo
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* update github actions
* use quotes or it is go 1.2
lol
* Update gosec
* Update gosec
* Update go lint
* fix gosec violations
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Minor typos and spelling fixes (comments, logs, & docs only, no code changes)
* Fix seplling in log message
* Additional spelling tweaks based on review from @prestonvanloon
* Pre-populate bls pubkey cache as part of state gen's Resume function. This adds some helpers and a benchmark to blst
* Do it async
* fix missing import
* lint
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: rauljordan <raul@prysmaticlabs.com>
* block all the sync startup code on init signal
* don't need chainStarted if everything blocks
* set empty clock by default to work around panics
* remove unused clock, zero-value for init-sync
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* refactor initialization to blocking startup method
* require genesisSetter in blockchain, fix tests
* work-around gazelle weirdness
* fix dep gazelle ignores
* only call SetGenesis once
* fix typo
* validator test setup and fix to return right error
* move waitForChainStart to Start
* wire up sync Service.genesisWaiter
* fix p2p genesisWaiter plumbing
* remove extra clock type, integrate into genesis
and rename
* use time.Now when no Nower is specified
* remove unused ClockSetter
* simplify rpc context checking
* fix typo
* use clock everywhere in sync; [32]byte val root
* don't use DeepEqual to compare [32]byte and []byte
* don't use clock in init sync, not wired up yet
* use clock waiter in blockchain as well
* use cancelable contexts in tests with goroutines
* missed a reference to WithClockSetter
* Update beacon-chain/startup/genesis.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/blockchain/service_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* more clear docs
* doc for NewClock
* move clock typedef to more logical file name
* adding documentation
* gaz
* fixes for capella
* reducing test raciness
* fix races in committee cache tests
* lint
* add tests on Duration slot math helper
* startup package test coverage
* fix bad merge
* set non-zero genesis time in tests that call Start
* happy deepsource, happy me-epsource
* replace Synced event with channel
* remove unused error
* remove accidental wip commit
* gaz!
* remove unused event constants
* remove sync statefeed subscription to fix deadlock
* remove state notifier
* fix build
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
* Proposer builds block in parallel. Cosensus vs Execution
* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Use feature flag
---------
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* adding filter for validator registration
* adding new filter logic based on validator status
* make sure to check status each time
* WIP unit testing
* fixing unit tests
* adding ux improvement
* addressing nishant's comments
* cleanup for already slice error
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* add callback for deterministic key fetch ordering
* provide a nicer way to control key ordering
* more concise test setup = less confusion
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Enable nilerr linter & fix findings
* Deal with other findings
* Fix another finding that I missed somehow
* Fix another another issue
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update tests to expect error
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* prysmctl: Add support for writing signed validator exits to disk
* Add dir suffix
* Add test to ensure no broadcast call was made
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* WIP changes for keymanager
* WIP fix
* WIP needs unit tests
* fixing order
* adding unit test
* fixing linter
* updating unit tests and creating more reusable functions
* making accountStore copy method part of struct
* Update validator/keymanager/local/delete_test.go
* Update validator/keymanager/local/delete.go
* Update validator/keymanager/local/delete.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/import.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/delete.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/delete.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/import.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/import.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update validator/keymanager/local/delete.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* addressing suggestion of not reinitializing from reading the file but instead update the information based on memory on hand
* Update validator/accounts/wallet_create.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* adding changes based on suggestions
* making logs more consistent
* fixing linting
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* fix slashing checks
* fix to make it more performant
* gaz
* fix up
* potuz's comment
* potuz's comment
* fix cache
* change index in test for better case
* gaz
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* Correctly use Gwei to compare builder bid value
* Minimal 1gwei for TestProduceBlindedBlock
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* prysmctl using the same genesis func as e2e
* add whitespace to genesis.json for readability
* fix typo in fork name
* don't require validator count if deposits given
* add gosec exception
* the other nosec :(
* appease deepsource
* fix comments on renamed public value/func
---------
Co-authored-by: kasey <kasey@users.noreply.github.com>
* Add prepare-all-payloads flag
* add unit tests
* do not use the nsc
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* adding fix for buildervalue nil
* fixing linting
* changing based on review comment
* editing based on suggestions
* fixing unit test
* fixing linting
* fall back to local
* fix linting
* updating based on slack feedback
* refactor next slot cache
* fix test
* rename function
* fix spectests
* remove TODO comments
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Add builder bid fraction to compare with local block value and use builder bid if (bid * fraction) > local block value
* Prioritize local block construction over relay/builder block construction using a boost value for local block construction
* Refactor builder and local block value calculation to use percentage comparison
* Add a test for local with boost
* Use uint64
* Fix log
* With attribute, use justified hash as safe block hash
* Use UnrealizedJustifiedPayloadBlockHash
* Cleanups
* Add test to forkchoice
* Block proposal
* Fix mock
* Fix test
* Fix rest of the tests
* Potuz feedback
* Fix test
* Use unrealized justified hash for regular fcu
* initial impl
* review feedback
* fix tests
* review feedback
* some improvements
* tests and small improvements
* gzl
* one more review
* fix test
* fix other test
* get the roots instead of hashing them
* fix comment
* fix justified case
* fix all tests
* misc
* gzl
* fix broken tests
* use isOptimisticForRoot once we have the blockroot
* Fix is_not_finalized_when_head_is_optimistic but reviewing the logic first
* Fix is_not_finalized_when_head_is_optimistic
* better root tests
* move optimistic check before parsing root
* check for last validated checkpoint
* add right check for finalized
* fix finalized tests
* removed impossible condition
* fix TestGetSyncCommitteeDuties
* Use Ancestor from chaininfo
* fix test
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: rauljordan <raul@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* fixing typo on casing
* WIP get missed slot
* missed in commit
* reverting changes onfeedback
* reverting bazel
* using the current or head slots for events
* fixing linting
* use emitSlot
* fixing time and preRando change
* updating based on feedback
* fixing linting
* clarifying variable
* removing useless if statement
* fixing function to use the current slot+1
* updating based on feedback
* fixing unit tests
* missed dependency injection
* fixing linting
* forkchoice changes
* gazelle
* remove best justified from forkchoice dump
* keep protobufs and update comment
* remove phase0 tests
* bumb spectests version
* missing sha
* Fix sha256 for spec
* rpc tests
* Mark field 3 as reserved so it will never be used it again
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* removing duplicate function
* moved markInclusion for bls to use headblock instead of processed block
* updating based on internal feedback
* addressing some comments
* addressing feedback from slack
* fixing conflict
* making changes based on suggestions on slack
* reverting a change
* making chases based on potuz's comments
* removing one additional block copy
* clarifying comments
* trying fix for validator startup deadline
* updating deadline duration to be set by params
* adding a runner test
* trying nishant's suggestion
* editing based on review feedback
* reverting a change
* fixing epoch deadline
* reverting aliasing
* Update references for cc toolchain after removal of @bazel_tools//cpp/cc_toolchain_config.bzl in 1727361563
* Update to bazel 6.1.0
* Update cross-toolchain configs
* Update rules_go to v0.38.1
* Bump go version
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Only build non-test targets in hack/update-go-pbs.sh
* run ./hack/update-go-pbs.sh
* Add ability to pass config to bazel
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Minor cleanups from eip4844 branch
* Add back handler
* Fix gazelle
* More fixes
* More fixes
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* go.mod: set a non-zero version for tx-fuzz
* go.mod: use upstream tx-fuzz instead of fork
* run gazelle
* fix tests
---------
Co-authored-by: nisdas <nishdas93@gmail.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* removing all prysm remote signer code
* fixing unit tests
* resolving more build issues
* resolving deepsource complaint
* fixing lint
* trying to fix bazel library
* trying testonly true
* removing assert and require from non test settings
* fixing bazel and tests
* removing more unused files related to remote signer
* fixing linting
* reverting some changes
* reverting a change that broke some code
* removing typo
* fixing unit test
* fixing mnemonic information
* Regenerate cross-toolchain configs
* Remove some extra whitespaces
* Run gazelle and add that note to the README
* Format numbered lists better in markdown
* gcloud docker command is deprecated, just use docker
* Add comment about docker credentials for gcr.io
* Update dockerfile, some remote executor config work
* gazelle
* Remove commented lines
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* disable conditional go 1.20 code until we upgrade
* bazel decided this was unreachable and removed it!
---------
Co-authored-by: kasey <kasey@users.noreply.github.com>
These two log messages were appending a `d` to the hash. When compared to the other hash, they matched up until the `d`
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* fix flakes
* make it longer
* make it less to prevent triggering of other issues
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* 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>
* Raise the max grpc message size to a very large value by default
* unused import
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* write locks
* fix forkchoice tests
* blockchain locks
* lock on IsOptimistic
* use forkchoice instead of chaininfo within savehead
* Use forkchoice HasNode to check if a block is consistent with finality
* interface fix
* Use forkchoice HasNode to check if a block is consistent with finality
* interface fix
* fix tests
* remove VerifyFinalizedBlkDescendant
* don't write lock wrappers
* fix validateBeaconBlock
* Terence's review and more missing locks
* add lock for InForkChoice
* lock head on fillMissingBlockPayload
* fix lock on IsOptimisticForRoot
* fix lock in fillMissingBlockPayloadId
* extra comments
* lock proposerBoost on spectests
* nishant's review
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Use forkchoice HasNode to check if a block is consistent with finality
* interface fix
* fix tests
* remove VerifyFinalizedBlkDescendant
* fix validateBeaconBlock
* adding in a check for current fork to disable submission prior
* fixing linting
* fixing error return
* updating error contains in test
* fixing unit test
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* wip adding deprecation to web api endpoints
* wip adding more deprecation notices
* adding in a few more deprecation markers
* updating order of comments
* Add `Eth-Consensus-Version` header to `SubmitBlindedBlock`
* bring back function
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Update head before block proposal
* Fix first bellatrix block when using mev-boost
---------
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Implement should_override_forchoice_update
* add tests
* remove unused exported function
* go mod tidy
* fix go mod
* Fix go mod tidy
* Fix context import
* mod tidy
* fix test
* Terence's review
* fix test
---------
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* Proposer use highest value payload vs header
* Default to interface for changes
* Clean up
* Clean up
* Clean up
* Capella condition
* Proposer compare withdrawal roots
* Add unit test
* Fix test
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Update head before block proposal
* Move before opt sync
* Fix test
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Aditya's PR 18
This PR implements PR18. There is still a missing piece which is
consistency of head with finalized checkpoint. I will think on ways to
enforce this.
* prune finalized incompatible
* don't check finalization on viable for head
* unit tests fixes
* gazelle
* remove finalized epoch from viableForHead
* remove finalized epoch from leadsToViableHead
* use non-slashed indices
* function rename
* lint fixes
* lint fixes
* lint fixes
* add balance cache tests to testsuite
* reuse code from stategen in the justified balance cache
* remove state getters from the balance cache
* fix unit tests
* rebase on 11962
* unused error
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* delete from s.nodeByPayload as well when pruneFinalizedNodeByRootMap
* regresstion test
* add different payload node
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Use copied head state
* Move metrics to the end
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Cycle the BLS changes pool when falling below a threshold
* move cycle logic within pool
* set threshold at 2000
* fix conflict
* more fixes
---------
Co-authored-by: kasey <489222+kasey@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Use correct attribute if there's a payload ID cache miss
* Test
* Default case unknown state version
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* adjusting submit bls to not early exit function in partial success
* Update cmd/prysmctl/validator/withdraw.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Return error when using unsupported mnemonic language
* Fix failing tests
* More test fixes
* Add MnemonicLanguage to CreateWalletRequest
* Add MnemonicLanguage to remaining tests
* Add language to error
* Add missing (.)
* Set default language + fix renumbered fields
* Replace hardcoded language with default var
* default set
* gaz
* fix proto field setting
* fix up
* Remove WithMnemonicLanguage from tests
* Remove WithMnemonicLanguage from tests
* Fix conflicting information failure
* Gazelle + remove hardcoded english values
* fix
* Fix tests
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* fixing bug and adding unit test
* reverting small change
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Do not check headstate being Capella for BLS changes on gossip
* fix test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Do not log an overflow computing Capella's slot start
* nishant's review
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Sign BLS_TO_EXECUTION_CHANGES with GENESIS_FORK_VERSION
* update spectests
* extra blank line
* fix consensus_specs_sha
* get rid of LightClients tests
* fix unit tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* remove ShardingForkVersion/Epoch from config
* update magic value counting config params
* skip the sharding params, which we disavow
we wanted to remove these upstream and may well do some day but right
now it's too big of a mess to untangle.
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* capella state version detection bug fix
* add capella to yaml "template"
* changes for capella state detection
* lint
* don't set capella fork version == altair!!!
* less brittle test for fork schedule rpc
* fix assertions that use wrong field name
* don't test capella/sharding fv against upstream
* hat tip Terence for sanity check
* Update config/params/loader_test.go
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Refactor bytes.go and bytes_test.go to smaller files, introduce go1.17 and go1.20 style of array copy
* rename bytes_go17.go to reflect that it works on any version 1.19 and below
* fix PadTo when len is exactly the size
* Add go1.20 style conversions
* Forgot another int method
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Better version checks for future proof
* Revert changes for blob
* Use if else
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* attempt to fix WaitForTextInFile log corruption
* restore Seek, just in case!
* lint
* handle file close error in all cases with a log
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
In the event we receive a BLS_TO_EXECUTION_CHANGE and our head state is
before Capella, verify it's signature with the Capella fork version.
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* e2e using dynamic configs; runtime bellatrix setup
* starts from phase0 but fee recipient eval fails
* lower TTD to cross before bellatrix epoch in e2e
* fix debug printf
* fix it
* dynamic ttd and more robust fee_recipient eval
* let multiplication set ttd=0 if bellatrix epoch=0
* refactoring fee recipient test after cognit errors
* lint
* appease deepsource
* deep sourcin
* gazelle
* missed a usage of this when refactoring
* refactoring premine genesis to work for all forks
previous set of functions was a copypasta mess
* gaz post-merge
* gaz
* resolve merge artifact and pr feedback
* back out some unneeded changes
* appease deepsource
* move premine-state next to similar utils
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
* e2e using dynamic configs; runtime bellatrix setup
* starts from phase0 but fee recipient eval fails
* lower TTD to cross before bellatrix epoch in e2e
* fix debug printf
* fix it
* dynamic ttd and more robust fee_recipient eval
* let multiplication set ttd=0 if bellatrix epoch=0
* refactoring fee recipient test after cognit errors
* lint
* appease deepsource
* deep sourcin
* gazelle
* missed a usage of this when refactoring
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
* Identify invalid signature within batch verification (#11582)
* Fix issues found by linter
* Make deepsource happy
* Add signature description enums
* Make descriptions a mandatory field
* More readable error message of invalid signatures
* Add 'enable-verbose-sig-verification' option
* Fix format
* Move descriptions to package signing
* Add more validation and test cases
* Fix build failure
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Improve tests for `ProduceBlockV2`
* Revert "Auxiliary commit to revert individual files from 31c606198bdc91bac798b7a446d04d5cce86dad7"
This reverts commit d8b264457168f8f5e03d0473288a56606e38ab39.
The comments of the template were not inside the braces and appeared when creating a new Issue.
Thanks
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Add additional span information when saving attestation records
* Remove keymanager.sign span. It's very noisy and not a helpful data point.
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* WIP trying to start from bellatrix state
* env var to control log path with unique paths
due to flaky test re-run behavior, logs from a failed test run are
overwritten by subsequent retries. This makes it difficult to retrieve
logs after the first failed run. It also takes some squinting through
output to find the location of the log file in the first place. This
flag enables logs to be placed in an arbitrary path. Note that bazel
sandboxing generally will force this path to be in the /tmp tree.
* WIP - grabbing changes from rm-pre-genesis branch
* combine bellatrix state w/ rm-pre-genesis branch
* WIP
* use encoding/detect for genesis state bytes
* WIP more fixes towards start from bellatrix
* remove debug wrapping
* WIP
* multiple bugfixes
* fix fork ordering bug and bellatrix genesis blocks
* send deposits, spam tx to advance, fix miner alloc
* WIP
* WIP mess
* WIP
* Print process ID information for purposes of attaching a debugger
* bugs: genesis body_root and deposit index mismatch
* fix voting period start, skip altair check
* add changes
* make it better
* rm startup FCU, rm logs
* cleanup import grouping&ordering
* restore FCU log, get rid of tmp var
* rm newline
* restore newline
* restore wrapped error
* rm newline
* removing boot node version override
this doesn't seem to matter?
* add issue number to todo comment
* rm commented code
* rm vmdebug geth flag
* unexport values only used with genesis test pkg
and add comments where missing from exported values.
* adding comments to special cases for testnets
* migrate comments from PR to actual code :)
* rm unused test param
* mark e2e spawns exempt from gosec warning
* Fix DeepSource errors in `proposer_bellatrix.go` (#11739)
* Fix DeepSource errors in
* Omit receiver name
* Address PR comments
* Remove unused variable
* Fix more DeepSource errors
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Remove `Test_IsExecutionEnabledCapella` (#11752)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Add REST implementation for Validator's `ProposeBeaconBlock` (#11731)
* WIP
* WIP
* WIP
* Add tests
* WIP
* Add more tests
* Address DeepSource errors
* Remove unused param
* Add more tests
* Address PR comments
* Address PR comments
* Fix formatting
* Remove unused parameter
* Fix TestLittleEndianBytesToBigInt
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix validator client (#11755)
* fix validator client
(cherry picked from commit deb138959a)
* Use signed changes in middleware block
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
* API `finalized` metadata field - update protos (#11749)
* API `finalized` metadata field - update protos
* change nums
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* log breaks unit tests that don't do full arg setup
easiest to just remove it for now
* restore prior behavior of phase0 block for altair
* update unit tests to account for special case
* loosen condition for fork version to match config
we don't know which fork version genesis will start from, so we
shouldn't force it to be a phase0 genesis.
* skip until we can mod configs at runtime
* NewGenesisBlockForState computes state root itself
* rm noisy log
* this log would be noisy in mainnet
* fix format specifier, []byte -> string
* core.Genesis UnmarshalJson has a value receiver :)
* no longer needs to be exported
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prestonvanloon <preston@prysmaticlabs.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
Co-authored-by: Patrice Vignola <vignola.patrice@gmail.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Implement REST `WaitForActivation`
* Activation: Factorize tests
* Fix PR comments
* `missingPubKeys`: Replace map by slice (no need to have a map here)
* Fix typo
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* adding compare beacon block test
* fixing bazel
* fixing evaluator import
* fixing imports
* changing package name
* fixing bazel
* adding logic to check for checking epoch
* fixing linting
* adding check for attester duties
* handle both blockv1 and blockv2
* making middleware objects public instead
* adding test for block attestations
* fixing typo
* adding blockroot test
* adding test for attestations
* fixing type value
* fixing test
* adding in node endpoints
* fixing bazel
* updating web3signer
* printing beacon blocks on request
* fixing struct
* temp log
* forgot string cast
* adding comparison function
* fixing bazel and evaulators, WIP
* fixing bazel
* changing how to minify json
* trying multiclient
* fixing port problem
* reverting evaluator and making test only for mainnet scenario testing
* removing test data
* fixing linting unused functions
git push
* changed to reflect
* adding in ssz comparison
* fixing tests
* fixing conflict
* fixing tests
* making v2 the standard
* adding better error logging
* fixing type
* adding lighthouse settings and fixing some deepsource items
* testing adding delay to evaluator
* testing without peers check
* changing target peers to try to fix lighthouse peer connections
* temp removing other tests
* fix lint issue
* adding peers connect back in
* adding in state version
* fixing bazel
* fixing path error
* testing changes to state
* fix unmarshal
* simplifying beacon api e2e execution
* fixing missed assertian checks
* improve logging and debugging issue
* trying to fix unmarshal
* still breaking more test edits
* removing fork to test unmarshal
* fixing pathing
* resolving error
* fixing beacon_api
* merging in debug api to beacon_api test
* fixing lint and temp commenting out endpoint
* adding in custom comparison function
* fixing custom evaluator
* adding test for block header data
* fixing header evaluation
* add node apis
* fixing linting,adding tests
* fixing bazel and temp removing unused functions
* fixing deepsource and linting issues
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* addressing review
* resolving more review comments
* fixing linting
* removing ssz return value as it's large and possibly not needed
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fixing more review comments
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fixing linting and review iteems
* fixing cognit complexity issue
* fixing linting
* fix log printout
* test build kite only with crossclient
* switching out evaluator to depositedvalidatorsareactive
* removed wrong evaluator switching correct one
* removing skip based on review comments
* fixing pathing issue
* test without participation at epoch
* testing without special lighthouse logic in evaluator
* reducing expected participation when multiclient
* fixing imports
* reducing epochs to see if less flaky
* testing with other tests added back in
* reducing epochs ran further
* testing only cross client again
* testing multi run again
* test reverted scenario for tests
* testing with cross client
* removing commented out function
* testing without peers connect
* adding optimization based on suggestions
* removed the wrong peers connect
* accidently commited something I shouldn't have
* fixing lighthouse flag
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update testing/endtoend/evaluators/beaconapi_evaluators/beacon_api.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix it
* fix dialer for now
* fix build
* fix test
* fix to v0.24.0
* fix gaz
* fix build
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
due to flaky test re-run behavior, logs from a failed test run are
overwritten by subsequent retries. This makes it difficult to retrieve
logs after the first failed run. It also takes some squinting through
output to find the location of the log file in the first place. This
flag enables logs to be placed in an arbitrary path. Note that bazel
sandboxing generally will force this path to be in the /tmp tree.
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* support generating non-phase0 genesis.ssz
* make default (Value) work for EnumValue + lint
* remove messy punctuation
* Ran gazelle for @kasey
* Fix deps viz
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: prestonvanloon <preston@prysmaticlabs.com>
* rewrite/refactor deposit testing code
keep track of sent deposits so that they can be compared in detail with
the validator set retreived from the API.
* fix bugs in evaluator and retry
* lint + deepsource appeasement
* typo s/Sprintf/Printf/
* gosec, more like nosec
* fix gosec number - 204->304
* type switch to get signed block from container
* improve comments
* centralizing constants and adding comments
* lock around Depositor to avoid future races
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Update go to 1.19.3
* Update other items to 1.19
* Update golangci-lint to latest release
* Run gofmt -s with go1.19
* Huge gofmt changes
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Implement get_expected_withdrawals
* Fix config test and export method
* Radek's review
* start from a different index in a test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* in progress
* done, no tests yet
* fix ToBlinded()
* Revert "Auxiliary commit to revert individual files from 2e356b6f5b15d409ac15e825c744528591c13739"
This reverts commit 081ab74e88fb7d0e3f6a81e00fe5e89483b41f90.
* tests
* fix tests
* one more fix
* and one more
* review
* fix proto_test
* another fix
* do not return error when nil object is wrapped
* allow nil payload in body.Proto()
* correctly assert error
* nil checks in body.Execution()
* simplify PR
* Revert "Auxiliary commit to revert individual files from 5736c1f22f2d2f309b9303c13d0fb6b1679c6ecb"
This reverts commit 1ff3a4c864923f5c180aa015aa087a2814498b42.
* fix slice sizes in cloner tests
* better payload tests
* review
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* tool to query db by a key prefix
* cleanup
* lint and fmt
* db/kv public visibility
We've discussed before that Bazel visibility constraints don't
accomplish much in go, so I'm phasing them out in places where they get
in the way.
* derp
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add error if chain-config-file used with network
If the chain-config-file flag is used concurrently with the network
flag then error and exit.
Related to #10822.
* Add config file name to error message with `fmt`
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Add unit test for hasNetworkFlag
* Add list of network flags to features
* Fix imports
* Run gazelle
* retrigger checks
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Beacon api: get duties prune payload id cache
* Fix complains and bad test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* proto + stub
* Add execution_optimistic to SSZ response
* implementation
* proto fix
* api middleware
* tests
* more tests
* switch from Errorf to Error
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* moving voluntary exit command to prysmctl
* fixing linting
* fixing imports
* removing unused import:
* refactoring and adding a new unit test
* rolling back some changes
* fixing parameters
* fixing tests
* adding to main prysm ctl
* refactoring how wallet function works and ux to validator exit
* adding interop support
* fixing bazel build
* fixing if statement
* fixing beaconcha.in printout
* fixing web3signer bug, missing signing slot info
* fixing deep source issues
* fixing bazel package visibility for prysmctl
* gaz
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Update libp2p to support go 1.19
* gaz
* go mod tidy
* Only update the minimum deps
* go mod tidy
* revert .bazelrc
* Update go-libp2p to v0.22.0 and update import paths (#11440)
* Fix import paths
* Fix go-libp2p-peerstore import
* Bazel updates
* fix
* revert some comments changes
* revert some comment stuff
* fix dependency issues
* vendor problematic library
* use your brain
* remove
* tests
Co-authored-by: Marco Munizaga <marco@marcopolo.io>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* add option to log rejected gossip message
* fix rejectGossipMessage return
* revert test + fix import
* revert all beaconchain/sync/validate_* files
* log object and message if flag is set
* fix failing build
* remove object field
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* update head should go even without attestations
* add unit tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* init
* unit test
* DeepSource complains
* gaz
* shutting deepsource down
* change var name and use handler type
* Kasey's name suggestion
* fix stategen
* interface signature
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Log error for mev boost / relayer status, not return error
* Add ticker to poll relayer status
* Add ticker to poll relayer status
* Update beacon-chain/builder/service.go
* Rm test
* Check nil before calling status
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Dont return if proposer boost roots are missing
* move spectests to doublylinked tree
* unit test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Remove native state flag and use native state in spectests
* remove feature from tests
* use e2e config in slasher simulator
* use params.BeaconConfig in testutil
* use correct function
* use minimal config in go_test
* fix TestListValidators
* parameterize sync committee bits and aggregation bits
* Fix TestServer_ListIndexedAttestations_GenesisEpoch
(cherry picked from commit 254ab623dde08ae8886b152facdbbd8889ed79db)
* fix more tests
* fix even more
* moreeee
* aaaand more
* one more fix
* one more
* simplify TestGetAltairDuties_UnknownPubkey
* comment out problematic test
* one more fix
* one more
* aaaand one more
* another
* use fieldparams in HydrateBlindedBeaconBlockBodyBellatrix
* create new package for mainnet tests
* TestServer_GetBellatrixBeaconBlock
* change slashed validator index
* clear cache in reward_test.go
* deprecate flag
* create bazel mainnet target
* move attester mainnet test to mainnet target
* "fix" proposer tests
* use minimal config in TestServer_circuitBreakBuilder
* fix TestProposer_ProposeBlock_OK
* more fixes in validator package
* more fixes
* more fixes
* test code
* move TestProposer_GetBeaconBlock_BellatrixEpoch to minimal
* finally
* remove proposer_bellatrix_mainnet_test.go
* fix TestServer_GetBellatrixBeaconBlock_HappyCase
* fix TestServer_GetBellatrixBeaconBlock_BuilderCase
* Preston needs to fix this!
* Revert "Preston needs to fix this!"
This reverts commit b03d97a16e.
* remove proto state tests
* fix migration tests
* static analysis fix
* review
* remove proto state
* swap state in tests
* fix BUILD file in /proto/testing
* remove metrics test with nil state
* Remove optimistic sync candidate check
Since we know we have merged and the chain has advanced 128 slots,
there's no possible forkchoice Poissoning attack anymore, removing the
check and allowing any block to be imported optimistically.
* fix test
* fix test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Report voted fractions for a given root
* unused parameters
* comment update
* change test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Fall back to uncached getPaylod if first time outs
* Skip only deadline error. Unit test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Tests for builder service
* fix glob
* minor changes to mock
* add comments to mock
* Revert "Auxiliary commit to revert individual files from bc62a140347e3cbd8bd82e99cf5e9deb98b74df0"
This reverts commit c4c1016cb597b9340d1c81ab3816e037a6b97f9e.
* correct comment
* Do not init builder for empty endpoint
* revert merging issues
* better nil checks
* test fix
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Log ready for merge every min
* Update beacon-chain/execution/check_transition_config.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Better log fee recipient mismatch
Logs if the returned payload from the engine does not have the fee
recipient set in the validator.
Also warn the user if he's proposing a block with the burner fee
recipient address.
* fix tests
* Fix fillInMissingBlocks
Only check that the chain's parent is in forkchoice, rather than it
being the finalized checkpoint. Forkchoice anyway guarantees that the
chain will be a descendant of the finalized checkpoint.
* ensure root is not zero
* fix tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* atts performance and blocks
* idiomatic observe
* all attestation related errors
* block metrics
* db metrics
* metrics func
* rem old metrics
* naming
* rem metric
* rem unneeded
* fix
* fix up
* rev
* fix
* rem
* giving commands more clear names per issue #11287
* mark the top-level help text for cpt deprecated
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* adding in nil check for head
* adding changes based on feedback
* Update beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* remove the check
* remove function and tests
* dead code
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Only update finalized checkpoint in DB if it's newer
Do not save to DB a finalized checkpoint that it's older than the
current one.
* Add a test
* Add more strict condition check
* Revert params.SetupTestConfigCleanupWithLock(t)
* Remove new line
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* fixing json unmarshalling
* adding unit test for no conent
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* db: Wrap errors in db.fetchAncestor to better identify unmarshalling issues. See #11327
* Wrap genesis state fetch, just in case
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Restore forkchoice dump endpoint.
Only working on doubly-linked-tree.
* unit test
* revert proto changes
* protoarray
* Deepsource
* shut up!
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Implement delete gaslimit.
* Minor comment change.
* Reset gaslimit to DefaultConfig's gaslimt instead of 0.
* After gaslimit deletion, use global gaslimit default value instead of values provided in ProposalConfig.
* After deletion, use config default, if that is not available, use global default gaslimit value.
* Use grpc's codes.NotFound instead of http code "404".
* Updated bazel deps (new imports "google.golang.org/grpc/codes" was added for tests).
* Fix "TestServer_RecoverWallet_Derived" test failure.
Previously "params.BeaconConfig()" (thus the default global value
"BLSSecretKeyLength") was overriden by standard_api_test:TestServer_DeleteGasLimit.
Fixed the problem by retoring the origin global default after the test is done.
* Do not change BeaconConfig object, instead change BeaconConfig.DefaultBuilderGasLimit.
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Add feature flag to treat all blocks as optimistic at startup
* Terence's review
* remove changed empty lines
* Apply suggestions from code review
* Go fmt sorry
* bad comments
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Insert attestations from blocks to forkchoice
* do not insert twice
* use OnAttestation instead
* Revert "use OnAttestation instead"
This reverts commit 577c37bbeb.
* unit test
* fix test
* Update beacon-chain/blockchain/receive_block_test.go
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
New spectests ensure that we call on_tick for every slot between the
last tick and the current one. This PR fixes that
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Do not use return value in error handling
* Revert changes to EpochFromString & SlotFromString
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* This PR is for issue #11155 "Keymanager APIs: gas limit api"'s task "set gas limit".
* This PR is for issue #11155 "Keymanager APIs: gas limit api"'s task "set gas limit".
* Fixed comment string.
* Regenerated key_management proto files.
* Addressed code review comment - explitly set BuildConfig.Enabled to false.
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* remove it
* gaz
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* proto gen fix
* regen protos and ssz bindings
* regen
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Starting
* Done
* Fix more tests
* Fix test
* Fix test
* fix up
* building
* requirement
* gaz
* builds
* rem deadcode
* fix
* fix up
* removed checked method
* Update service_test.go
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* first node test
* adding in configuration flags for code coverage
* adding line to remove file on unit test
* adding new test for compressed field trie but is currently broken
* changing limit on trie
* adding new trie length coverage
* adding in test for empty copy of trie
* adding more trie tests
* adding new field trie
* adding more field trie tests
* adding clarity to chunking equation
* fixing linting
* clarifying function for limit
* updating native state settings to improve ease of future unit tests
* improving unit test
* fixing unit tests
* adding more tests and fixing linting
* adding more coverage and removing unused file
* increasing node coverage
* adding new test for checking config for booleans
* fixing db test
* fixing linting
* adding signing root test
* fixing linting
* removing accidently created beacondata
* switching not non native state
* reverting back to proto use for spec test
* reverting back to proto for some tests
* turning off native state on some tests
* switching more to proto state
* rolling back disablenativestate
* switching to native state in the state-native package for tests
* fixing linting
* fixing deepsource complaint
* fixing some tests to native state and removing some unused flag checks
* convert to native state
* fixing linting
* issues are being triggered by deleting the db this way so reverting change in hopes of changing this
* rolling back testing util
* rolling back some tests from native state
* rolling back db deletion
* test switching native state off after test runs
* fixing hasher test
* fixing altair and bellatrix hashers for native state
* Update beacon-chain/node/node_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update validator/rpc/auth_token_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fixing imports
* adding altair proof test
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* updating proto name
* updating generated files
* updating names on block v2 and v3 signing types
* fixing import format
* fixing unit tests
* fixing unit test
* fixing more conflicts
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* batch reconstruction
* add test
* clean up
* terence's comment
* terence's other comment
* try out in e2e
* fix
* fix some more
* fix blinded blocks
* fix it
* remove dev flag
Co-authored-by: terencechain <terence@prysmaticlabs.com>
There is a double lock race condition when NewSlot acquires the
checkpoints lock first and the nodes lock later, while calls to Head()
acquire the nodeslock first and the checkpoints lock later.
This PR releases the checkpoints lock in NewSlot, to reaquire it later
in updateUnrealizedCheckpoints after getting the nodes lock
* Upgrade Grail Bazel toolchain to latest release v0.7.2
This should allow Prysm to compile on Ubuntu 21.10 and 22.04
* Changes necessary in .bazelrc for new version of com_grail_bazel_toolchain
* Add cross compilation for OSX ARM64 (Apple Silicon)
* Update cross-toolchain README to include osx_arm64
* Add double quotes to shell code
* Rename install_clang_cross10.sh -> install_clang_cross.sh
* Update with prysmatic labs uploaded assets
* Touch README to trigger CI
* Revert "Touch README to trigger CI"
This reverts commit 826ac8a6d8.
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prestonvanloon <preston@prysmaticlabs.com>
* adding in unit tests and updated error messaging
* returning errors correctly
* Update api/client/builder/client.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* updating based on comments
* fixing unit tests
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Logging: strip new lines and other control characters
* Use strings.Map and only sanitize the field value
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* This PR is for issue #11155 "Keymanager APIs: get_limit api".
This PR implements the first task "get gas limit for the validator key".
* Removed useless import alias.
* Added regenerated key_management.pb.go/pb.gw.go files as well as endpoint_factory.go changes.
* Address James's comments:
1. api path component should be "gas_limit" instead of "gaslimit".
2. ran curl test like:
- go build -o tmp/validator
- ./tmp/validator --web --validators-external-signer-url=http://localhost:9000/
- curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.C-BuVfWhKpr9elB05GTJdEEx_8AzkImxzXL03IqcHR8" 127.0.0.1:7500/eth/v1/validator/0xb4844195ce8ca78d9d4f7ffdf4001cfdb079e059542bcc4f45ddfff2bcec7defb1482db4f9426f92f59972da395dd2b5/gas_limit
- {"data":{"pubkey":"0xb4844195ce8ca78d9d4f7ffdf4001cfdb079e059542bcc4f45ddfff2bcec7defb1482db4f9426f92f59972da395dd2b5","gas_limit":"30000000"}}
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* fixing stringslice issue and adding one more filter
* fixing linting and improving function based on feedback
* rolling back generic function to check ci
* adding function back in
* testing printing error
* reverting change
* Added gofmt detail flag
* temporary change
* Another flag added
* Revert changes
* Modifed entrypoint
* Another change
* Revert
* Change go image
* Added -e flag
* Switched to alpine image
* Switched go to strech
* Fix typo
* Yet another image added
* Added go alpine
* rolling back generic
* reverting version
* Update go.sum
reverting
* Update go.mod
reverting
* Update Dockerfile
rolling back
* Update entrypoint.sh
rolling back
* Update go.yml
reverting changes
* fixing flag for config
* reverting changes and moving change to another PR
* Update validator/node/node.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* updating based on review
* Update container/slice/slice.go
Co-authored-by: Taranpreet26311 <taran@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Forkchoice: expose if no tip is viable
This PR changes the behavior on when the node is considered optimistic.
A call to `blockchain.IsOptimistic()` relies solely on forkchoice, if
all tips are invalid, then it's optimistic. If the current headroot is
not in forkchoice then it's optimistic.
A call to `blockchain.IsOptimisticForRoot()` will return true if the
requested root is headroot and it's not found in forkchoice
* update comment
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* panic in SizeSSZ
* moving slowly
* adapt old code to new interfaces
* return interfaces from factory functions
* replace the rest of WrappedSignedBeaconBlock
* WrappedBeaconBlock
* WrappedBeaconBlockBody
* miscellaneous
* Test_BeaconBlockIsNil
* replace usages of BeaconBlockIsNil
* replace usages of mutator
* fix all build errors
* fix some more issues
* mutator changes
* relax assertions when initializing
* revert changes in object_mapping.go
* allow calling Proto on nil
* Revert "allow calling Proto on nil"
This reverts commit ecc84e4553.
* modify Copy and Proto methods
* remove unused var
* fix block batch tests
* correct BUILD file
* Error when initializing nil objects
* one more error fix
* add missing comma
* rename alias to blocktest
* add logging
* error when SignedBeaconBlock is nil
* fix last test
* import fix
* broken
* working
* test fixes
* reduce complexity of processPendingBlocks
* simplified
* Add analysis template with failing test
* Works for the most common use case
* Progress on tool and more test cases
* Improvements
* handle nil
* works for the most part
* Fix some TODOs in the tool
* Fix some TODOs in the tool
* Deal with nil LVH
After https://github.com/ethereum/execution-apis/pull/254 the EL may
return `nil` for LVH. Our current implementation would treat this as a
zero hash and thus mark all blocks since the merge block as INVALID
* Apply suggestions from Terence
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Add a copy of github.com/x-cray/logrus-prefixed-formatter with fixes for our static analysis
* gazelle and add failing test
* fix it
* fix link
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* make it the default
* deprecate this
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Initialise slasher service using New in slasher test to avoid panics
* Handle unhanlded error
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
When requesting with IsOptimistic for a root which is non-canonical and
historic, we should check if it is canonical before returning false.
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* Add prater bellatrix fork epoch and ttd
* Update workspace with tar and fix tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Fix IsExecutionEnabled for blinded blocks
The TransactionsRoot of a blinded block may be non-zero, anyway we do
not insert the header in the state until IsExecutionEnabled is true.
This last check was failing on blinded blocks because it was actively
checking that the root should be zero, when it needn't be.
Superseeds #11068
* fix test
* test case
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* fixing ux on propertynaming, introducing placeholder property
* reverting some refactors
* Update debug.go
* Update debug.go
* rolling back change on file
* adding new unit tests and renaming flags
* renaming variable
* initial commit
* adjusting logic to match web3signer specifications
* making Epoch mandatory
* fixing unit test
* rolling back some changes on slots
* fixing unit tests
* testing enable validator registration
* adding validator registration to configs
* fixing prefix
* fixing shasum
* rolling back e2e validator registration until fully supported
* updating web3signer version
* changing types based on feedback
* Improve error verbosity with payload ID is nil
* Conflict
* Fix test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* exec payload iface
* begin using iface
* use iface more
* build beacon
* builds
* txs field
* fix
* merge test
* pass
* test
* refactor
* fix up builder case
* gaz
* comments
* el test
* build
* no mask
* patch up
* exec wrap
* Terence feedback
* builds
* potuz suggestion
* exec data error
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* initial commit
* fixing variable rename
* fixing unit test
* adding based on review comments
* renaming cache
* simplifying logic on signed validator registrationRequest
* adding unit tests
* fixing linting
* using wrong dependency
* changing gaslimit to validator registration
* adding new flag to enable validator registration for suggested fee recipient
* making sure default gaslimit is set
* Update cmd/validator/flags/flags.go
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Do not error if the LVH is bogus
* add tests and mark the regression PR
* dead code
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Handle invalid_block_hash error from ee
* Update beacon-chain/blockchain/error.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Remove invalid block and state
* Revert "Remove invalid block and state"
This reverts commit 9ca011b8ce.
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Annotate build client requests
* Use named return arguments to annotate errors
* Unhandled error was bad
* Error level is better than warning for this
* Clarifying commentary while i'm here
* delete the pasta
* add heuristics for pulltips
* gazelle
* add unit test
* fix unit test
Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* testing out fee-recipient evaluator
* fixing bazel linter
* adjusting comparison
* typo on file rolling back
* adding fee recipient is present to minimal e2e
* fixing gofmt
* fixing gofmt
* fixing flag usage name
* adding in log to help debug
* fixing log build
* trying to figure out why suggested fee recipient isn't working in e2e, adding more logging temporarily
* rolling back logs
* making e2e test more dynamic
* fixing deepsource issue
* fixing bazel
* adding in condition for latest release
* duplicate condtion check.
* fixing gofmt
* rolling back changes
* adding fee recipient evaluator in new file
* fixing validator component logic
* testing rpc client addition
* testing fee recipient evaluator
* fixing bazel:
* testing casting
* test casting
* reverting
* testing casting
* testing casting
* testing log
* adding bazel fix
* switching mixed case and adding temp logging
* fixing gofmt
* rolling back changes
* removing fee recipient evaluator when web3signer is used
* test only minimal config
* reverting changes
* adding fee recipient evaluator to mainnet
* current version uses wrong flag name
* optimizing key usage
* making mining address a variable
* moving from global to local variable
* removing unneeded log
* removing redundant check
* make proposer settings mroe deterministic and also have the evaluator compare the wanting values
* fixing err return
* fixing bazel
* checking file too much moving it out
* fixing gosec
* trying to fix gosec error
* trying to fix address
* fixing linting
* trying to gerenate key and random address
* fixing linting
* fixing check for proposer config
* trying with multi config files
* fixing is dir check
* testing for older previous balance
* adding logging to help debug
* changing how i get the block numbers
* fixing missed error check
* adding gasused check
* adding log for current gas used
* taking suggestion to make fee recipient more deterministic
* fixing linting
* fixing check
* fixing the address check
* fixing format error
* logic to differentiate recipients
* fixing linting
To help us tend to your issue faster, please search our currently open issues before submitting a new one.
Existing issues often contain information about workarounds, resolution, or progress updates.
💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎💎-->
# 🐞 Bug Report
### Description
<!-- ✍️--> A clear and concise description of the problem...
### Has this worked before in a previous version?
<!-- Did this behavior use to work in the previous version? -->
<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....
## 🔬 Minimal Reproduction
<!--
Please let us know how we can reproduce this issue. Include the exact method you used to run Prysm along with any flags used in your beacon chain and/or validator. Make sure you don't upload any confidential files or private keys.
-->
## 🔥 Error
<pre><code>
<!-- If the issue is accompanied by an error, please share the error logs with us below. If you have a lot of logs, place make a paste bin with your logs and share the link with us here: -->
<!-- ✍️-->
</code></pre>
## 🌍 Your Environment
**Operating System:**
<pre>
<code>
</code>
</pre>
**What version of Prysm are you running? (Which release)**
<pre>
<code>
</code>
</pre>
**Anything else relevant (validator index / public key)?**
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?**
@@ -28,3 +29,10 @@
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).
Note: The latest and most uptodate documenation can be found on our [docs portal](https://docs.prylabs.network/docs/contribute/contribution-guidelines).
Note: The latest and most up-to-date documentation can be found on our [docs portal](https://docs.prylabs.network/docs/contribute/contribution-guidelines).
Excited by our work and want to get involved in building out our sharding releases? Or maybe you haven't learned as much about the Ethereum protocol but are a savvy developer?
You can explore our [Open Issues](https://github.com/prysmaticlabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/CTYGPUJ) drop us a line there if you want to get more involved or have any questions on our implementation!
You can explore our [Open Issues](https://github.com/OffchainLabs/prysm/issues) in-the works for our different releases. Feel free to fork our repo and start creating PR’s after assigning yourself to an issue of interest. We are always chatting on [Discord](https://discord.gg/prysm) drop us a line there if you want to get more involved or have any questions on our implementation!
> [!IMPORTANT]
> Please, **do not send pull requests for trivial changes**, such as typos, these will be rejected. These types of pull requests incur a cost to reviewers and do not provide much value to the project. If you are unsure, please open an issue first to discuss the change.
## Contribution Steps
**1. Set up Prysm following the instructions in README.md.**
**2. Fork the prysm repo.**
**2. Fork the Prysm repo.**
Sign in to your Github account or create a new account if you do not have one already. Then navigate your browser to https://github.com/prysmaticlabs/prysm/. In the upper right hand corner of the page, click “fork”. This will create a copy of the Prysm repo in your account.
Sign in to your GitHub account or create a new account if you do not have one already. Then navigate your browser to https://github.com/OffchainLabs/prysm/. In the upper right hand corner of the page, click “fork”. This will create a copy of the Prysm repo in your account.
$ git remote -v (you should see myrepo and prysm in the list of remotes)
```
**6. Find an issue to work on.**
Check out open issues at https://github.com/prysmaticlabs/prysm/issues and pick one. Leave a comment to let the development team know that you would like to work on it. Or examine the code for areas that can be improved and leave a comment to the development team to ask if they would like you to work on it.
Check out open issues at https://github.com/OffchainLabs/prysm/issues and pick one. Leave a comment to let the development team know that you would like to work on it. Or examine the code for areas that can be improved and leave a comment to the development team to ask if they would like you to work on it.
**7. Create a local branch with a name that clearly identifies what you will be working on.**
@@ -68,7 +71,7 @@ $ go test <file_you_are_working_on>
$ git add --all
```
This command stages all of the files that you have changed. You can add individual files by specifying the file name or names and eliminating the “-- all”.
This command stages all the files that you have changed. You can add individual files by specifying the file name or names and eliminating the “-- all”.
**11. Commit the file or files.**
@@ -96,8 +99,7 @@ If there are conflicts between your edits and those made by others since you sta
$ git status
```
Open those files one at a time and you
will see lines inserted by Git that identify the conflicts:
Open those files one at a time, and you will see lines inserted by Git that identify the conflicts:
**15. Check to be sure your fork of the Prysm repo contains your feature branch with the latest edits.**
Navigate to your fork of the repo on Github. On the upper left where the current branch is listed, change the branch to your feature-in-progress-branch. Open the files that you have worked on and check to make sure they include your changes.
Navigate to your fork of the repo on GitHub. On the upper left where the current branch is listed, change the branch to your feature-in-progress-branch. Open the files that you have worked on and check to make sure they include your changes.
**16. Create a pull request.**
**16. Add an entry to CHANGELOG.md.**
Navigate your browser to https://github.com/prysmaticlabs/prysm and click on the new pull request button. In the “base” box on the left, leave the default selection “base master”, the branch that you want your changes to be applied to. In the “compare” box on the right, select feature-in-progress-branch, the branch containing the changes you want to apply. You will then be asked to answer a few questions about your pull request. After you complete the questionnaire, the pull request will appear in the list of pull requests at https://github.com/prysmaticlabs/prysm/pulls.
All PRs must must include a changelog fragment file in the `changelog` directory. If your change is not user-facing or should not be mentioned in the changelog for some other reason, you may use the `Ignored` changelog section in your fragment's header to satisfy this requirement without altering the final release changelog. See the [Maintaining CHANGELOG.md](#maintaining-changelogmd) section for more information.
**17. Respond to comments by Core Contributors.**
**17. Create a pull request.**
Navigate your browser to https://github.com/OffchainLabs/prysm and click on the new pull request button. In the “base” box on the left, leave the default selection “base develop”, the branch that you want your changes to be applied to. In the “compare” box on the right, select feature-in-progress-branch, the branch containing the changes you want to apply. You will then be asked to answer a few questions about your pull request. After you complete the questionnaire, the pull request will appear in the list of pull requests at https://github.com/OffchainLabs/prysm/pulls. Ensure that you have added an entry to CHANGELOG.md if your PR is a user-facing change. See the [Maintaining CHANGELOG.md](#maintaining-changelogmd) section for more information.
**18. Respond to comments by Core Contributors.**
Core Contributors may ask questions and request that you make edits. If you set notifications at the top of the page to “not watching,” you will still be notified by email whenever someone comments on the page of a pull request you have created. If you are asked to modify your pull request, repeat steps 8 through 15, then leave a comment to notify the Core Contributors that the pull request is ready for further review.
**18. If the number of commits becomes excessive, you may be asked to squash your commits.**
**19. If the number of commits becomes excessive, you may be asked to squash your commits.**
You can do this with an interactive rebase. Start by running the following command to determine the commit that is the base of your branch...
@@ -137,7 +143,7 @@ Core Contributors may ask questions and request that you make edits. If you set
**19. The previous command will return a commit-hash that you should use in the following command.**
**20. The previous command will return a commit-hash that you should use in the following command.**
```
$ git rebase -i commit-hash
@@ -151,7 +157,7 @@ pick hash fix a bug
pick hash add a feature
```
Replace the word pick with the word “squash” for every line but the first so you end with ….
Replace the word pick with the word “squash” for every line but the first, so you end with ….
```
pick hash do some work
@@ -161,13 +167,24 @@ squash hash add a feature
Save and close the file, then a commit command will appear in the terminal that squashes the smaller commits into one. Check to be sure the commit message accurately reflects your changes and then hit enter to execute it.
**20. Update your pull request with the following command.**
**21. Update your pull request with the following command.**
```
$ git push myrepo feature-in-progress-branch -f
```
**21. Finally, again leave a comment to the Core Contributors on the pull request to let them know that the pull request has been updated.**
**22. Finally, again leave a comment to the Core Contributors on the pull request to let them know that the pull request has been updated.**
## Maintaining CHANGELOG.md
This project follows the changelog guidelines from [keepachangelog.com](https://keepachangelog.com/en/1.1.0/). In order to minimize conflicts and workflow headaches, we chose to implement a changelog management
strategy that uses changelog "fragment" files, managed by our changelog management tool called `unclog`. Each PR must include a new changelog fragment file in the `changelog` directory, as specified by unclog's
[README.md](https://github.com/OffchainLabs/unclog?tab=readme-ov-file#what-is-a-changelog-fragment). As the `unclog` README suggests in the [Best Practices](https://github.com/OffchainLabs/unclog?tab=readme-ov-file#best-practices) section,
the standard naming convention for your PR's fragment file, to avoid conflicting with another fragment file, is `changelog/<github user name>_<PR branch name>.md`.
### Releasing
When a new release is made, the "Unreleased" section should be moved to a new section with the release version and the current date. Then a new "Unreleased" section is made at the top of the file with the categories listed above.
## Contributor Responsibilities
@@ -178,7 +195,7 @@ We consider two types of contributions to our repo and categorize them as follow
Anyone can become a part-time contributor and help out on implementing Ethereum consensus. The responsibilities of a part-time contributor include:
- Engaging in Gitter conversations, asking the questions on how to begin contributing to the project
- Opening up github issues to express interest in code to implement
- Opening up GitHub issues to express interest in code to implement
- Opening up PRs referencing any open issue in the repo. PRs should include:
- Detailed context of what would be required for merge
- Tests that are consistent with how other tests are written in our implementation
@@ -188,12 +205,12 @@ Anyone can become a part-time contributor and help out on implementing Ethereum
### Core Contributors
Core contributors are remote contractors of Prysmatic Labs, LLC. and are considered critical team members of our organization. Core devs have all of the responsibilities of part-time contributors plus the majority of the following:
Core contributors are remote contractors of Prysmatic Labs, LLC. and are considered critical team members of our organization. Core devs have all the responsibilities of part-time contributors plus the majority of the following:
- Stay up to date on the latest beacon chain specification
- Monitor github issues and PR’s to make sure owner, labels, descriptions are correct
- Monitor GitHub issues and PR’s to make sure owner, labels, descriptions are correct
- Formulate independent ideas, suggest new work to do, point out improvements to existing approaches
- Participate in code review, ensure code quality is excellent, and have ensure high code coverage
- Participate in code review, ensure code quality is excellent, and ensure high code coverage
- Help with social media presence, write bi-weekly development update
- Represent Prysmatic Labs at events to help spread the word on scalability research and solutions
2.`git clone https://github.com/prysmaticlabs/prysm && cd prysm`
3.`bazel build //...`
2.`git clone https://github.com/OffchainLabs/prysm && cd prysm`
3.`bazel build //cmd/...`
## Starting from Genesis
Prysm supports a few ways to quickly launch a beacon node from basic configurations:
-`NumValidators + GenesisTime`: Launches a beacon node by deterministically generating a state from a num-validators flag along with a genesis time **(Recommended)**
-`SSZ Genesis`: Launches a beacon node from a .ssz file containing a SSZ-encoded, genesis beacon state
Prysm can be started from a built-in mainnet genesis state, or started with a provided genesis state by
using the `--genesis-state` flag and providing a path to the genesis.ssz file.
## Generating a Genesis State
@@ -21,24 +24,34 @@ To setup the necessary files for these quick starts, Prysm provides a tool to ge
a deterministically generated set of validator private keys following the official interop YAML format
You can use `bazel run //tools/genesis-state-gen` to create a deterministic genesis state for interop.
You can use `prysmctl` to create a deterministic genesis state for interop.
### Usage
- **--genesis-time** uint: Unix timestamp used as the genesis time in the generated genesis state (defaults to now)
- **--num-validators** int: Number of validators to deterministically include in the generated genesis state
- **--output-ssz** string: Output filename of the SSZ marshaling of the generated genesis state
- **--config-name=interop** string: name of the beacon chain config to use when generating the state. ex mainnet|minimal|interop
**deprecated flag: use --config-name instead**
- **--mainnet-config** bool: Select whether genesis state should be generated with mainnet or minimal (default) params
The example below creates 64 validator keys, instantiates a genesis state with those 64 validators and with genesis unix timestamp 1567542540,
and finally writes a ssz encoded output to ~/Desktop/genesis.ssz. This file can be used to kickstart the beacon chain in the next section. When using the `--interop-*` flags, the beacon node will assume the `interop` config should be used, unless a different config is specified on the command line.
-`bazel run //cmd/prysmctl` is the bazel command to compile and run prysmctl.
-`--config=minimal` is a bazel build time configuration flag to compile Prysm with minimal state constants.
-`--` is an argument divider to tell bazel that everything after this divider should be passed as arguments to prysmctl. Without this divider, it isn't clear to bazel if the arguments are meant to be build time arguments or runtime arguments so the operation complains and fails to build without this divider.
-`testnet` is the primary command argument for prysmctl.
-`generate-genesis` is the subcommand to `testnet` in prysmctl.
-`--genesis-time-delay` uint: The number of seconds in the future to define genesis. Example: a value of 60 will set the genesis time to 1 minute in the future. This should be sufficiently large enough to allow for you to start the beacon node before the genesis time.
-`--num-validators` int: Number of validators to deterministically include in the generated genesis state
-`--output-ssz` string: Output filename of the SSZ marshaling of the generated genesis state
-`--chain-config-file` string: Filepath to a chain config yaml file.
Note: This guide saves items to the `/tmp/` directory which will not persist if your machine is
restarted. Consider tweaking the arguments if persistence is needed.
This will deterministically generate a beacon genesis state and start
the system with 64 validators and the genesis time set to the current unix timestamp.
Wait a bit until your beaconchain starts, and in the other window:
This will start the system with 256 validators. The flags used can be explained as such:
-`bazel run //cmd/beacon-chain --config=minimal` builds and runs the beacon node in minimal build configuration.
-`--` is a flag divider to distinguish between bazel flags and flags that should be passed to the application. All flags and arguments after this divider are passed to the beacon chain.
-`--minimal-config` tells the beacon node to use minimal network configuration. This is different from the compile time state configuration flag `--config=minimal` and both are required.
-`--bootstrap-node=` disables the default bootstrap nodes. This prevents the client from attempting to peer with mainnet nodes.
-`--datadir=/tmp/beacon-chain-minimal-devnet` sets the data directory in a temporary location. Change this to your preferred destination.
-`--force-clear-db` will delete the beaconchain.db file without confirming with the user. This is helpful for iteratively running local devnets without changing the datadir, but less helpful for one off runs where there was no database in the data directory.
-`--min-sync-peers=0` allows the beacon node to skip initial sync without peers. This is essential because Prysm expects at least a few peers to start the blockchain.
-`--genesis-state=/tmp/genesis.ssz` defines the path to the generated genesis ssz file. The beacon node will use this as the initial genesis state.
-`--chain-config-file=/tmp/minimal.yaml` defines the path to the yaml file with the chain configuration.
As soon as the beacon node has started, start the validator in the other terminal window.
```
bazel run //validator -- --keymanager=interop --keymanageropts='{"keys":64}'
bazel run //cmd/validator --config=minimal -- --datadir=/tmp/validator --interop-num-validators=256 --minimal-config --suggested-fee-recipient=0x8A04d14125D0FDCDc742F4A05C051De07232EDa4
```
This will launch and kickstart the system with your 64 validators performing their duties accordingly.
### Launching from `genesis.ssz`
Assuming you generated a `genesis.ssz` file with 64 validators, open up two terminal windows, run:
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the [Ethereum Consensus](https://ethereum.org/en/eth2/) specification, developed by [Prysmatic Labs](https://prysmaticlabs.com). See the [Changelog](https://github.com/prysmaticlabs/prysm/releases) for details of the latest releases and upcoming breaking changes.
</div>
### Getting Started
---
A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the [official documentation portal](https://docs.prylabs.network). If you still have questions, feel free to stop by our [Discord](https://discord.gg/CTYGPUJ).
## 📖 Overview
### Staking on Mainnet
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the [Ethereum Consensus](https://ethereum.org/en/developers/docs/consensus-mechanisms/#proof-of-stake) [specification](https://github.com/ethereum/consensus-specs), developed by [Offchain Labs](https://www.offchainlabs.com).
To participate in staking, you can join the [official eth2 launchpad](https://launchpad.ethereum.org). The launchpad is the only recommended way to become a validator on mainnet. You can explore validator rewards/penalties via Bitfly's block explorer: [beaconcha.in](https://beaconcha.in), and follow the latest blocks added to the chain on [beaconscan](https://beaconscan.com).
See the [Changelog](https://github.com/OffchainLabs/prysm/releases) for details of the latest releases and upcoming breaking changes.
---
## 🚀 Getting Started
A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the **[official documentation portal](https://docs.prylabs.network)**.
💬 **Need help?** Join our **[Discord Community](https://discord.gg/prysm)** for support.
---
## 🏆 Staking on Mainnet
To participate in staking, you can join the **[official Ethereum launchpad](https://launchpad.ethereum.org)**. The launchpad is the **only recommended** way to become a validator on mainnet.
🔍 Explore validator rewards/penalties:
- **[beaconcha.in](https://beaconcha.in)**
- **[beaconscan](https://beaconscan.com)**
---
## 🤝 Contributing
### 🔥 Branches
## Contributing
### Branches
Prysm maintains two permanent branches:
* [master](https://github.com/prysmaticlabs/prysm/tree/master): This points to the latest stable release. It is ideal for most users.
* [develop](https://github.com/prysmaticlabs/prysm/tree/develop): This is used for development, it contains the latest PRs. Developers should base their PRs on this branch.
-**[`master`](https://github.com/OffchainLabs/prysm/tree/master)** - This points to the latest stable release. It is ideal for most users.
-**[`develop`](https://github.com/OffchainLabs/prysm/tree/develop)** - This is used for development and contains the latest PRs. Developers should base their PRs on this branch.
### Guide
Want to get involved? Check out our [Contribution Guide](https://docs.prylabs.network/docs/contribute/contribution-guidelines/) to learn more!
### 🛠 Contribution Guide
## License
Want to get involved? Check out our **[Contribution Guide](https://docs.prylabs.network/docs/contribute/contribution-guidelines/)** to learn more!
[GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)
[Releases](https://github.com/prysmaticlabs/prysm/releases/) contains all available releases. We recommend using the [most recently released version](https://github.com/prysmaticlabs/prysm/releases/latest).
[Releases](https://github.com/OffchainLabs/prysm/releases/) contains all available releases. We recommend using the [most recently released version](https://github.com/OffchainLabs/prysm/releases/latest).
## Reporting a Vulnerability
Please see our signed [security.txt](https://github.com/prysmaticlabs/prysm/blob/develop/.well-known/security.txt) for preferred encryption and reporting destination.
Please see our signed [security.txt](https://github.com/OffchainLabs/prysm/blob/develop/.well-known/security.txt) for preferred encryption and reporting destination.
**Please do not file a public ticket** mentioning the vulnerability, as doing so could increase the likelihood of the vulnerability being used before a fix has been created, released and installed on the network.
By downloading, accessing or using the Prysm implementation (“Prysm”), you (referenced herein as “you” or the “user”) certify that you have read and agreed to the terms and conditions below (the “Terms”) which form a binding contract between you and Offchain Labs, Inc. (as successor in interest to Prysmatic Labs LLC) (referenced herein as “Offchain Labs”, “we” or “us”). If you do not agree to the Terms, do not download or use Prysm. Additionally, the Terms of Use available at https://arbitrum.io/tos (or any successor site, the “OCL Terms of Use”) are hereby incorporated by reference into these Terms. In the event of any conflict between provisions set forth herein and those set forth in the OCL Terms of Use, the provisions set forth herein shall control.
By downloading, accessing or using the Prysm implementation (“Prysm”), you (referenced herein as “you” or the “user”) certify that you have read and agreed to the terms and conditions below (the “Terms”) which form a binding contract between you and Prysmatic Labs (referenced herein as “we” or “us”). If you do not agree to the Terms, do not download or use Prysm.
## About Prysm
### About Prysm
Prysm is a client implementation for Ethereum consensus protocol for a proof-of-stake blockchain. To participate in the network, a user must send ETH from the Eth1.0 chain into a validator deposit contract, which will queue in the user as a validator in the system. Validators participate in proposing and voting on blocks in the protocol, and the network applies rewards/penalties based on their behavior. A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal, however, we do not warrant the accuracy, completeness or usefulness of this documentation. Any reliance you place on such information is strictly at your own risk.
Prysm is a client implementation for the Ethereum blockchain’s consensus protocol. To participate in the network, a user must send ETH from the Ethereum mainnet blockchain to a validator deposit smart contract on Ethereum mainnet. Validators participate in proposing and voting on blocks in the protocol, and the network applies rewards/penalties based on their behavior. A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal, however, we do not warrant the accuracy, completeness or usefulness of this documentation. Any reliance you place on such information is strictly at your own risk.
### Licensing Terms
Prysm is a fully open-source software program licensed pursuant to the GNU General Public License v3.0.
## Licensing Terms
Prysm is an open-source software program licensed pursuant to the GNU General Public License v3.0.
The Offchain Labs name, the term “Prysm” and all related names, logos, product and service names, designs and slogans are trademarks of Offchain Labs or its affiliates and/or licensors. You must not use such marks without our prior written permission.
PLEASE READ THESE TERMS CAREFULLY, AS THE OCL TERMS OF USE INCORPORATED BY REFERENCE HEREIN CONTAIN AN AGREEMENT TO ARBITRATE AND OTHER IMPORTANT INFORMATION REGARDING YOUR LEGAL RIGHTS, REMEDIES, AND OBLIGATIONS. THE AGREEMENT TO ARBITRATE REQUIRES (WITH LIMITED EXCEPTION) THAT YOU SUBMIT CLAIMS YOU HAVE AGAINST US TO BINDING AND FINAL ARBITRATION, AND FURTHER (1) YOU WILL ONLY BE PERMITTED TO PURSUE CLAIMS AGAINST OFFCHAIN LABS ON AN INDIVIDUAL BASIS, NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY CLASS OR REPRESENTATIVE ACTION OR PROCEEDING, (2) YOU WILL ONLY BE PERMITTED TO SEEK RELIEF (INCLUDING MONETARY, INJUNCTIVE, AND DECLARATORY RELIEF) ON AN INDIVIDUAL BASIS, AND (3) YOU MAY NOT BE ABLE TO HAVE ANY CLAIMS YOU HAVE AGAINST US RESOLVED BY A JURY OR IN A COURT OF LAW.
The Prysmatic Labs name, the term “Prysm” and all related names, logos, product and service names, designs and slogans are trademarks of Prysmatic Labs or its affiliates and/or licensors. You must not use such marks without our prior written permission.
## Risks of Operating Prysm
### Risks of Operating Prysm
The use of Prysm and acting as a validator on the Ethereum network can lead to loss of money. Ethereum is still an experimental system and ETH remains a risky investment. You alone are responsible for your actions on Prysm including the security of your ETH and meeting any applicable minimum system requirements.
The use of Prysm and acting as a validator on the Ethereum network can lead to loss of money, tokens and value. Ethereum is still an experimental system and ETH remains a risky investment. You alone are responsible for your actions on Prysm, including the security of your ETH and meeting any applicable minimum system requirements.
Use of Prysm and the ability to receive rewards or penalties may be affected at any time by mistakes made by the user or other users, software problems such as bugs, errors, incorrectly constructed transactions, unsafe cryptographic libraries or malware affecting the network, technical failures in the hardware of a user, security problems experienced by a user and/or actions or inactions of third parties and/or events experienced by third parties, among other risks. We cannot and do not guarantee that any user of Prysm will make money, that the Prysm network will operate in accordance with the documentation or that transactions will be effective or secure.
We make no claims that Prysm is appropriate or permitted for use in any specific jurisdiction. Access to Prysm may not be legal by certain persons or in certain jurisdictions or countries. If you access Prysm, you do so on your own initiative and are responsible for compliance with local laws.
YOU ACKNOWLEDGE THAT WE ARE NOT RESPONSIBLE FOR ANY RISKS ASSOCIATED WITH YOUR USE OF PRYSM, AND CANNOT BE HELD LIABLE FOR ANY RESULTING LOSSES THAT YOU EXPERIENCE WHILE ACCESSING OR USING PRYSM.
Some Internet plans will charge an additional amount for any excess upload bandwidth used that isn’t included in the plan and may terminate your connection without warning because of overuse. We advise that you check whether your Internet connection is subjected to such limitations and monitor your bandwidth use so that you can stop Prysm before you reach your upload limit.
BY ACCESSING AND USING PRYSM, YOU REPRESENT AND WARRANT THAT YOU UNDERSTAND THE INHERENT RISKS ASSOCIATED WITH USING CRYPTOGRAPHIC AND BLOCKCHAIN-BASED SYSTEMS, AND THAT YOU HAVE A WORKING KNOWLEDGE OF THE USAGE AND INTRICACIES OF DIGITAL ASSETS, SUCH AS THOSE FOLLOWING THE ETHEREUM TOKEN STANDARD (ERC-20). YOU FURTHER UNDERSTAND THAT THE MARKETS FOR DIGITAL ASSETS ARE HIGHLY VOLATILE DUE TO VARIOUS FACTORS, INCLUDING ADOPTION, SPECULATION, TECHNOLOGY, SECURITY, AND REGULATION. YOU ACKNOWLEDGE AND ACCEPT THAT THE COST AND SPEED OF TRANSACTING WITH CRYPTOGRAPHIC AND BLOCKCHAIN-BASED SYSTEMS SUCH AS ETHEREUM ARE VARIABLE AND MAY INCREASE DRAMATICALLY AT ANY TIME. YOU UNDERSTAND THAT ANYONE CAN CREATE A TOKEN, INCLUDING FAKE VERSIONS OF EXISTING TOKENS AND TOKENS THAT FALSELY CLAIM TO REPRESENT PROJECTS, AND ACKNOWLEDGE AND ACCEPT THE RISK THAT YOU MAY MISTAKENLY INTERACT WITH THOSE OR OTHER TOKENS. YOU FURTHER ACKNOWLEDGE THAT WE ARE NOT RESPONSIBLE FOR ANY OF THE VARIABLES OR RISKS DESCRIBED IN THESE TERMS. YOU UNDERSTAND AND AGREE TO ASSUME FULL RESPONSIBILITY FOR ALL OF THE RISKS OF ACCESSING AND USING PRYSM. YOU ARE SOLELY RESPONSIBLE FOR YOUR WALLETS, FOR SAFEGUARDING THE ASSOCIATED PRIVATE KEY AND FOR ANY ACTIVITY THAT OCCURS USING YOUR WALLET. WITHOUT LIMITING THE FOREGOING, YOU ALSO UNDERSTAND THAT THERE MAY BE TAX AND REGULATORY RISKS RELATED TO USING PRYSM. IT IS YOUR SOLE RESPONSIBILITY TO DETERMINE WHETHER, AND TO WHAT EXTENT, ANY TAXES APPLY TO ANY TRANSACTIONS YOU CONDUCT IN CONNECTION WITH YOUR USE OF PRYSM, AND TO WITHHOLD, COLLECT, REPORT AND REMIT THE CORRECT AMOUNTS OF TAXES TO THE APPROPRIATE TAX AUTHORITIES. DIGITAL ASSETS, BLOCKCHAIN TECHNOLOGY, AND ANY RELATED SOFTWARE AND SERVICES ARE ALSO SUBJECT TO LEGAL AND REGULATORY UNCERTAINTY IN THE UNITED STATES AND OTHER JURISDICTIONS. YOU UNDERSTAND THAT LEGISLATIVE AND REGULATORY CHANGES OR ACTIONS MAY ADVERSELY AFFECT THE USAGE, TRANSFERABILITY, TRANSACTABILITY AND ACCESSIBILITY RELATED TO PRYSM.
### Warranty Disclaimer
PRYSM IS PROVIDED ON AN “AS-IS” BASIS AND MAY INCLUDE ERRORS, OMISSIONS, OR OTHER INACCURACIES. PRYSMATIC LABS AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT PRYSM FOR ANY PURPOSE, AND HEREBY EXPRESSLY DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT OR ANY OTHER IMPLIED WARRANTY UNDER THE UNIFORM COMPUTER INFORMATION TRANSACTIONS ACT AS ENACTED BY ANY STATE. WE ALSO MAKE NO REPRESENTATIONS OR WARRANTIES THAT PRYSM WILL OPERATE ERROR-FREE, UNINTERRUPTED, OR IN A MANNER THAT WILL MEET YOUR REQUIREMENTS AND/OR NEEDS. THEREFORE, YOU ASSUME THE ENTIRE RISK REGARDING THE QUALITY AND/OR PERFORMANCE OF PRYSM AND ANY TRANSACTIONS ENTERED INTO THEREON.
We make no claims that Prysm is appropriate or permitted for use in any specific jurisdiction. Access to Prysm may not be legal by certain persons or in certain jurisdictions or countries. If you access Prysm, you do so on your own initiative and are responsible for compliance with all Applicable Law (as defined below), including, without limitation, for the avoidance of doubt, local laws.
### Limitation of Liability
In no event will Prysmatic Labs or any of its contributors be liable, whether in contract, warranty, tort (including negligence, whether active, passive or imputed), product liability, strict liability or other theory, breach of statutory duty or otherwise arising out of, or in connection with, your use of Prysm, for any direct, indirect, incidental, special or consequential damages (including any loss of profits or data, business interruption or other pecuniary loss, or damage, loss or other compromise of data, in each case whether direct, indirect, incidental, special or consequential) arising out of use Prysm, even if we or other users have been advised of the possibility of such damages. The foregoing limitations and disclaimers shall apply to the maximum extent permitted by applicable law, even if any remedy fails of its essential purpose. You acknowledge and agree that the limitations of liability afforded us hereunder constitute a material and actual inducement and condition to entering into these Terms, and are reasonable, fair and equitable in scope to protect our legitimate interests in light of the fact that we are not receiving consideration from you for providing Prysm.
Some Internet plans will charge additional amounts for bandwidth or any excess upload bandwidth used that isn’t included in the plan and may terminate your connection without warning because of overuse. We advise that you check whether your Internet connection is subjected to any such limitations and monitor your bandwidth use and upload volumes.
### Indemnification
To the maximum extent permitted by law, you will defend, indemnify and hold Prysmatic Labs and its contributors harmless from and against any and all claims, actions, suits, investigations, or proceedings by any third party (including any party or purported party to or beneficiary or purported beneficiary of any transaction on Prysm), as well as any and all losses, liabilities,
damages, costs, and expenses (including reasonable attorneys’ fees) arising out of, accruing from, or in any way related to (i) your breach of the terms of this Agreement, (ii) any transaction, or the failure to occur of any transaction on Prysm, and (iii) your negligence, fraud, or willful misconduct.
## Warranty Disclaimer
### Compliance with Laws and Tax Obligations
Your use of Prysm is subject to all applicable laws of any governmental authority, including, without limitation, federal, state and foreign securities laws, tax laws, tariff and trade laws, ordinances, judgments, decrees, injunctions, writs and orders or like actions of any governmental authority and rules, regulations, orders, interpretations, licenses, and permits of any federal,
regional, state, county, municipal or other governmental authority and you agree to comply with all such laws in your use of Prysm. The users of Prysm are solely responsible to determinate what, if any, taxes apply to their ETH transactions. The owners of, or contributors to, Prysm are not responsible for determining the taxes that apply to ETH transactions.
PRYSM IS PROVIDED ON AN “AS-IS” BASIS AND MAY INCLUDE ERRORS, OMISSIONS, OR OTHER INACCURACIES. WITHOUT LIMITING ANYTHING SET FORTH ELSEWHERE IN THESE TERMS, OFFCHAIN LABS AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT PRYSM FOR ANY PURPOSE, AND HEREBY EXPRESSLY DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT OR ANY OTHER IMPLIED WARRANTY UNDER THE UNIFORM COMPUTER INFORMATION TRANSACTIONS ACT AS ENACTED BY ANY STATE OR OTHER GOVERNMENTAL AUTHORITY. WE ALSO MAKE NO REPRESENTATIONS OR WARRANTIES THAT PRYSM WILL OPERATE ERROR-FREE, UNINTERRUPTED, OR IN A MANNER THAT WILL MEET YOUR REQUIREMENTS AND/OR NEEDS. THEREFORE, YOU ASSUME THE ENTIRE RISK REGARDING THE QUALITY AND/OR PERFORMANCE OF PRYSM AND ANY TRANSACTIONS ENTERED INTO THEREON.
### Miscellaneous
These Terms will be construed and enforced in accordance with the laws of the state of Illinois as applied to agreements entered into and completely performed in Illinois. You agree to the personal jurisdiction by and venue in Illinois and waive any objection to such jurisdiction or venue.
## Limitation of Liability
We reserve the right to revise these Terms, and your rights and obligations are at all times subject to the then-current Terms provided on Prysm. Your continued use of Prysm constitutes acceptance of such revised Terms.
IN NO EVENT WILL OFFCHAIN LABS OR ANY OF ITS AFFILIATES OR ITS OR ANY SUCH AFFILIATE’S DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, OR REPRESENTATIVES OR ANY CONTRIBUTORS (COLLECTIVELY, THE “OCL PARTIES”) BE LIABLE, WHETHER IN CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE, WHETHER ACTIVE, PASSIVE OR IMPUTED), PRODUCT LIABILITY, STRICT LIABILITY OR OTHER THEORY, BREACH OF STATUTORY DUTY OR OTHERWISE ARISING OUT OF, OR IN CONNECTION WITH, YOUR USE OF PRYSM, FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING ANY LOSS OF PROFITS OR DATA, BUSINESS INTERRUPTION OR OTHER PECUNIARY LOSS, OR DAMAGE, LOSS OR OTHER COMPROMISE OF DATA, IN EACH CASE WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL) ARISING OUT OF USE PRYSM, EVEN IF WE OR OTHER USERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. The foregoing limitations and disclaimers shall apply to the maximum extent permitted by Applicable Law, even if any remedy fails of its essential purpose. You acknowledge and agree that the limitations of liability afforded us hereunder constitute a material and actual inducement and condition to entering into these Terms, and are reasonable, fair and equitable in scope to protect our legitimate interests in light of the fact that we are not receiving consideration from you for providing Prysm.
These Terms constitute the entire agreement between you and Prysmatic Labs regarding use of Prysm and will supersede all prior agreements whether, written or oral. No usage of trade or other regular practice or method of dealing between the parties will be used to modify, interpret, supplement, or alter the terms of these Terms.
## Indemnification
To the maximum extent permitted by Applicable Law, you will defend, indemnify and hold each OCL Party harmless from and against any and all claims, actions, suits, investigations, or proceedings by any third party (including any party or purported party to or beneficiary or purported beneficiary of any transaction or other activity on Prysm), as well as any and all losses, liabilities, damages, costs, and expenses (including reasonable attorneys’ fees and costs) arising out of, accruing from, or in any way related to (i) your breach of the terms of this Agreement, (ii) any transaction, or the failure to occur of any transaction on Prysm, and (iii) your negligence, fraud, or willful misconduct.
## Compliance with Laws
Your use of Prysm is subject to all applicable laws of any governmental authority, including, without limitation, federal, state and foreign securities laws, tax laws, tariff and trade laws, ordinances, judgments, decrees, injunctions, writs and orders or like actions of any governmental authority and rules, regulations, orders, interpretations, licenses, and permits of any federal, regional, state, county, municipal or other governmental authority (collectively, “Applicable Law”) and you agree to comply with all such Applicable Law in your use of Prysm. The users of Prysm are solely responsible to determinate what, if any, taxes apply to their ETH transactions. The owners of, or contributors to, Prysm are not responsible for determining the taxes that apply to ETH transactions.
## Miscellaneous
These Terms will be governed by the laws of the State of Delaware without regard to its conflict of law provisions. With respect to any disputes or claims not subject to arbitration, as set forth in the OCL Terms of Use, you and Offchain Labs submit to the personal and exclusive jurisdiction of the state and federal courts located within New York, New York and waive any objection to such jurisdiction and venue. The failure of Offchain Labs to exercise or enforce any right or provision of these Terms will not constitute a waiver of such right or provision.
We reserve the right to revise these Terms, and your rights and obligations are at all times subject to the then-current Terms provided on Prysm. Your use of Prysm following any such revision to these Terms constitutes acceptance of such revised Terms.
These Terms constitute the entire agreement between you and Offchain Labs regarding use of Prysm and will supersede all prior agreements whether, written or oral. No usage of trade or other regular practice or method of dealing between the parties will be used to modify, interpret, supplement, or alter the terms of these Terms.
If any portion of these Terms is held invalid or unenforceable, such invalidity or enforceability will not affect the other provisions of these Terms, which will remain in full force and effect, and the invalid or unenforceable portion will be given effect to the greatest extent possible. The failure of a party to require performance of any provision will not affect that party’s right to require performance at any time thereafter, nor will a waiver of any breach or default of these Terms or any provision of these Terms constitute a waiver of any subsequent breach or default or a waiver of the provision itself.
If any portion of these Terms is held invalid or unenforceable, such invalidity or enforceability will not affect the other provisions of these Terms, which will remain in full force and effect, and the invalid or unenforceable portion will be given effect to the greatest extent possible. The failure of a party to require performance of any provision will not affect that party’s right to require performance at any time thereafter, nor will a waiver of any breach or default of these Terms or any provision of these Terms constitute a waiver of any subsequent breach or default or a waiver of the provision itself.
// ErrNotOK is used to indicate when an HTTP request to the Beacon Node API failed with any non-2xx response code.
// More specific errors may be returned, but an error in reaction to a non-2xx response will always wrap ErrNotOK.
varErrNotOK=errors.New("did not receive 2xx response from API")
varErrNotOK=errors.New("did not receive 200 response from API")
// ErrNotFound specifically means that a '404 - NOT FOUND' response was received from the API.
varErrNotFound=errors.Wrap(ErrNotOK,"recv 404 NotFound response from API")
// ErrBadRequest specifically means that a '400 - BAD REQUEST' response was received from the API.
varErrBadRequest=errors.Wrap(ErrNotOK,"recv 400 BadRequest response from API")
// ErrNoContent specifically means that a '204 - No Content' response was received from the API.
// Typically, a 204 is a success but in this case for the Header API means No header is available
varErrNoContent=errors.New("recv 204 no content response from API, No header is available")
// ErrUnsupportedMediaType specifically means that a '415 - Unsupported Media Type' was received from the API.
varErrUnsupportedMediaType=errors.Wrap(ErrNotOK,"The media type in \"Content-Type\" header is unsupported, and the request has been rejected. This occurs when a HTTP request supplies a payload in a content-type that the server is not able to handle.")
// ErrNotAcceptable specifically means that a '406 - Not Acceptable' was received from the API.
varErrNotAcceptable=errors.Wrap(ErrNotOK,"The accept header value is not acceptable")
varErrBadGateway=errors.Wrap(ErrNotOK,"recv 502 BadGateway response from API")
// ExecPayloadResponseDeneb the response to the build API /eth/v1/builder/blinded_blocks that includes the version, execution payload object , and blobs bundle object.
assert.ErrorContains(t,"invalid token value provided",err)
}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.