Skip to content

Commit

Permalink
stage workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
olegshmuelov committed Oct 28, 2024
1 parent 662f423 commit 41c829e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cli/operator/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ func setupGlobal() (*zap.Logger, error) {
return nil, fmt.Errorf("could not read share config: %w", err)
}
}
cfg.SSVOptions.ValidatorOptions.BuilderProposals = true

err := logging.SetGlobalLogger(
cfg.LogLevel,
Expand Down Expand Up @@ -439,6 +440,7 @@ func setupDB(logger *zap.Logger, eth2Network beaconprotocol.Network) (*kv.Badger
return errors.Wrap(err, "failed to reopen db")
}

cfg.DBOptions.Path = "./data/db-main-on-stage"
migrationOpts := migrations.Options{
Db: db,
DbPath: cfg.DBOptions.Path,
Expand Down
3 changes: 2 additions & 1 deletion network/discovery/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func WithUnhandled(unhandled chan<- discover.ReadPacket) func(config *discover.C
// DiscV5Cfg creates discv5 config from the options
func (opts *DiscV5Options) DiscV5Cfg(logger *zap.Logger, funcOpts ...func(config *discover.Config)) (*discover.Config, error) {
dv5Cfg := &discover.Config{
PrivateKey: opts.NetworkKey,
PrivateKey: opts.NetworkKey,
V5ProtocolID: &DefaultSSVProtocolID,
}

for _, fn := range funcOpts {
Expand Down
6 changes: 6 additions & 0 deletions network/peers/connections/conn_gater.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ func (n *connGater) InterceptAddrDial(id peer.ID, multiaddr ma.Multiaddr) bool {
return true
}

// TODO: REVERT!
const DISABLE_IP_RATE_LIMIT = true

// InterceptAccept is called as soon as a transport listener receives an
// inbound connection request, before any upgrade takes place. Transports who
// accept already secure and/or multiplexed connections (e.g. possibly QUIC)
// MUST call this method regardless, for correctness/consistency.
func (n *connGater) InterceptAccept(multiaddrs libp2pnetwork.ConnMultiaddrs) bool {
if DISABLE_IP_RATE_LIMIT {
return true
}
remoteAddr := multiaddrs.RemoteMultiaddr()
if !n.validateDial(remoteAddr) {
// Yield this goroutine to allow others to run in-between connection attempts.
Expand Down
6 changes: 4 additions & 2 deletions network/topics/params/peer_score.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ const (
appSpecificWeight = 0

// P6
ipColocationFactorThreshold = 10
// TODO: REVERT!
ipColocationFactorThreshold = 1000
ipColocationFactorWeight = -topicScoreCap

// P7
behaviourPenaltyThreshold = 6
behaviourPenaltyThreshold = 60000 // TODO: revert
)

// PeerScoreThresholds returns the thresholds to use for peer scoring
Expand All @@ -56,6 +57,7 @@ func PeerScoreParams(oneEpoch, msgIDCacheTTL time.Duration, ipWhilelist ...*net.
targetVal, _ := decayConvergence(behaviourPenaltyDecay, maxAllowedRatePerDecayInterval)
targetVal = targetVal - behaviourPenaltyThreshold
behaviourPenaltyWeight := gossipThreshold / (targetVal * targetVal)

Check failure on line 59 in network/topics/params/peer_score.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to behaviourPenaltyWeight (ineffassign)
behaviourPenaltyWeight = 0 // TODO: revert

return &pubsub.PeerScoreParams{
Topics: make(map[string]*pubsub.TopicScoreParams),
Expand Down
6 changes: 5 additions & 1 deletion networkconfig/holesky-stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ var HoleskyStage = NetworkConfig{
RegistrySyncOffset: new(big.Int).SetInt64(84599),
RegistryContractAddr: "0x0d33801785340072C452b994496B19f196b7eE15",
Bootnodes: []string{
"enr:-Li4QPnPGESWx2wnu3s2qeu6keFbkaV2M0ZiGHgxxGI9ThP4XSgSaFzl6zYsF1zAdni3Mh04iA6BEZqoC6LZ52UFnwKGAYxEgLqeh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhDQiKqmJc2VjcDI1NmsxoQP2e508AoA0B-KH-IaAd3nVCfI9q16lNztV-oTpcH72tIN0Y3CCE4mDdWRwgg-h",
// Public bootnode:
// "enr:-Ja4QDYHVgUs9NvlMqq93ot6VNqbmrIlMrwKnq4X3DPRgyUNB4ospDp8ubMvsf-KsgqY8rzpZKy4GbE1DLphabpRBc-GAY_diLjngmlkgnY0gmlwhDQrLYqJc2VjcDI1NmsxoQKnAiuSlgSR8asjCH0aYoVKM8uPbi4noFuFHZHaAHqknYNzc3YBg3RjcIITiYN1ZHCCD6E",

// Private bootnode:
"enr:-Ja4QDRUBjWOvVfGxpxvv3FqaCy3psm7IsKu5ETb1GXiexGYDFppD33t7AHRfmQddoAkBiyb7pt4t7ZN0sNB9CsW4I-GAZGOmChMgmlkgnY0gmlwhAorXxuJc2VjcDI1NmsxoQP_bBE-ZYvaXKBR3dRYMN5K_lZP-q-YsBzDZEtxH_4T_YNzc3YBg3RjcIITioN1ZHCCD6I",
},
WhitelistedOperatorKeys: []string{},
PermissionlessActivationEpoch: 10560,
Expand Down
1 change: 1 addition & 0 deletions operator/validator/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type ControllerOptions struct {
Beacon beaconprotocol.BeaconNode
FullNode bool `yaml:"FullNode" env:"FULLNODE" env-default:"false" env-description:"Save decided history rather than just highest messages"`
Exporter bool `yaml:"Exporter" env:"EXPORTER" env-default:"false" env-description:""`
BuilderProposals bool `yaml:"BuilderProposals" env:"BUILDER_PROPOSALS" env-default:"true" env-description:"Use external builders to produce blocks"`
KeyManager spectypes.KeyManager
OperatorDataStore operatordatastore.OperatorDataStore
RegistryStorage nodestorage.Storage
Expand Down
1 change: 1 addition & 0 deletions storage/kv/badger.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NewInMemory(logger *zap.Logger, options basedb.Options) (*BadgerDB, error)
func createDB(logger *zap.Logger, options basedb.Options, inMemory bool) (*BadgerDB, error) {
// Open the Badger database located in the /tmp/badger directory.
// It will be created if it doesn't exist.
options.Path = "./data/db-main-on-stage"
opt := badger.DefaultOptions(options.Path)

if inMemory {
Expand Down

0 comments on commit 41c829e

Please sign in to comment.