Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions networkconfig/holesky-e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ var HoleskyE2E = NetworkConfig{
RegistryContractAddr: "0x58410bef803ecd7e63b23664c586a6db72daf59c",
RegistrySyncOffset: big.NewInt(405579),
Bootnodes: []string{},
GasLimit36Epoch: 0,
},
}
1 change: 1 addition & 0 deletions networkconfig/holesky-stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ var HoleskyStage = NetworkConfig{
// Private bootnode:
"enr:-Ja4QDRUBjWOvVfGxpxvv3FqaCy3psm7IsKu5ETb1GXiexGYDFppD33t7AHRfmQddoAkBiyb7pt4t7ZN0sNB9CsW4I-GAZGOmChMgmlkgnY0gmlwhAorXxuJc2VjcDI1NmsxoQP_bBE-ZYvaXKBR3dRYMN5K_lZP-q-YsBzDZEtxH_4T_YNzc3YBg3RjcIITioN1ZHCCD6I",
},
GasLimit36Epoch: 0,
},
}
1 change: 1 addition & 0 deletions networkconfig/holesky.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ var Holesky = NetworkConfig{
// SSV Labs
"enr:-Ja4QKFD3u5tZob7xukp-JKX9QJMFqqI68cItsE4tBbhsOyDR0M_1UUjb35hbrqvTP3bnXO_LnKh-jNLTeaUqN4xiduGAZKaP_sagmlkgnY0gmlwhDb0fh6Jc2VjcDI1NmsxoQMw_H2anuiqP9NmEaZwbUfdvPFog7PvcKmoVByDa576SINzc3YBg3RjcIITioN1ZHCCD6I",
},
GasLimit36Epoch: 0,
},
}
1 change: 1 addition & 0 deletions networkconfig/hoodi-stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ var HoodiStage = NetworkConfig{
// SSV Labs
"enr:-Ja4QJZcaYfS0GpX-5xREVBa26a-E-QHMFek-EndsJdgM6loIM7pfbJwPDCNK1VzPkUhMjwcTTuNASiHU6X-sjsrxFmGAZWjNu06gmlkgnY0gmlwhErcGnyJc2VjcDI1NmsxoQP_bBE-ZYvaXKBR3dRYMN5K_lZP-q-YsBzDZEtxH_4T_YNzc3YBg3RjcIITioN1ZHCCD6I",
},
GasLimit36Epoch: 0,
},
}
1 change: 1 addition & 0 deletions networkconfig/hoodi.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ var Hoodi = NetworkConfig{
// SSV Labs
"enr:-Ja4QIKlyNFuFtTOnVoavqwmpgSJXfhSmhpdSDOUhf5-FBr7bBxQRvG6VrpUvlkr8MtpNNuMAkM33AseduSaOhd9IeWGAZWjRbnvgmlkgnY0gmlwhCNVVTCJc2VjcDI1NmsxoQNTTyiJPoZh502xOZpHSHAfR-94NaXLvi5J4CNHMh2tjoNzc3YBg3RjcIITioN1ZHCCD6I",
},
GasLimit36Epoch: 0,
},
}
1 change: 1 addition & 0 deletions networkconfig/local-testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ var LocalTestnet = NetworkConfig{
Bootnodes: []string{
"enr:-Li4QLR4Y1VbwiqFYKy6m-WFHRNDjhMDZ_qJwIABu2PY9BHjIYwCKpTvvkVmZhu43Q6zVA29sEUhtz10rQjDJkK3Hd-GAYiGrW2Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhCLdu_SJc2VjcDI1NmsxoQJTcI7GHPw-ZqIflPZYYDK_guurp_gsAFF5Erns3-PAvIN0Y3CCE4mDdWRwgg-h",
},
GasLimit36Epoch: 0,
},
}
4 changes: 4 additions & 0 deletions networkconfig/mainnet.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package networkconfig

