Files
prysm/cmd/beacon-chain/usage.go
james-prysm 74c8a25354 adding semi-supernode feature (#16029)
<!-- 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>
2025-11-26 15:31:15 +00:00

255 lines
6.5 KiB
Go

// This code was adapted from https://github.com/ethereum/go-ethereum/blob/master/cmd/geth/usage.go
package main
import (
"io"
"sort"
"github.com/OffchainLabs/prysm/v7/cmd"
"github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/flags"
"github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/genesis"
"github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/storage"
backfill "github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/sync/backfill/flags"
"github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/sync/checkpoint"
"github.com/OffchainLabs/prysm/v7/config/features"
"github.com/OffchainLabs/prysm/v7/runtime/debug"
"github.com/urfave/cli/v2"
)
var appHelpTemplate = `NAME:
{{.App.Name}} - {{.App.Usage}}
USAGE:
{{.App.HelpName}} [options]{{if .App.Commands}} command [command options]{{end}} {{if .App.ArgsUsage}}{{.App.ArgsUsage}}{{else}}[arguments...]{{end}}
{{if .App.Version}}
AUTHOR:
{{range .App.Authors}}{{ . }}{{end}}
{{end}}{{if .App.Commands}}
GLOBAL OPTIONS:
{{range .App.Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}{{end}}{{if .FlagGroups}}
{{range .FlagGroups}}{{.Name}} OPTIONS:
{{range .Flags}}{{.}}
{{end}}
{{end}}{{end}}{{if .App.Copyright }}
COPYRIGHT:
{{.App.Copyright}}
VERSION:
{{.App.Version}}
{{end}}{{if len .App.Authors}}
{{end}}
`
type flagGroup struct {
Name string
Flags []cli.Flag
}
var appHelpFlagGroups = []flagGroup{
{ // Flags relevant to running the process.
Name: "cmd",
Flags: []cli.Flag{
cmd.AcceptTosFlag,
cmd.ConfigFileFlag,
},
},
{ // Flags relevant to configuring the beacon chain and APIs.
Name: "beacon-chain",
Flags: []cli.Flag{
cmd.ApiTimeoutFlag,
cmd.ChainConfigFileFlag,
cmd.E2EConfigFlag,
cmd.GrpcMaxCallRecvMsgSizeFlag,
cmd.MinimalConfigFlag,
cmd.RPCMaxPageSizeFlag,
flags.CertFlag,
flags.ChainID,
flags.DisableDebugRPCEndpoints,
flags.HTTPModules,
flags.HTTPServerCorsDomain,
flags.HTTPServerHost,
flags.HTTPServerPort,
flags.KeyFlag,
flags.NetworkID,
flags.RPCHost,
flags.RPCPort,
flags.BatchVerifierLimit,
},
},
{
// p2p flags configure the p2p side of beacon-chain.
Name: "p2p",
Flags: []cli.Flag{
cmd.BootstrapNode,
cmd.EnableUPnPFlag,
cmd.NoDiscovery,
cmd.P2PAllowList,
cmd.P2PDenyList,
cmd.P2PColocationWhitelist,
cmd.P2PHost,
cmd.P2PHostDNS,
cmd.P2PIP,
cmd.P2PMaxPeers,
cmd.P2PPrivKey,
cmd.P2PQUICPort,
cmd.P2PStaticID,
cmd.P2PTCPPort,
cmd.P2PUDPPort,
cmd.PubsubQueueSize,
cmd.RelayNode,
cmd.StaticPeers,
flags.BlobBatchLimit,
flags.BlobBatchLimitBurstFactor,
flags.DataColumnBatchLimit,
flags.DataColumnBatchLimitBurstFactor,
flags.BlockBatchLimit,
flags.BlockBatchLimitBurstFactor,
flags.MaxConcurrentDials,
flags.MinPeersPerSubnet,
flags.MinSyncPeers,
flags.SubscribeToAllSubnets,
flags.Supernode,
flags.SemiSupernode,
},
},
{ // Flags relevant to storing data on disk and configuring the beacon chain database.
Name: "db",
Flags: []cli.Flag{
backfill.BackfillBatchSize,
backfill.BackfillOldestSlot,
backfill.BackfillWorkerCount,
backfill.EnableExperimentalBackfill,
cmd.ClearDB,
cmd.DataDirFlag,
cmd.ForceClearDB,
cmd.RestoreSourceFileFlag,
cmd.RestoreTargetDirFlag,
flags.BeaconDBPruning,
flags.PrunerRetentionEpochs,
flags.SlotsPerArchivedPoint,
storage.BlobRetentionEpochFlag,
storage.BlobStorageLayout,
storage.BlobStoragePathFlag,
storage.DataColumnStoragePathFlag,
},
},
{ // Flags relevant to configuring local block production or external builders such as mev-boost.
Name: "builder",
Flags: []cli.Flag{
flags.LocalBlockValueBoost,
flags.MaxBuilderConsecutiveMissedSlots,
flags.MaxBuilderEpochMissedSlots,
flags.MevRelayEndpoint,
flags.MinBuilderBid,
flags.MinBuilderDiff,
flags.SuggestedFeeRecipient,
flags.EnableBuilderSSZ,
},
},
{ // Flags relevant to syncing the beacon chain.
Name: "sync",
Flags: []cli.Flag{
checkpoint.BlockPath,
checkpoint.RemoteURL,
checkpoint.StatePath,
flags.WeakSubjectivityCheckpoint,
genesis.BeaconAPIURL,
genesis.StatePath,
},
},
{ // Flags relevant to interacting with the execution layer.
Name: "execution layer",
Flags: []cli.Flag{
flags.ContractDeploymentBlock,
flags.DepositContractFlag,
flags.EngineEndpointTimeoutSeconds,
flags.Eth1HeaderReqLimit,
flags.ExecutionEngineEndpoint,
flags.ExecutionEngineHeaders,
flags.ExecutionJWTSecretFlag,
flags.JwtId,
flags.InteropMockEth1DataVotesFlag,
},
},
{ // Flags relevant to configuring beacon chain monitoring.
Name: "monitoring",
Flags: []cli.Flag{
cmd.DisableMonitoringFlag,
cmd.EnableTracingFlag,
cmd.MonitoringHostFlag,
cmd.TraceSampleFractionFlag,
cmd.TracingEndpointFlag,
cmd.TracingProcessNameFlag,
cmd.ValidatorMonitorIndicesFlag,
flags.MonitoringPortFlag,
},
},
{ // Flags relevant to slasher operation.
Name: "slasher",
Flags: []cli.Flag{
flags.HistoricalSlasherNode,
flags.SlasherDirFlag,
flags.SlasherFlag,
},
},
{
// Flags in the "log" section control how Prysm handles logging.
Name: "log",
Flags: []cli.Flag{
cmd.LogFormat,
cmd.LogFileName,
cmd.VerbosityFlag,
},
},
{ // Feature flags.
Name: "features",
Flags: features.ActiveFlags(features.BeaconChainFlags),
},
{ // Flags required to configure the merge.
Name: "merge",
Flags: []cli.Flag{
flags.TerminalTotalDifficultyOverride,
flags.TerminalBlockHashOverride,
flags.TerminalBlockHashActivationEpochOverride,
},
},
{ // The deprecated section represents beacon flags that still have use, but should not be used
// as they are expected to be deleted in a feature release.
Name: "deprecated",
Flags: []cli.Flag{},
},
{ // Flags used in debugging Prysm. These are flags not usually run by end users.
Name: "debug",
Flags: []cli.Flag{
cmd.MaxGoroutines,
debug.BlockProfileRateFlag,
debug.MemProfileRateFlag,
debug.MutexProfileFractionFlag,
debug.PProfAddrFlag,
debug.PProfFlag,
debug.PProfPortFlag,
flags.SetGCPercent,
},
},
}
func init() {
cli.AppHelpTemplate = appHelpTemplate
type helpData struct {
App any
FlagGroups []flagGroup
}
originalHelpPrinter := cli.HelpPrinter
cli.HelpPrinter = func(w io.Writer, tmpl string, data any) {
if tmpl == appHelpTemplate {
for _, group := range appHelpFlagGroups {
sort.Sort(cli.FlagsByName(group.Flags))
}
originalHelpPrinter(w, tmpl, helpData{data, appHelpFlagGroups})
} else {
originalHelpPrinter(w, tmpl, data)
}
}
}