* 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>
* 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>
* 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>
* 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
* `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>
* 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>
* 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>
* replace eth2 types
* replace protos
* regen proto
* replace
* gaz
* deps
* amend
* regen proto
* mod
* gaz
* gaz
* ensure build
* ssz
* add dep
* no more eth2 types
* no more eth2
* remg
* all builds
* buidl
* tidy
* clean
* fmt
* val serv
* gaz
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Add static analysis for unsafe uint casting
* Fix violations of uintcast
* go mod tidy
* Add exclusion to nogo for darwin build
* Add test for math.Int
* Move some things to const so they are assured not to exceed int64
* Self review
* lint
* fix tests
* fix test
* Add init check for non 64 bit OS
* Move new deps from WORKSPACE to deps.bzl
* fix bazel build for go analysis runs
* Update BUILD.bazel
Remove TODO
* add math.AddInt method
* Add new test casts
* Add case where builtin functions and declared functions are covered
* Fix new findings
* cleanup
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Remove gogoproto compiler
* Remove more gogoproto
* Improvements
* Fix gengo
* More scripts
* Gazelle, fix deps
* Fix version and errors
* Fix gocast for arrays
* Fix ethapis
* Fixes
* Fix compile errors
* fix go.mod
* //proto/... builds
* Update for protov2
* temp fix compilation to move on
* Change everything to emptypb.empty
* Add grpc to proto/slashings
* Fix almost all build failures
* Oher build problems
* FIX THIS FUCKING THING
* gaz literally every .bazel
* Final touches
* Final final touches
* Fix proto
* Begin moving proto.Marshal to native
* Fix site_data
* Fixes
* Fix duplicate gateway
* Fix gateway target
* Fix ethapis
* Fixes from review
* Update
* Fix
* Fix status test
* Fix fuzz
* Add isprotoslice to fun
* Change DeepEqual to DeepSSZEqual for proto arrays
* Fix build
* Fix gaz
* Update go
* Fixes
* Fixes
* Add case for nil validators after copy
* Fix cast
* Fix test
* Fix imports
* Go mod
* Only use extension where needed
* Fixes
* Split gateway from gengo
* gaz
* go mod
* Add back hydrated state
* fix hydrate
* Fix proto.clone
* Fies
* Revert "Split gateway from gengo"
This reverts commit 7298bb2054.
* Revert "gaz"
This reverts commit ca95256570.
* Merge all gateway into one target
* go mod
* Gaz
* Add generate v1_gateway files
* run pb again
* goimports
* gaz
* Fix comments
* Fix protos
* Fix PR
* Fix protos
* Update grpc-gateway and ethapis
* Update ethapis and gen-go-cast
* Go tidy
* Reorder
* Fix ethapis
* fix spec tests
* Fix script
* Remove unused import
* Fix fuzz
* Fix gomod
* Update version
* Error if the cloned result is nil
* Handle optional slots
* ADd more empty checks to clone
* Undo fuzz changes
* Fix build.bazel
* Gaz
* Redo fuzz changes
* Undo some eth1data changes
* Update go.mod
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Undo clone beacon state
* Remove gogo proto more and unused v1_gateway
* Add manual fix for nil vals
* Fix gaz
* tidy
* Tidy again
* Add detailed error
* Revert "Add detailed error"
This reverts commit 59bc053dcd.
* Undo varint changes
* Fix nil validators in deposit test
* Commit
* Undo
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>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
* clean up
* name
* comment
* change back
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>