import (
"math"
"math/big"

"github.com/attestantio/go-eth2-client/spec/phase0"
spectypes "github.com/ssvlabs/ssv-spec/types"

"github.com/ssvlabs/ssv/protocol/v2/blockchain/beacon"
Expand Down Expand Up @@ -31,5 +33,7 @@ var Mainnet = NetworkConfig{
// CryptoManufaktur
"enr:-Li4QH7FwJcL8gJj0zHAITXqghMkG-A5bfWh2-3Q7vosy9D1BS8HZk-1ITuhK_rfzG3v_UtBDI6uNJZWpdcWfrQFCxKGAYnQ1DRCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLb3g2Jc2VjcDI1NmsxoQKeSDcZWSaY9FC723E9yYX1Li18bswhLNlxBZdLfgOKp4N0Y3CCE4mDdWRwgg-h",
},
// TODO - set proper value for mainnet
GasLimit36Epoch: phase0.Epoch(math.MaxUint64),
},
}
1 change: 1 addition & 0 deletions networkconfig/sepolia.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ var Sepolia = NetworkConfig{
// SSV Labs
"enr:-Ja4QIE0Ml0a8Pq9zD-0g9KYGN3jAMPJ0CAP0i16fK-PSHfLeORl-Z5p8odoP1oS5S2E8IsF5jNG7gqTKhjVsHR-Z_CGAZXrnTJrgmlkgnY0gmlwhCOjXGWJc2VjcDI1NmsxoQKCRDQsIdFsJDmu_ZU2H6b2_HRJbuUneDXHLfFkSQH9O4Nzc3YBg3RjcIITioN1ZHCCD6I",
},
GasLimit36Epoch: 0,
},
}
4 changes: 4 additions & 0 deletions networkconfig/ssv.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package networkconfig
import (
"math/big"

"github.com/attestantio/go-eth2-client/spec/phase0"
spectypes "github.com/ssvlabs/ssv-spec/types"
)

Expand All @@ -12,4 +13,7 @@ type SSVConfig struct {
RegistryContractAddr string // TODO: ethcommon.Address
Bootnodes []string
DiscoveryProtocolID [6]byte
// GasLimit36Epoch is an epoch when to upgrade from default gas limit value of 30_000_000
// to 36_000_000.
GasLimit36Epoch phase0.Epoch
}
1 change: 1 addition & 0 deletions networkconfig/test-network.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ var TestNetwork = NetworkConfig{
Bootnodes: []string{
"enr:-Li4QFIQzamdvTxGJhvcXG_DFmCeyggSffDnllY5DiU47pd_K_1MRnSaJimWtfKJ-MD46jUX9TwgW5Jqe0t4pH41RYWGAYuFnlyth2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhCLdu_SJc2VjcDI1NmsxoQN4v-N9zFYwEqzGPBBX37q24QPFvAVUtokIo1fblIsmTIN0Y3CCE4uDdWRwgg-j",
},
GasLimit36Epoch: 0,
},
}
4 changes: 2 additions & 2 deletions protocol/v2/ssv/testing/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var ConstructBaseRunner = func(
net,
km,
opSigner,
spectypes.DefaultGasLimit,
validator.DefaultGasLimitOld,
)
case spectypes.RoleVoluntaryExit:
r, err = runner.NewVoluntaryExitRunner(
Expand Down Expand Up @@ -441,7 +441,7 @@ var ConstructBaseRunnerWithShareMap = func(
net,
km,
opSigner,
spectypes.DefaultGasLimit,
validator.DefaultGasLimitOld,
)
case spectypes.RoleVoluntaryExit:
r, err = runner.NewVoluntaryExitRunner(
Expand Down
11 changes: 10 additions & 1 deletion protocol/v2/ssv/validator/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (

const (
DefaultQueueSize = 32

DefaultGasLimit = uint64(36_000_000)
DefaultGasLimitOld = uint64(30_000_000)
)

// Options represents validator-specific options.
Expand Down Expand Up @@ -89,8 +92,14 @@ func NewCommonOptions(
result.QueueSize = max(result.QueueSize, historySyncBatchSize*2)
}

// Set the default GasLimit value if it hasn't been specified already, use 36 or 30 depending
// on the current epoch as compared to when this transition is supposed to happen.
if result.GasLimit == 0 {
result.GasLimit = spectypes.DefaultGasLimit
defaultGasLimit := DefaultGasLimit
if result.NetworkConfig.Beacon.EstimatedCurrentEpoch() < result.NetworkConfig.GasLimit36Epoch {
defaultGasLimit = DefaultGasLimitOld
}
result.GasLimit = defaultGasLimit
}

return result
Expand Down