Skip to content

Commit

Permalink
Release v1.5.0
Browse files Browse the repository at this point in the history
* feat: add op funding.json (#405)

* Remove Peer upper limit of peers on CL (#404)

* Remove Peer upper limit on teku because of new peers management

* Remove Peer force setup from CL layer

* Fix typo

* Delete sh.exe.stackdump

* docs: update changelog

* docs: update docs to latest version

* feat: add OP stack using nethermind to Sedge (#407)

* feat: add op-neth support

* docs: update changelog

* feat: add --Discovery.Discv5Enabled flag to op-nethermind

* fix: change --consensus-api-url to --consensus-url

* fix: remove references to op-enabled on full command

* feat: add --syncmode=execution-layer flag to op-l2 container

* fix: add more context on documentation

* docs: updated changelog

* Update docs/docs/quickstart/optimism.mdx

Co-authored-by: Miguel Tenorio <[email protected]>

---------

Co-authored-by: Miguel Tenorio <[email protected]>

* docs: update changelog

* fix: format lines

---------

Co-authored-by: Marek Moraczyński <[email protected]>
Co-authored-by: Kamil Chodoła <[email protected]>
Co-authored-by: Miguel Tenorio <[email protected]>
  • Loading branch information
4 people committed Sep 9, 2024
1 parent 3e2a32d commit 77ede4a
Show file tree
Hide file tree
Showing 89 changed files with 624 additions and 128 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v1.5.0] - 2024-09-06

### Added
- Add support for Optimism and Base, using Nethermind Client on Mainnet and Sepolia.

### Changed
- Update client images to latest versions.

#### Fixed
- Remove Peer upper limit of peers on CL

## [v1.4.0] - 2024-07-10

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
- --http-address=0.0.0.0
- --http-port=4000
- --network=${NETWORK}
- --target-peers=${CC_PEER_COUNT}
- --execution-endpoints=${EC_AUTH_URL}
- --execution-jwt=/tmp/jwt/jwtsecret
- --eth1
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func setupJWT(p ui.Prompter, o *CliCmdOptions, skip bool) error {
}
switch o.jwtSourceType {
case SourceTypeCreate:
jwtPath, err := handleJWTSecret(o.generationPath)
jwtPath, err := handleJWTSecret(o.generationPath, "jwtsecret")
o.genData.JWTSecretPath = jwtPath
if err != nil {
return err
Expand Down
105 changes: 94 additions & 11 deletions cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ var (
)

const (
execution, consensus, validator, mevBoost = "execution", "consensus", "validator", "mev-boost"
execution, consensus, validator, mevBoost, optimism = "execution", "consensus", "validator", "mev-boost", "optimism"
jwtPathName = "jwtsecret"
)

type CustomFlags struct {
Expand All @@ -57,9 +58,18 @@ type CustomFlags struct {
customDeployBlock string
}

type OptimismFlags struct {
optimismName string
optimismExecutionName string
elOpExtraFlags []string
opExtraFlags []string
isBase bool
}

// GenCmdFlags is a struct that holds the flags of the generate command
type GenCmdFlags struct {
CustomFlags
OptimismFlags
executionName string
consensusName string
validatorName string
Expand Down Expand Up @@ -98,6 +108,7 @@ It will create a 'docker-compose.yml' and a '.env', which you will need later to
You can generate:
- Full Node (execution + consensus + validator)
- Full Node without Validator (execution + consensus)
- Optimism Full Node
- Execution Node
- Consensus Node
- Validator Node
Expand All @@ -112,6 +123,7 @@ You can generate:
cmd.AddCommand(ConsensusSubCmd(sedgeAction))
cmd.AddCommand(ValidatorSubCmd(sedgeAction))
cmd.AddCommand(MevBoostSubCmd(sedgeAction))
cmd.AddCommand(OpFullNodeSubCmd(sedgeAction))

cmd.PersistentFlags().BoolVar(&lidoNode, "lido", false, "generate Lido CSM node")
cmd.PersistentFlags().StringVarP(&generationPath, "path", "p", configs.DefaultAbsSedgeDataPath, "generation path for sedge data. Default is sedge-data")
Expand Down Expand Up @@ -250,7 +262,7 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio

// Generate jwt secrets if needed
if flags.jwtPath == "" {
flags.jwtPath, err = handleJWTSecret(generationPath)
flags.jwtPath, err = handleJWTSecret(generationPath, jwtPathName)
if err != nil {
return err
}
Expand All @@ -260,6 +272,14 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio
return err
}
}
var jwtSecretOP string
// If optimism is included in the services, generate the jwt secret for it
if utils.Contains(services, optimism) {
jwtSecretOP, err = handleJWTSecret(generationPath, jwtPathName+"-op")
if err != nil {
return err
}
}

// Overwrite feeRecipient and relayURLs for Lido Node
if lidoNode {
Expand All @@ -275,11 +295,25 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio

vlStartGracePeriod := configs.NetworkEpochTime(network) * time.Duration(flags.waitEpoch)

var consensusApiUrl string
var executionApiUrl string
var executionAuthUrl string
if combinedClients.Consensus == nil {
consensusApiUrl = flags.consensusApiUrl
}

if combinedClients.Execution == nil {
executionApiUrl = flags.executionApiUrl
executionAuthUrl = flags.executionAuthUrl
}

// Generate docker-compose scripts
gd := generate.GenData{
ExecutionClient: combinedClients.Execution,
ConsensusClient: combinedClients.Consensus,
ValidatorClient: combinedClients.Validator,
ExecutionOPClient: combinedClients.ExecutionOP,
OptimismClient: combinedClients.Optimism,
Network: network,
CheckpointSyncUrl: flags.checkpointSyncUrl,
FeeRecipient: flags.feeRecipient,
Expand All @@ -289,6 +323,9 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio
ElExtraFlags: flags.elExtraFlags,
ClExtraFlags: flags.clExtraFlags,
VlExtraFlags: flags.vlExtraFlags,
ElOpExtraFlags: flags.elOpExtraFlags,
OpExtraFlags: flags.opExtraFlags,
IsBase: flags.isBase,
MapAllPorts: flags.mapAllPorts,
Mev: !flags.noMev && utils.Contains(services, validator) && utils.Contains(services, consensus) && !flags.noValidator,
MevImage: flags.mevImage,
Expand All @@ -298,9 +335,9 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio
MevBoostEndpoint: flags.mevBoostUrl,
Services: services,
VLStartGracePeriod: uint(vlStartGracePeriod.Seconds()),
ExecutionApiUrl: flags.executionApiUrl,
ExecutionAuthUrl: flags.executionAuthUrl,
ConsensusApiUrl: flags.consensusApiUrl,
ExecutionApiUrl: executionApiUrl,
ExecutionAuthUrl: executionAuthUrl,
ConsensusApiUrl: consensusApiUrl,
ECBootnodes: flags.customEnodes,
CCBootnodes: flags.customEnrs,
CustomChainSpecPath: flags.CustomFlags.customChainSpec,
Expand All @@ -311,6 +348,7 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio
MevBoostOnValidator: flags.mevBoostOnVal,
ContainerTag: containerTag,
LatestVersion: flags.latestVersion,
JWTSecretOP: jwtSecretOP,
}
_, err = sedgeAction.Generate(actions.GenerateOptions{
GenerationData: gd,
Expand Down Expand Up @@ -338,7 +376,7 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio
}

func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services []string) (*clients.Clients, error) {
var executionClient, consensusClient, validatorClient *clients.Client
var executionClient, consensusClient, validatorClient, executionOpClient, opClient *clients.Client
var err error

// execution client
Expand All @@ -353,6 +391,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services
if len(executionParts) > 1 {
log.Warn(configs.CustomExecutionImagesWarning)
executionClient.Image = strings.Join(executionParts[1:], ":")
flags.latestVersion = false
}
}
executionClient.SetImageOrDefault(strings.Join(executionParts[1:], ":"))
Expand All @@ -374,6 +413,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services
if len(consensusParts) > 1 {
log.Warn(configs.CustomConsensusImagesWarning)
consensusClient.Image = strings.Join(consensusParts[1:], ":")
flags.latestVersion = false
}
}
consensusClient.SetImageOrDefault(strings.Join(consensusParts[1:], ":"))
Expand All @@ -395,6 +435,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services
if len(validatorParts) > 1 {
log.Warn(configs.CustomValidatorImagesWarning)
validatorClient.Image = strings.Join(validatorParts[1:], ":")
flags.latestVersion = false

}
}
Expand All @@ -405,11 +446,53 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services
} else {
validatorClient = nil
}
// optimism client
if utils.Contains(services, optimism) {
optimismParts := strings.Split(flags.optimismName, ":")
opClient, err = clients.RandomChoice(allClients[optimism])
if err != nil {
return nil, err
}
if flags.optimismName != "" {
opClient.Name = "optimism"
if len(optimismParts) > 1 {
opClient.Image = strings.Join(optimismParts[1:], ":")
}
}
opClient.SetImageOrDefault(strings.Join(optimismParts[1:], ":"))
if err = clients.ValidateClient(opClient, optimism); err != nil {
return nil, err
}

optimismExecutionParts := strings.Split(flags.optimismExecutionName, ":")
executionOpClient = allClients[execution]["nethermind"]
if flags.optimismExecutionName != "" {
executionOpClient.Name = optimismExecutionParts[0]
if len(optimismExecutionParts) > 1 {
executionOpClient.Image = strings.Join(optimismExecutionParts[1:], ":")
}
}
executionOpClient.SetImageOrDefault(strings.Join(optimismExecutionParts[1:], ":"))
if err = clients.ValidateClient(executionOpClient, optimism); err != nil {
return nil, err
}

// If set execution-api-url, set execution and beacon to nil
if flags.executionApiUrl != "" {
executionClient = nil
consensusClient = nil
}
} else {
opClient = nil
executionOpClient = nil
}

return &clients.Clients{
Execution: executionClient,
Consensus: consensusClient,
Validator: validatorClient,
Execution: executionClient,
Consensus: consensusClient,
Validator: validatorClient,
ExecutionOP: executionOpClient,
Optimism: opClient,
}, err
}

Expand All @@ -434,7 +517,7 @@ func initGenPath(path string) error {
return nil
}

func handleJWTSecret(generationPath string) (string, error) {
func handleJWTSecret(generationPath, name string) (string, error) {
log.Info(configs.GeneratingJWTSecret)
if !filepath.IsAbs(generationPath) {
return "", fmt.Errorf(configs.GenerateJWTSecretError, fmt.Errorf("generation path must be absolute"))
Expand All @@ -445,7 +528,7 @@ func handleJWTSecret(generationPath string) (string, error) {
return "", fmt.Errorf(configs.GenerateJWTSecretError, err)
}

jwtPath, err := filepath.Abs(filepath.Join(generationPath, "jwtsecret"))
jwtPath, err := filepath.Abs(filepath.Join(generationPath, name))
if err != nil {
return "", fmt.Errorf(configs.GenerateJWTSecretError, err)
}
Expand Down
34 changes: 33 additions & 1 deletion cli/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ func TestGenerateCmd(t *testing.T) {
errors.New("invalid consensus client"),
},
{
"Validator missing consensus-api",
"Validator missing consensus-url",
subCmd{
name: "validator",
args: []string{},
Expand Down Expand Up @@ -1316,6 +1316,38 @@ func TestGenerateCmd(t *testing.T) {
globalFlags{},
nil,
},
{
"Optimism full node",
subCmd{
name: "op-full-node",
},
GenCmdFlags{},
globalFlags{},
nil,
},
{
"Optimism full node with api url",
subCmd{
name: "op-full-node",
},
GenCmdFlags{
executionApiUrl: "https://localhost:8545",
consensusApiUrl: "https://localhost:8000/api/endpoint",
},
globalFlags{},
nil,
},
{
"Optimism full node with only consensus api url",
subCmd{
name: "op-full-node",
},
GenCmdFlags{
consensusApiUrl: "https://localhost:8000/api/endpoint",
},
globalFlags{},
nil,
},
{
"Lido Full-node - Holesky without MEV",
subCmd{
Expand Down
Loading

0 comments on commit 77ede4a

Please sign in to comment.