From a0d5bbbb150c5efa26fc9b56d41fba8d0215197d Mon Sep 17 00:00:00 2001 From: Marcos Antonio Maceo <35319980+stdevMac@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:35:17 +0400 Subject: [PATCH 1/6] Fix mev boost issue on Lodestar (#485) * fix: missing = on lodestar builder * docs: update changelog --- CHANGELOG.md | 3 +++ templates/services/merge/consensus/lodestar.tmpl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a8e3a4b..43e9df832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Support Mainnet for Lido CSM setup. +### Fixed +- Fix missing equals sign when setting builder on Lodestar. + ## [v1.6.0] - 2024-10-18 diff --git a/templates/services/merge/consensus/lodestar.tmpl b/templates/services/merge/consensus/lodestar.tmpl index 0e4121c60..a183e30d0 100644 --- a/templates/services/merge/consensus/lodestar.tmpl +++ b/templates/services/merge/consensus/lodestar.tmpl @@ -47,7 +47,7 @@ - --checkpointSyncUrl={{if .CheckpointSyncUrl}}{{ .CheckpointSyncUrl }}{{else}}${CHECKPOINT_SYNC_URL}{{end}}{{end}}{{range $flag := .ClExtraFlags}} - --{{$flag}}{{end}}{{if .MevBoostEndpoint}} - --builder=true - - --builder.urls {{.MevBoostEndpoint}}{{end}}{{if .LoggingDriver}} + - --builder.urls={{.MevBoostEndpoint}}{{end}}{{if .LoggingDriver}} logging: driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}} options: From fc8ada488ab09a320c21eaba0641ba40724ca4df Mon Sep 17 00:00:00 2001 From: Haneen Hany <124837763+khalifaa55@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:59:19 +0200 Subject: [PATCH 2/6] docs: Update lido-status command (#488) --- docs/docs/quickstart/lido.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/docs/quickstart/lido.mdx b/docs/docs/quickstart/lido.mdx index 4bc4a88ed..abc0d7d10 100644 --- a/docs/docs/quickstart/lido.mdx +++ b/docs/docs/quickstart/lido.mdx @@ -108,12 +108,16 @@ CSM Widget. ### Checking Node Operator Status -To view detailed data about your Node Operator, use the `sedge lido-status` [command](../commands/lidoStatus.mdx). This command displays information specific to the Node Operator based on the provided rewards address. +To view detailed data about your Node Operator, use the `sedge lido-status` [command](../commands/lidoStatus.mdx). This command displays information specific to the Node Operator based on the provided rewards address or node operator ID. +**Using the rewards address** ```bash sedge lido-status ``` - +**Using the node operator ID** +```bash +sedge lido-status --nodeID +``` :::info `rewardAddress` is the ultimate recipient of the rewards. It can perform the following actions regarding the CSM Node Operator: From 299ba6f36517b0b1d00ad37fff2e90f1ea2d2ed5 Mon Sep 17 00:00:00 2001 From: Haneen Hany <124837763+khalifaa55@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:29:13 +0200 Subject: [PATCH 3/6] tests: Valid tests for Lido mainnet setup (#467) * tests: valid lido mainnet setup * fix: Update holesky relays * refactor: claim rewards link * feat: Add holesky rpcs * tests: nodeID test * tests: invalid reward address mainnet --- cli/lidoStatus.go | 8 ++- cli/lidoStatus_test.go | 38 ++++++------- configs/public_rpcs.go | 2 + e2e/sedge/lidoStatus_test.go | 56 +++++++++---------- .../csfeedistributor/rewards_test.go | 12 ++-- .../contracts/csmodule/nodeOperator_test.go | 22 +++++--- .../contracts/mevboostrelaylist/relays.yaml | 22 +++++--- 7 files changed, 91 insertions(+), 69 deletions(-) diff --git a/cli/lidoStatus.go b/cli/lidoStatus.go index eb32f83b5..429ebc817 100644 --- a/cli/lidoStatus.go +++ b/cli/lidoStatus.go @@ -214,7 +214,13 @@ func buildLidoData(node *lidoData) map[string]struct { var nodeOpDetailed, keysDetailed, queueDetailed, bondDetailed, rewardsDetailed string var currentBond, requiredBond, excessBond, missedBond, rewards decimal.Decimal rewardAddressLink := fmt.Sprintf(`https://etherscan.io/address/%s`, node.nodeInfo.RewardAddress) - claimRewardsLink := fmt.Sprintf(`https://%s.etherscan.io/address/%s#writeProxyContract#F10`, networkName, contracts.DeployedAddresses(contracts.CSModule)[networkName]) + var prefix string + if networkName == "mainnet" { + prefix = "" + } else { + prefix = networkName + "." + } + claimRewardsLink := fmt.Sprintf(`https://%setherscan.io/address/%s#writeProxyContract#F10`, prefix, contracts.DeployedAddresses(contracts.CSModule)[networkName]) detailedDescriptions := map[string]string{ nodeOpInfo: ` diff --git a/cli/lidoStatus_test.go b/cli/lidoStatus_test.go index 608df2e9f..c6d52e432 100644 --- a/cli/lidoStatus_test.go +++ b/cli/lidoStatus_test.go @@ -137,25 +137,25 @@ func TestLidoStatusCmd(t *testing.T) { }, isErr: true, }, - // { - // name: "Valid node ID, Mainnet", - // flags: flags{ - // rewardAddress: "0xe6b5A31d8bb53D2C769864aC137fe25F4989f1fd", // rewardAddress should be ignored - // networkName: "mainnet", - // nodeIDInt: 1, - // }, - // isErr: false, - // }, - // { - // name: "Valid node ID with long description, Mainnet", - // flags: flags{ - // rewardAddress: "0xe6b5A31d8bb53D2C769864aC137fe25F4989f1fd", // rewardAddress should be ignored - // networkName: "mainnet", - // nodeIDInt: 1, - // longDescriptions: true, - // }, - // isErr: false, - // }, + { + name: "Valid node ID, Mainnet", + flags: flags{ + rewardAddress: "0xe6b5A31d8bb53D2C769864aC137fe25F4989f1fd", // rewardAddress should be ignored + networkName: "mainnet", + nodeIDInt: 1, + }, + isErr: false, + }, + { + name: "Valid node ID with long description, Mainnet", + flags: flags{ + rewardAddress: "0xe6b5A31d8bb53D2C769864aC137fe25F4989f1fd", // rewardAddress should be ignored + networkName: "mainnet", + nodeIDInt: 1, + longDescriptions: true, + }, + isErr: false, + }, { name: "Invalid: negative node ID, Mainnet", flags: flags{ diff --git a/configs/public_rpcs.go b/configs/public_rpcs.go index bf5884c2c..3d6a5e5c5 100644 --- a/configs/public_rpcs.go +++ b/configs/public_rpcs.go @@ -42,6 +42,8 @@ var networkRPCs = map[string]RPC{ "https://ethereum-holesky-rpc.publicnode.com", "https://endpoints.omniatech.io/v1/eth/holesky/public", "https://ethereum-holesky.blockpi.network/v1/rpc/public", + "https://1rpc.io/holesky", + "https://holesky.drpc.org", }, PublicWSs: []string{ "wss://ethereum-holesky-rpc.publicnode.com", diff --git a/e2e/sedge/lidoStatus_test.go b/e2e/sedge/lidoStatus_test.go index 17a71707d..a66b01a87 100644 --- a/e2e/sedge/lidoStatus_test.go +++ b/e2e/sedge/lidoStatus_test.go @@ -116,7 +116,7 @@ func TestE2E_LidoStatus_InvalidRewardAddress(t *testing.T) { e2eTest.run() } -func TestE2E_LidoStatus_RewardAddressNotFound(t *testing.T) { +func TestE2E_LidoStatus_InvalidZeroRewardAddress(t *testing.T) { // Test context var ( runErr error @@ -128,7 +128,7 @@ func TestE2E_LidoStatus_RewardAddressNotFound(t *testing.T) { nil, // Act func(t *testing.T, binaryPath string, dataDirPath string) { - runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "0xC870Fd7316956C1582A2c8Fd2c42552cCEC70C89", "--network", "holesky") + runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "0x0000000000000000000000000000000000000000", "--network", "holesky") }, // Assert func(t *testing.T, dataDirPath string) { @@ -139,7 +139,7 @@ func TestE2E_LidoStatus_RewardAddressNotFound(t *testing.T) { e2eTest.run() } -func TestE2E_LidoStatus_InvalidZeroRewardAddress(t *testing.T) { +func TestE2E_LidoStatus_ValidNodeID_Mainnet(t *testing.T) { // Test context var ( runErr error @@ -151,40 +151,17 @@ func TestE2E_LidoStatus_InvalidZeroRewardAddress(t *testing.T) { nil, // Act func(t *testing.T, binaryPath string, dataDirPath string) { - runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "0x0000000000000000000000000000000000000000", "--network", "holesky") + runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "--nodeID", "1", "--l", "--network", "mainnet") }, // Assert func(t *testing.T, dataDirPath string) { - assert.Error(t, runErr, "lido status command should fail") + assert.NoError(t, runErr, "lido status command should succeed with the given arguments") }, ) // Run test case e2eTest.run() } -// func TestE2E_LidoStatus_ValidNodeID_Mainnet(t *testing.T) { -// // Test context -// var ( -// runErr error -// ) -// // Build test case -// e2eTest := newE2ESedgeTestCase( -// t, -// // Arrange -// nil, -// // Act -// func(t *testing.T, binaryPath string, dataDirPath string) { -// runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "--nodeID", "1", "--l", "--network", "mainnet") -// }, -// // Assert -// func(t *testing.T, dataDirPath string) { -// assert.NoError(t, runErr, "lido status command should succeed with the given arguments") -// }, -// ) -// // Run test case -// e2eTest.run() -// } - func TestE2E_LidoStatus_InvalidNodeID_Mainnet(t *testing.T) { // Test context var ( @@ -231,3 +208,26 @@ func TestE2E_LidoStatus_InvalidRewardAddress_Mainnet(t *testing.T) { // Run test case e2eTest.run() } + +func TestE2E_LidoStatus_RewardAddressNotFound_Mainnet(t *testing.T) { + // Test context + var ( + runErr error + ) + // Build test case + e2eTest := newE2ESedgeTestCase( + t, + // Arrange + nil, + // Act + func(t *testing.T, binaryPath string, dataDirPath string) { + runErr = base.RunCommand(t, binaryPath, "sedge", "lido-status", "0xC870Fd7316956C1582A2c8Fd2c42552cCEC70C89", "--network", "mainnet") + }, + // Assert + func(t *testing.T, dataDirPath string) { + assert.Error(t, runErr, "lido status command should fail") + }, + ) + // Run test case + e2eTest.run() +} diff --git a/internal/lido/contracts/csfeedistributor/rewards_test.go b/internal/lido/contracts/csfeedistributor/rewards_test.go index 8cbd19562..11fa31844 100644 --- a/internal/lido/contracts/csfeedistributor/rewards_test.go +++ b/internal/lido/contracts/csfeedistributor/rewards_test.go @@ -62,12 +62,12 @@ func TestRewards(t *testing.T) { nodeID: big.NewInt(-15), wantErr: true, }, - // { - // name: "Rewards for nodeID 1, Mainnet", - // network: "mainnet", - // nodeID: big.NewInt(1), - // wantErr: false, - // }, + { + name: "Rewards for nodeID 1, Mainnet", + network: "mainnet", + nodeID: big.NewInt(1), + wantErr: false, + }, } for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { diff --git a/internal/lido/contracts/csmodule/nodeOperator_test.go b/internal/lido/contracts/csmodule/nodeOperator_test.go index 711d7f9f3..016c1a71f 100644 --- a/internal/lido/contracts/csmodule/nodeOperator_test.go +++ b/internal/lido/contracts/csmodule/nodeOperator_test.go @@ -77,6 +77,9 @@ func TestNodeOperatorInfo(t *testing.T) { { "Invalid Address, Mainnet", "mainnet", big.NewInt(4), "0xC870Fd7316956C1582A2c8Fd2c46752", true, }, + { + "Valid Address, Mainnet", "mainnet", big.NewInt(1), "0x556fedf2213A31c7Ab9F8bc8Db5B2254261A5B0b", false, + }, } for _, tc := range tcs { @@ -102,23 +105,23 @@ func TestNodeID(t *testing.T) { wantErr bool }{ { - "Valid NodeID, Holesky #1", "holesky", big.NewInt(13), false, + "Invalid NodeID, Mainnet", "mainnet", big.NewInt(-2), true, }, { - "Valid NodeID, Holesky #2", "holesky", big.NewInt(4), false, + "Valid NodeID, Mainnet", "mainnet", big.NewInt(1), false, }, { - "Invalid NodeID, Holesky #1", "holesky", big.NewInt(-4), true, + "Valid NodeID, Mainnet #2", "mainnet", big.NewInt(12), false, }, { - "Invalid NodeID, Holesky #2", "holesky", big.NewInt(20000), true, + "Valid NodeID, Holesky", "holesky", big.NewInt(4), false, }, { - "Invalid NodeID, Mainnet", "mainnet", big.NewInt(-2), true, + "Invalid NodeID, Holesky #1", "holesky", big.NewInt(-4), true, + }, + { + "Invalid NodeID, Holesky #2", "holesky", big.NewInt(20000), true, }, - // { - // "Valid NodeID, Mainnet", "mainnet", big.NewInt(1), false, - // }, } for _, tc := range tcs { @@ -146,6 +149,9 @@ func FuzzTestNodeID(f *testing.F) { {"holesky", big.NewInt(13)}, {"holesky", big.NewInt(-1)}, {"holesky", big.NewInt(40000)}, + {"mainnet", big.NewInt(12)}, + {"mainnet", big.NewInt(-5)}, + {"mainnet", big.NewInt(500000)}, } for _, tc := range testcases { diff --git a/internal/lido/contracts/mevboostrelaylist/relays.yaml b/internal/lido/contracts/mevboostrelaylist/relays.yaml index a8007c827..dd8657a08 100644 --- a/internal/lido/contracts/mevboostrelaylist/relays.yaml +++ b/internal/lido/contracts/mevboostrelaylist/relays.yaml @@ -58,15 +58,23 @@ holesky: Operator: "Beaverbuild" IsMandatory: false Description: "Beaverbuild Relay Holesky" - - Uri: "https://0xb1d229d9c21298a87846c7022ebeef277dfc321fe674fa45312e20b5b6c400bfde9383f801848d7837ed5fc449083a12@relay-holesky.edennetwork.io" - Operator: "Eden" + - Uri: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" + Operator: "Flashbots" IsMandatory: true - Description: "Eden Relay Holesky - Filtering" + Description: "Flashbots Boost Holesky - filtering" - Uri: "https://0xaa58208899c6105603b74396734a6263cc7d947f444f396a90f7b7d3e65d102aec7e5e5291b27e08d02c50a050825c2f@holesky.titanrelay.xyz/" Operator: "Titan" IsMandatory: true Description: "Titan Relay Holesky - nonfiltering" - - Uri: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" - Operator: "Flashbots" - IsMandatory: true - Description: "Flashbots Boost Holesky - filtering" \ No newline at end of file + - Uri: "https://0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5@relay-holesky.bolt.chainbound.io" + Operator: "Chainbound" + IsMandatory: false + Description: "Chainbound Preconf Holesky" + - Uri: "https://0x8d6ff9fdf3b8c05293f6c240f57034c6c5244d7ecb2b9a6e597de575b373610d6345f5060c150012d1cc42d38b8383ac@preconfs-holesky.aestus.live" + Operator: "Aestus" + IsMandatory: false + Description: "Aestus Preconf Holesky" + - Uri: "https://0xaa58208899c6105603b74396734a6263cc7d947f444f396a90f7b7d3e65d102aec7e5e5291b27e08d02c50a050825c2f@holesky-preconf.titanrelay.xyz" + Operator: "Titan" + IsMandatory: false + Description: "Titan Preconf Holesky" \ No newline at end of file From 07b369e63dc2079e9a6f916f5d46535a9359cebe Mon Sep 17 00:00:00 2001 From: Haneen Hany <124837763+khalifaa55@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:11:02 +0200 Subject: [PATCH 4/6] docs: Include note about lido-status flags (#490) * docs: Include note about lido-status flags * fix: Update lidoStatus.mdx --- docs/docs/commands/lidoStatus.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/docs/commands/lidoStatus.mdx b/docs/docs/commands/lidoStatus.mdx index 1c35c7f08..196272d76 100644 --- a/docs/docs/commands/lidoStatus.mdx +++ b/docs/docs/commands/lidoStatus.mdx @@ -10,6 +10,14 @@ Including information on the node operator's status, queue details, bond and rew ## Help +:::note + +When using only the rewards address as input, the command will return the first node found to be associated with that address. +However, rewards addresses can be linked to multiple node operator (NO) entries in CSM (e.g., due to the "change rewards address" functionality). +If a rewards address is associated with multiple NOs, we recommend using the node operator ID flag (```-i```) to specify the appropriate node. + +::: + ``` $ sedge lido-status -h This command retrieves and displays the status and detailed information of Lido Node Operators. @@ -32,4 +40,4 @@ Flags: Global Flags: --log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info") -``` \ No newline at end of file +``` From c692dbd2f0d9a11f9f2fc692a1e8b23e09b7e0cf Mon Sep 17 00:00:00 2001 From: Marcos Antonio Maceo <35319980+stdevMac@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:33:55 +0400 Subject: [PATCH 5/6] Change latest flag behavior (#483) * feat: override latest tag if image is set * docs: update changelog * fix: latest on nimbus * fix: op-execution modified on latest --- CHANGELOG.md | 3 ++ cli/actions/generation_test.go | 55 +++++++++++++++++++---- cli/generate.go | 10 +++-- internal/pkg/clients/types.go | 1 + internal/pkg/generate/generate_scripts.go | 15 +++++-- 5 files changed, 68 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e9df832..7ba0cbc59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - New cli flag --distributed for running cluster with Charon distributed validator +### Changed +- Override `--latest` flag to not use the latest version of the image in the clients if image is specified + ## [v1.7.2] - 2024-11-12 ### Fixed diff --git a/cli/actions/generation_test.go b/cli/actions/generation_test.go index ea80bfaf2..f121862fb 100644 --- a/cli/actions/generation_test.go +++ b/cli/actions/generation_test.go @@ -260,9 +260,9 @@ func TestGenerateDockerCompose(t *testing.T) { }, }, genTestData{ - name: fmt.Sprintf("execution: %s, consensus: %s, validator: %s, network: %s, no validator, with latest", executionCl, consensusCl, consensusCl, network), + name: fmt.Sprintf("execution: %s, consensus: %s, validator: %s, network: %s, no validator, with latest, execution has image specified", executionCl, consensusCl, consensusCl, network), genData: generate.GenData{ - ExecutionClient: &clients.Client{Name: executionCl, Type: "execution"}, + ExecutionClient: &clients.Client{Name: executionCl, Type: "execution", Image: "execution/execution:1.1.1", Modified: true}, ConsensusClient: &clients.Client{Name: consensusCl, Type: "consensus"}, Services: []string{"execution", "consensus"}, Network: network, @@ -270,6 +270,29 @@ func TestGenerateDockerCompose(t *testing.T) { LatestVersion: true, }, }, + genTestData{ + name: fmt.Sprintf("execution: %s, consensus: %s, validator: %s, network: %s, no validator, with latest, consensus has image specified", executionCl, consensusCl, consensusCl, network), + genData: generate.GenData{ + ExecutionClient: &clients.Client{Name: executionCl, Type: "execution"}, + ConsensusClient: &clients.Client{Name: consensusCl, Type: "consensus", Image: "consensus/consensus:1.1.1", Modified: true}, + Services: []string{"execution", "consensus"}, + Network: network, + ContainerTag: "sampleTag", + LatestVersion: true, + }, + }, + genTestData{ + name: fmt.Sprintf("execution: %s, consensus: %s, validator: %s, network: %s, no validator, with latest, consensus and validator has image specified", executionCl, consensusCl, consensusCl, network), + genData: generate.GenData{ + ExecutionClient: &clients.Client{Name: executionCl, Type: "execution"}, + ConsensusClient: &clients.Client{Name: consensusCl, Type: "consensus", Image: "consensus/consensus:1.1.1", Modified: true}, + ValidatorClient: &clients.Client{Name: consensusCl, Type: "validator", Image: "validator/validator:1.1.1", Modified: true}, + Services: []string{"execution", "consensus", "validator"}, + Network: network, + ContainerTag: "sampleTag", + LatestVersion: true, + }, + }, ) } @@ -350,9 +373,13 @@ func TestGenerateDockerCompose(t *testing.T) { named, err := reference.ParseNormalizedNamed(ecImageVersion) assert.NoError(t, err, "invalid image", ecImageVersion) - // Test that the execution image is set to latest if flag --latest is provided + // Test that the execution image is set to latest if flag --latest is provided, and the image is not modified if tc.genData.LatestVersion { - assert.True(t, strings.HasSuffix(named.String(), ":latest")) + if tc.genData.ExecutionClient.Modified { + assert.True(t, strings.HasSuffix(named.String(), tc.genData.ExecutionClient.Image)) + } else { + assert.True(t, strings.HasSuffix(named.String(), ":latest")) + } } // Check that mev-boost service is not set when execution only @@ -387,9 +414,15 @@ func TestGenerateDockerCompose(t *testing.T) { named, err := reference.ParseNormalizedNamed(ccImageVersion) assert.NoError(t, err, "invalid image", ccImageVersion) - // Test that the consensus image is set to latest if flag --latest is provided + // Test that the consensus image is set to latest if flag --latest is provided, and the image is not modified if tc.genData.LatestVersion { - assert.True(t, strings.HasSuffix(named.String(), ":latest")) + if tc.genData.ConsensusClient.Modified { + assert.True(t, strings.HasSuffix(named.String(), tc.genData.ConsensusClient.Image)) + } else if tc.genData.ConsensusClient.Name == "nimbus" { + assert.True(t, strings.HasSuffix(named.String(), ":multiarch-latest")) + } else { + assert.True(t, strings.HasSuffix(named.String(), ":latest")) + } } // Validate Execution API and AUTH URLs apiEndpoint, authEndpoint := envData["EC_API_URL"], envData["EC_AUTH_URL"] @@ -448,9 +481,15 @@ func TestGenerateDockerCompose(t *testing.T) { named, err := reference.ParseNormalizedNamed(vlImageVersion) assert.NoError(t, err, "invalid image", vlImageVersion) - // Test that the consensus image is set to latest if flag --latest is provided + // Test that the consensus image is set to latest if flag --latest is provided, and the image is not modified if tc.genData.LatestVersion { - assert.True(t, strings.HasSuffix(named.String(), ":latest")) + if tc.genData.ValidatorClient.Modified { + assert.True(t, strings.HasSuffix(named.String(), tc.genData.ValidatorClient.Image)) + } else if tc.genData.ValidatorClient.Name == "nimbus" { + assert.True(t, strings.HasSuffix(named.String(), ":multiarch-latest")) + } else { + assert.True(t, strings.HasSuffix(named.String(), ":latest")) + } } // Check Consensus API URL is set and is valid diff --git a/cli/generate.go b/cli/generate.go index e9c400c18..cc83bb645 100644 --- a/cli/generate.go +++ b/cli/generate.go @@ -398,7 +398,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.Modified = true } } executionClient.SetImageOrDefault(strings.Join(executionParts[1:], ":")) @@ -425,7 +425,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.Modified = true } } consensusClient.SetImageOrDefault(strings.Join(consensusParts[1:], ":")) @@ -447,8 +447,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 - + validatorClient.Modified = true } } validatorClient.SetImageOrDefault(strings.Join(validatorParts[1:], ":")) @@ -469,6 +468,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services opClient.Name = "opnode" if len(optimismParts) > 1 { opClient.Image = strings.Join(optimismParts[1:], ":") + opClient.Modified = true } } opClient.SetImageOrDefault(strings.Join(optimismParts[1:], ":")) @@ -485,6 +485,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services executionOpClient.Name = strings.ReplaceAll(optimismExecutionParts[0], "-", "") if len(optimismExecutionParts) > 1 { executionOpClient.Image = strings.Join(optimismExecutionParts[1:], ":") + executionOpClient.Modified = true } } executionOpClient.SetImageOrDefault(strings.Join(optimismExecutionParts[1:], ":")) @@ -510,6 +511,7 @@ func valClients(allClients clients.OrderedClients, flags *GenCmdFlags, services distributedValidatorClient.Name = distributedValidatorParts[0] if len(distributedValidatorParts) > 1 { distributedValidatorClient.Image = strings.Join(distributedValidatorParts[1:], ":") + distributedValidatorClient.Modified = true } distributedValidatorClient.SetImageOrDefault(strings.Join(distributedValidatorParts[1:], ":")) } else { diff --git a/internal/pkg/clients/types.go b/internal/pkg/clients/types.go index aa6138d0e..ab951ae34 100644 --- a/internal/pkg/clients/types.go +++ b/internal/pkg/clients/types.go @@ -24,6 +24,7 @@ type Client struct { Name string Type string Image string + Modified bool Endpoint string Supported bool } diff --git a/internal/pkg/generate/generate_scripts.go b/internal/pkg/generate/generate_scripts.go index 982eed425..a87ecae0e 100644 --- a/internal/pkg/generate/generate_scripts.go +++ b/internal/pkg/generate/generate_scripts.go @@ -697,10 +697,17 @@ func joinIfNotEmpty(strs ...string) string { // imageOrEmpty returns the image of the client if it is not nil, otherwise returns an empty string func imageOrEmpty(cls *clients.Client, latest bool) string { if cls != nil { - if latest { - splits := strings.Split(cls.Image, ":") - splits[len(splits)-1] = "latest" - return strings.Join(splits, ":") + if latest && !cls.Modified { + if cls.Name == "nimbus" { + splits := strings.Split(cls.Image, ":") + splits[len(splits)-1] = "multiarch-latest" + return strings.Join(splits, ":") + + } else { + splits := strings.Split(cls.Image, ":") + splits[len(splits)-1] = "latest" + return strings.Join(splits, ":") + } } return cls.Image } From 6ab41db12ad4e63113411fcc2d3d383efc4c7eb8 Mon Sep 17 00:00:00 2001 From: yevh Date: Thu, 6 Feb 2025 08:34:23 +0100 Subject: [PATCH 6/6] Update codeql.yml (#501) --- .github/workflows/codeql.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9d03e4f76..53fbf48f2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,20 +20,22 @@ jobs: strategy: fail-fast: false matrix: - language: ["go"] + language: ["go", "actions"] steps: - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@5618c9fc1e675841ca52c1c6b1304f5255a905a0 #v2.19.0 + uses: github/codeql-action/init@7e3036b9cd87fc26dd06747b7aa4b96c27aaef3a #v2.20.3 with: languages: ${{ matrix.language }} + queries: security-and-quality + packs: githubsecuritylab/codeql-go-queries - name: Autobuild - uses: github/codeql-action/autobuild@5618c9fc1e675841ca52c1c6b1304f5255a905a0 #v2.19.0 + uses: github/codeql-action/autobuild@7e3036b9cd87fc26dd06747b7aa4b96c27aaef3a #v2.20.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5618c9fc1e675841ca52c1c6b1304f5255a905a0 #v2.19.0 + uses: github/codeql-action/analyze@7e3036b9cd87fc26dd06747b7aa4b96c27aaef3a #v2.20.3