prysm-pulse/beacon-chain
Manu NALEPA 65f71b3a48
P2P: Simplify code (#13719)
* `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>
2024-03-15 11:08:19 +00:00
..
blockchain only update head at 10 seconds when validating (#13570) 2024-03-12 15:11:40 +00:00
builder Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
cache only update head at 10 seconds when validating (#13570) 2024-03-12 15:11:40 +00:00
core Compute unrealized checkpoints with pcli (#13692) 2024-03-12 15:03:21 +00:00
das Remove unused deneb code (#13712) 2024-03-09 00:12:26 +00:00
db Remove unused deneb code (#13712) 2024-03-09 00:12:26 +00:00
deterministic-genesis Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
execution chore(execution): Clean up unreachable code; use new(big.Int) instead of big.NewInt(0) (#13715) 2024-03-11 00:31:55 +00:00
forkchoice Do not check parent weight on early FCU (#13683) 2024-03-05 15:07:39 +00:00
gateway move setting route handlers to registration from start (#13676) 2024-02-28 11:30:31 +00:00
monitor Unify log fields (#13654) 2024-02-22 22:40:36 +00:00
node P2P: Simplify code (#13719) 2024-03-15 11:08:19 +00:00
operations Unify log fields (#13654) 2024-02-22 22:40:36 +00:00
p2p P2P: Simplify code (#13719) 2024-03-15 11:08:19 +00:00
package Update cross compile toolchains (#12069) 2023-03-07 20:09:46 +00:00
rpc replace receive slot with event stream (#13563) 2024-03-13 13:01:05 +00:00
slasher Slasher: Reduce surrounding/surrounded attestations processing time (#13629) 2024-02-21 15:12:37 +00:00
startup Update to V5 (#13622) 2024-02-15 05:46:47 +00:00
state Check Unrealized Justification Balances In Spectests (#13710) 2024-03-08 14:49:34 +00:00
sync P2P: Simplify code (#13719) 2024-03-15 11:08:19 +00:00
verification Blob verification spectest (#13707) 2024-03-08 18:20:38 +00:00
README.md Change Eth2 Repository Names (#9425) 2021-08-19 13:00:57 -05:00

Prysmatic Labs Beacon Chain Implementation

This is the main project folder for the beacon chain implementation of Ethereum written in Go by Prysmatic Labs.

You can also read our main README and join our active chat room on Discord.

Discord

Also, read the official beacon chain specification, this design spec serves as a source of truth for the beacon chain implementation we follow at Prysmatic Labs.