mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
[3/5] light client events (#13225)
* add http streaming light client events * expose ForkChoiceStore * return error in insertFinalizedDeposits * send light client updates * Revert "return error in insertFinalizedDeposits" This reverts commit f7068663b8c8b3a3bf45950d5258011a5e4d803e. * fix: lint * fix: patch the wrong error response * refactor: rename the JSON structs * fix: LC finalized stream return correct format * fix: LC op stream return correct JSON format * fix: omit nil JSON fields * chore: gazzle * fix: make update by range return list directly based on spec * chore: remove unneccessary json annotations * chore: adjust comments * feat: introduce EnableLightClientEvents feature flag * feat: use enable-lightclient-events flag * chore: more logging details * chore: fix rebase errors * chore: adjust data structure to save mem * Update beacon-chain/blockchain/process_block.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * refactor: rename config EnableLightClient * refactor: rename feature flag * refactor: move helper functions to helper pkg * test: fix broken unit tests --------- Co-authored-by: Nicolás Pernas Maradei <nicolas@polymerlabs.org> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -23,10 +23,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/cmd"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/cmd"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
)
|
||||
|
||||
var log = logrus.WithField("prefix", "flags")
|
||||
@@ -40,6 +41,7 @@ type Flags struct {
|
||||
EnableExperimentalState bool // EnableExperimentalState turns on the latest and greatest (but potentially unstable) changes to the beacon state.
|
||||
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
|
||||
EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p.
|
||||
EnableLightClient bool // EnableLightClient enables light client APIs.
|
||||
WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup.
|
||||
EnableDoppelGanger bool // EnableDoppelGanger enables doppelganger protection on startup for the validator.
|
||||
EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space
|
||||
@@ -237,6 +239,10 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
|
||||
logEnabled(EnableEIP4881)
|
||||
cfg.EnableEIP4881 = true
|
||||
}
|
||||
if ctx.IsSet(EnableLightClient.Name) {
|
||||
logEnabled(EnableLightClient)
|
||||
cfg.EnableLightClient = true
|
||||
}
|
||||
cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value}
|
||||
Init(cfg)
|
||||
return nil
|
||||
|
||||
@@ -140,6 +140,10 @@ var (
|
||||
Name: "enable-eip-4881",
|
||||
Usage: "Enables the deposit tree specified in EIP-4881.",
|
||||
}
|
||||
EnableLightClient = &cli.BoolFlag{
|
||||
Name: "enable-lightclient",
|
||||
Usage: "Enables the light client support in the beacon node",
|
||||
}
|
||||
disableResourceManager = &cli.BoolFlag{
|
||||
Name: "disable-resource-manager",
|
||||
Usage: "Disables running the libp2p resource manager.",
|
||||
@@ -204,6 +208,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
|
||||
EnableEIP4881,
|
||||
disableResourceManager,
|
||||
DisableRegistrationCache,
|
||||
EnableLightClient,
|
||||
}...)...)
|
||||
|
||||
// E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E.
|
||||
|
||||
Reference in New Issue
Block a user