Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement PeerDAS #14129

Draft
wants to merge 112 commits into
base: develop
Choose a base branch
from
Draft

Implement PeerDAS #14129

wants to merge 112 commits into from

Conversation

nalepae
Copy link
Contributor

@nalepae nalepae commented Jun 21, 2024

Reading:

Peerdas from scratch

Remaining tasks:

  • Initial sync: Backfill data columns when starting from a checkpoint.
  • Validator custody: Implement, and specially implement the backfill. (In progress @nalepae)
  • Chaos testing: Indroduce a nasty peer flag that holds AND/OR (both are important) alterate data columns on RPC responses. (In progress 0xPC02)
  • Unit tests: Add them where they are not yet added.
  • KZG library: Replace the cKZG library by the goKZGone. (In progress @nalepae @kevaundray)
  • Metrics: Add PeerDAS specific metrics In progress (@KatyaRyazantseva)
  • Req/Resp: Ensure we Req / Resp (by root and by range) everywhere using not only super nodes. ( GetValidCustodyPeers)
  • prysmctl: Implement byRoot and byRange data columns requests
  • ENR (not peerDAS related) Find why sometimes ENR records are not correctly updated via discovery.
  • getBlobV1: Implement reconstructAndBroadcastBlobs for data columns.
  • Memory leak: Find it.

Remaining open questions:

  • Initial sync: Should we request max 64 columns and the reconstruct instead of requesting > 64 columns when needed?
  • ENR: Are we sure the sequence number cannot go backward after a reboot? (This trigs downscoring on Prysm.)
  • Subnet subscription (not peerDAS related): Should we subscribe to subnets / find peers 1 epoch in advance for getSubnetsToSubscribe and getSubnetsToFindPeersOnly?
  • Subnet unsubscription (not peerDAS related): Handle the same way dynamic (fork epoch) and non dynamic (fork epoch + 1) unsubscriptions.
  • Peer ban: What happens if a peer announces less custody groups via Metadata/ENR than the minimal requirement? Ban?

nalepae and others added 11 commits November 27, 2024 10:11
* Add Support For Discovery Of Column Subnets

* Lint for SubnetsPerNode

* Manu's Review

* Change to a better name
* Add Data Column Subscriber

* Add Data Column Vaidator

* Wire all Handlers In

* Fix Build

* Fix Test

* Fix IP in Test

* Fix IP in Test
* Add RPC Handler

* Add Column Requests

* Update beacon-chain/db/filesystem/blob.go

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

* Update beacon-chain/p2p/rpc_topic_mappings.go

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

* Manu's Review

* Manu's Review

* Interface Fixes

* mock manager

---------

Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Bump `c-kzg-4844` lib to the `das` branch.

* Implement `MerkleProofKZGCommitments`.

* Implement `das-core.md`.

* Use `peerdas.CustodyColumnSubnets` and `peerdas.CustodyColumns`.

* `CustodyColumnSubnets`: Include `i` in the for loop.

* Remove `computeSubscribedColumnSubnet`.

* Remove `peerdas.CustodyColumns` out of the for loop.
* Remove capital letter from error messages.

* `[4]byte` => `[fieldparams.VersionLength]byte`.

* Prometheus: Remove extra `committee`.

They are probably due to a bad copy/paste.

Note: The name of the probe itself is remaining,
to ensure backward compatibility.

* Implement Proposer RPC for data columns.

* Fix TestProposer_ProposeBlock_OK test.

* Remove default peerDAS activation.

* `validateDataColumn`: Workaround to return a `VerifiedRODataColumn`
* Add new DA check

* Exit early in the event no commitments exist.

* Gazelle

* Fix Mock Broadcaster

* Fix Test Setup

* Update beacon-chain/blockchain/process_block.go

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

* Manu's Review

* Fix Build

---------

Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update `consensus_spec_version` to `v1.5.0-alpha.1`.

* `CustodyColumns`: Fix and implement spec tests.

* Make deepsource happy.

* `^uint64(0)` => `math.MaxUint64`.

* Fix `TestLoadConfigFile` test.
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.
@nalepae nalepae force-pushed the peerDAS branch 3 times, most recently from 30a32c4 to d7d370e Compare January 16, 2025 08:54
KatyaRyazantseva and others added 11 commits January 21, 2025 16:14
Previously, `buildBwbSlices` were built, and then only to big requests were batched in `buildDataColumnSidecarsByRangeRequests`.

In some edge cases, this lead to requesting data columns to peers for blocks with no blobs.

Splitting by batch directly in `buildBwbSlices` fixes the issue.
* `TestBuildBwbSlices`: Add test case failing with the current implementation.

* Fix `buildBwbSlices` to comply with the new test case.

* `block_fetchers.go`: Improve logging and godoc.

* `DataColumnsRPCMinValidSlot`: Update to Fulu.
* `areDataColumnsAvailable`: `signed` ==> `signedBlock`.

* peerdas: Split `helpers.go` in multiple files respecting the specification.

* peerDAS: Implement `Info`.

* peerDAS: Use cached `Info` when possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Blocked by research or external factors peerDAS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants