Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.3 #140

Closed
wants to merge 17 commits into from
Closed
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: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ linters:
- predeclared
- revive
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
Expand Down
1 change: 1 addition & 0 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ build_install_packages() {
tar cfJ stader-node-install.tar.xz install || fail "Error building installer package."
mv stader-node-install.tar.xz build/$VERSION
cp install.sh build/$VERSION
cp update_package.sh build/$VERSION
aws s3 cp build/$VERSION s3://$S3_BUCKET/$VERSION --recursive
echo "done!"

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ require (
github.com/rivo/tview v0.0.0-20230621164836-6cc0565babaf // indirect
github.com/sethvargo/go-password v0.2.0
github.com/shirou/gopsutil/v3 v3.23.1
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231016124941-f6dc59b3b0ff
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231016124941-f6dc59b3b0ff
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231101111158-6c1993b3d9ae
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231101111158-6c1993b3d9ae
github.com/tyler-smith/go-bip39 v1.1.0
github.com/urfave/cli v1.22.10
github.com/wealdtech/go-eth2-types/v2 v2.7.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1231,10 +1231,10 @@ github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7Sr
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231016124941-f6dc59b3b0ff h1:BIoOmo3mDvZer2FUF63LU1w08k5jOBcpBF6Ac/IIX+Q=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231016124941-f6dc59b3b0ff/go.mod h1:gZcnx3O0sm+mEO2INhKDHw+iUzJH5tPaX4cv5SN5tsQ=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231016124941-f6dc59b3b0ff h1:/snabGli4t4fC41ofKSFwBOD39rK99m+DkmxD9m0i+k=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231016124941-f6dc59b3b0ff/go.mod h1:5ojn2lxD9wd5sF0KYaHBDcpUC3ACFgqr0XG1atCIeAs=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231101111158-6c1993b3d9ae h1:ryMYcnorBrjYme+1y+f0b7Jdh3rLpkprC+60mfN8tZM=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231101111158-6c1993b3d9ae/go.mod h1:gZcnx3O0sm+mEO2INhKDHw+iUzJH5tPaX4cv5SN5tsQ=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231101111158-6c1993b3d9ae h1:4NMIuQQyqLisG7cJoYU8E8tRq6mz1yKvCOdGc0h2EF4=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231101111158-6c1993b3d9ae/go.mod h1:5ojn2lxD9wd5sF0KYaHBDcpUC3ACFgqr0XG1atCIeAs=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E=
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
Expand Down
5 changes: 5 additions & 0 deletions install/scripts/start-ec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ if [ "$CLIENT" = "geth" ]; then
DB_ENGINE="--db.engine=pebble"
fi

# Use new state stoore scheme if requested
if [ "$STADER_GETH_ENABLE_PBSS" = "true" ]; then
CMD="$CMD --state.scheme=path"
fi

# Init the zhejiang data if necessary
if [ "$NETWORK" = "zhejiang" ]; then
if [ ! -f "/ethclient/zhejiang.init" ]; then
Expand Down
1 change: 1 addition & 0 deletions install/templates/eth1.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ services:
- TX_FEE_CAP=${TX_FEE_CAP}
- TX_FEE_CAP_IN_WEI=${TX_FEE_CAP_IN_WEI}
- TX_FEE_CAP_IN_GWEI=${TX_FEE_CAP_IN_GWEI}
- STADER_GETH_ENABLE_PBSS=${GETH_ENABLE_PBSS}
entrypoint: sh
command: "/setup/start-ec.sh"
cap_drop:
Expand Down
4 changes: 2 additions & 2 deletions shared/services/config/besu-params.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (

// Constants
const (
besuTagTest string = "hyperledger/besu:23.7.1"
besuTagProd string = "hyperledger/besu:23.7.1"
besuTagTest string = "hyperledger/besu:23.10.0"
besuTagProd string = "hyperledger/besu:23.10.0"
besuEventLogInterval int = 1000
besuMaxPeers uint16 = 25
besuStopSignal string = "SIGTERM"
Expand Down
20 changes: 18 additions & 2 deletions shared/services/config/geth-params.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

// Constants
const (
gethTagProd string = "ethereum/client-go:v1.12.2"
gethTagTest string = "ethereum/client-go:v1.12.2"
gethTagProd string = "ethereum/client-go:v1.13.2"
gethTagTest string = "ethereum/client-go:v1.13.2"
gethEventLogInterval int = 1000
gethStopSignal string = "SIGTERM"
)
Expand Down Expand Up @@ -59,6 +59,9 @@ type GethConfig struct {
// The Docker Hub tag for Geth
ContainerTag config.Parameter `yaml:"containerTag,omitempty"`

// The flag for enabling PBSS
EnablePbss config.Parameter `yaml:"enablePbss,omitempty"`

// Custom command line flags
AdditionalFlags config.Parameter `yaml:"additionalFlags,omitempty"`
}
Expand Down Expand Up @@ -131,6 +134,18 @@ func NewGethConfig(cfg *StaderConfig) *GethConfig {
OverwriteOnUpgrade: true,
},

EnablePbss: config.Parameter{
ID: "enablePbss",
Name: "Enable PBSS",
Description: "Enable Geth's new path-based state scheme. With this enabled, you will no longer need to manually prune Geth; it will automatically prune its database in real-time.\n\n[orange]NOTE:\nEnabling this will require you to remove and resync your Geth DB using `stader-cli service resync-eth1`.\nYou will need a synced fallback node configured before doing this, or you will no longer be able to attest until it has finished resyncing!",
Type: config.ParameterType_Bool,
Default: map[config.Network]interface{}{config.Network_All: false},
AffectsContainers: []config.ContainerID{config.ContainerID_Eth1},
EnvironmentVariables: []string{"GETH_ENABLE_PBSS"},
CanBeBlank: false,
OverwriteOnUpgrade: false,
},

AdditionalFlags: config.Parameter{
ID: "additionalFlags",
Name: "Additional Flags",
Expand Down Expand Up @@ -181,6 +196,7 @@ func (cfg *GethConfig) GetParameters() []*config.Parameter {
&cfg.MaxPeers,
&cfg.UsePebble,
&cfg.ContainerTag,
&cfg.EnablePbss,
&cfg.AdditionalFlags,
}
}
Expand Down
8 changes: 4 additions & 4 deletions shared/services/config/lighthouse-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
)

const (
lighthouseTagPortableTest string = "sigp/lighthouse:v4.3.0"
lighthouseTagPortableProd string = "sigp/lighthouse:v4.3.0"
lighthouseTagModernTest string = "sigp/lighthouse:v4.3.0-modern"
lighthouseTagModernProd string = "sigp/lighthouse:v4.3.0-modern"
lighthouseTagPortableTest string = "sigp/lighthouse:v4.5.0"
lighthouseTagPortableProd string = "sigp/lighthouse:v4.5.0"
lighthouseTagModernTest string = "sigp/lighthouse:v4.5.0-modern"
lighthouseTagModernProd string = "sigp/lighthouse:v4.5.0-modern"
defaultLhMaxPeers uint16 = 80
)

Expand Down
4 changes: 2 additions & 2 deletions shared/services/config/lodestar-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

const (
lodestarTagTest string = "chainsafe/lodestar:v1.10.0"
lodestarTagProd string = "chainsafe/lodestar:v1.10.0"
lodestarTagTest string = "chainsafe/lodestar:v1.11.3"
lodestarTagProd string = "chainsafe/lodestar:v1.11.3"
defaultLodestarMaxPeers uint16 = 50
)

Expand Down
25 changes: 25 additions & 0 deletions shared/services/config/mev-boost-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ type MevBoostConfig struct {
// Aestus relay
AestusRelay config.Parameter `yaml:"aestusEnabled,omitempty"`

// Agnostic relay
AgnosticRelay config.Parameter `yaml:"AgnoticEnabled,omitempty"`

// The RPC port
Port config.Parameter `yaml:"port,omitempty"`

Expand Down Expand Up @@ -172,6 +175,7 @@ func NewMevBoostConfig(cfg *StaderConfig) *MevBoostConfig {
EdenRelay: generateRelayParameter("edenEnabled", relayMap[config.MevRelayID_Eden]),
UltrasoundRelay: generateRelayParameter("ultrasoundEnabled", relayMap[config.MevRelayID_Ultrasound]),
AestusRelay: generateRelayParameter("aestusEnabled", relayMap[config.MevRelayID_Aestus]),
AgnosticRelay: generateRelayParameter("agnosticEnabled", relayMap[config.MevRelayID_Agnostic]),

Port: config.Parameter{
ID: "port",
Expand Down Expand Up @@ -253,6 +257,7 @@ func (cfg *MevBoostConfig) GetParameters() []*config.Parameter {
&cfg.EdenRelay,
&cfg.UltrasoundRelay,
&cfg.AestusRelay,
&cfg.AgnosticRelay,
&cfg.Port,
&cfg.OpenRpcPort,
&cfg.ContainerTag,
Expand Down Expand Up @@ -378,6 +383,13 @@ func (cfg *MevBoostConfig) GetEnabledMevRelays() []config.MevRelay {
relays = append(relays, cfg.relayMap[config.MevRelayID_Aestus])
}
}

if cfg.AgnosticRelay.Value == true {
_, exists := cfg.relayMap[config.MevRelayID_Agnostic].Urls[currentNetwork]
if exists {
relays = append(relays, cfg.relayMap[config.MevRelayID_Agnostic])
}
}
}

return relays
Expand Down Expand Up @@ -478,6 +490,19 @@ func createDefaultRelays() []config.MevRelay {
Regulated: false,
NoSandwiching: false,
},
// Agnostic
{
ID: config.MevRelayID_Agnostic,
Name: "Agnostic",
Description: "Agnostic Relay is an open-source MEV Boost relay available to anyone, anywhere in the world, without prejudice or privilege. It is an ideal relay for block producers and block builders trying to provide neutral features.",
Urls: map[config.Network]string{
config.Network_Mainnet: "https://0xa7ab7a996c8584251c8f925da3170bdfd6ebc75d50f5ddc4050a6fdc77f2a3b5fce2cc750d0865e05d7228af97d69561@agnostic-relay.net?id=staderlabs",
config.Network_Prater: "https://0xa6bcad37b5d647152a93c2807d8a56055f1e0d7480eb6505d46edc21593e400f0f13738bf2e892f85946234629a3036a@goerli.agnostic-relay.net?id=staderlabs",
config.Network_Devnet: "https://0xa6bcad37b5d647152a93c2807d8a56055f1e0d7480eb6505d46edc21593e400f0f13738bf2e892f85946234629a3036a@goerli.agnostic-relay.net?id=staderlabs",
},
Regulated: true,
NoSandwiching: false,
},
}

return relays
Expand Down
4 changes: 2 additions & 2 deletions shared/services/config/nethermind-params.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

// Constants
const (
nethermindTagProd string = "nethermind/nethermind:1.20.1"
nethermindTagTest string = "nethermind/nethermind:1.20.1"
nethermindTagProd string = "nethermind/nethermind:1.21.0"
nethermindTagTest string = "nethermind/nethermind:1.21.0"
nethermindEventLogInterval int = 1000
nethermindStopSignal string = "SIGTERM"
)
Expand Down
10 changes: 5 additions & 5 deletions shared/services/config/nimbus-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
)

const (
// Prater
nimbusBnTagTest string = "statusim/nimbus-eth2:multiarch-v23.8.0"
nimbusVcTagTest string = "statusim/nimbus-validator-client:multiarch-v23.8.0"
// Testnet
nimbusBnTagTest string = "statusim/nimbus-eth2:multiarch-v23.9.1"
nimbusVcTagTest string = "statusim/nimbus-validator-client:multiarch-v23.9.1"

// Mainnet
nimbusBnTagProd string = "statusim/nimbus-eth2:multiarch-v23.8.0"
nimbusVcTagProd string = "statusim/nimbus-validator-client:multiarch-v23.8.0"
nimbusBnTagProd string = "statusim/nimbus-eth2:multiarch-v23.9.1"
nimbusVcTagProd string = "statusim/nimbus-validator-client:multiarch-v23.9.1"

defaultNimbusMaxPeersArm uint16 = 100
defaultNimbusMaxPeersAmd uint16 = 160
Expand Down
4 changes: 2 additions & 2 deletions shared/services/config/teku-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
)

const (
tekuTagTest string = "consensys/teku:23.8.0"
tekuTagProd string = "consensys/teku:23.8.0"
tekuTagTest string = "consensys/teku:23.10.0"
tekuTagProd string = "consensys/teku:23.10.0"
defaultTekuMaxPeers uint16 = 100
)

Expand Down
19 changes: 14 additions & 5 deletions shared/services/stader/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
// Config
const (
InstallerURL = "https://staderlabs.com/eth/releases" + shared.BinaryBucket + "/%s/install.sh"
UpdateURL = "https://staderlabs.com/eth/releases" + shared.BinaryBucket + "/%s/update_package.sh"

LegacyBackupFolder string = "old_config_backup"
SettingsFile string = "user-settings.yml"
Expand Down Expand Up @@ -498,8 +499,16 @@ func (c *Client) MigrateLegacyConfig(legacyConfigFilePath string, legacySettings
}

// Install the Stader service
func (c *Client) InstallService(verbose, noDeps bool, network, version, path string, dataPath string) error {
func (c *Client) InstallService(verbose, noDeps bool, network, version, path, dataPath string) error {
return c.executeScript(verbose, noDeps, network, version, path, dataPath, InstallerURL)
}

// Update the Stader package files
func (c *Client) UpdateStaderPackage(verbose, noDeps bool, network, version, path, dataPath string) error {
return c.executeScript(verbose, noDeps, network, version, path, dataPath, UpdateURL)
}

func (c *Client) executeScript(verbose, noDeps bool, network, version, path, dataPath, remoteURL string) error {
downloader, err := c.getDownloader()
if err != nil {
return err
Expand All @@ -521,7 +530,7 @@ func (c *Client) InstallService(verbose, noDeps bool, network, version, path str
}

// Initialize installation command
cmd, err := c.newCommand(fmt.Sprintf("%s %s | sh -s -- %s", downloader, fmt.Sprintf(InstallerURL, version), strings.Join(flags, " ")))
cmd, err := c.newCommand(fmt.Sprintf("%s %s | sh -s -- %s", downloader, fmt.Sprintf(remoteURL, version), strings.Join(flags, " ")))

if err != nil {
return err
Expand Down Expand Up @@ -789,18 +798,18 @@ func (c *Client) UpdateGuardianConfiguration(contents []byte) error {

guardianTemplatePath, err := homedir.Expand(fmt.Sprintf("%s/%s/%s", c.configPath, templatesDir, GuardianFileTemplate))
if err != nil {
return fmt.Errorf("Error expanding Guardian template path: %w", err)
return fmt.Errorf("error expanding Guardian template path: %w", err)
}

guardianConfigPath, err := homedir.Expand(fmt.Sprintf("%s/%s", c.configPath, GuardianFile))
if err != nil {
return fmt.Errorf("Error expanding guardian config file path: %w", err)
return fmt.Errorf("error expanding guardian config file path: %w", err)
}

// Write the actual Prometheus config file
err = os.WriteFile(guardianTemplatePath, contents, 0664)
if err != nil {
return fmt.Errorf("Could not write guardian config file to %s: %w", shellescape.Quote(guardianConfigPath), err)
return fmt.Errorf("could not write guardian config file to %s: %w", shellescape.Quote(guardianConfigPath), err)
}

return nil
Expand Down
24 changes: 16 additions & 8 deletions shared/services/state/network-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package state

import (
"fmt"
"math/big"
"time"

"github.com/stader-labs/stader-node/shared/services"
"github.com/stader-labs/stader-node/shared/utils/stdr"
"github.com/stader-labs/stader-node/stader-lib/contracts"
"github.com/urfave/cli"
"math/big"
"time"

"github.com/stader-labs/stader-node/shared/utils/math"
"github.com/stader-labs/stader-node/stader-lib/utils/eth"
Expand All @@ -31,6 +32,8 @@ import (
"github.com/ethereum/go-ethereum/common"
)

const SixDecimalRound = 6

type MetricDetails struct {
// Network details

Expand Down Expand Up @@ -480,14 +483,19 @@ func CreateMetricsCache(
metricsDetails.FrontRunValidators = frontRunValidators
metricsDetails.InvalidSignatureValidators = invalidSignatureValidators
metricsDetails.FundsSettledValidators = fundsSettledValidators
metricsDetails.CumulativePenalty = math.RoundDown(eth.WeiToEth(cumulativePenalty), 2)
metricsDetails.CumulativePenalty = math.RoundDown(eth.WeiToEth(cumulativePenalty), SixDecimalRound)
metricsDetails.UnclaimedClRewards = math.RoundDown(eth.WeiToEth(totalClRewards), 18)
metricsDetails.NextSocializingPoolRewardCycle = nextRewardCycleDetails
metricsDetails.UnclaimedNonSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(operatorElRewards.OperatorShare), 2)
metricsDetails.ClaimedSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.claimedEth), 2)
metricsDetails.ClaimedSocializingPoolSdRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.claimedSd), 2)
metricsDetails.UnclaimedSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.unclaimedEth), 2)
metricsDetails.UnclaimedSocializingPoolSDRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.unclaimedSd), 2)

// Claimed
metricsDetails.ClaimedSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.claimedEth), SixDecimalRound)
metricsDetails.ClaimedSocializingPoolSdRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.claimedSd), SixDecimalRound)

// Unclaimed
metricsDetails.UnclaimedNonSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(operatorElRewards.OperatorShare), SixDecimalRound)

metricsDetails.UnclaimedSocializingPoolElRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.unclaimedEth), SixDecimalRound)
metricsDetails.UnclaimedSocializingPoolSDRewards = math.RoundDown(eth.WeiToEth(rewardClaimData.unclaimedSd), SixDecimalRound)

state.StaderNetworkDetails = metricsDetails

Expand Down
5 changes: 5 additions & 0 deletions shared/types/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type NimbusPruningMode string

// Enum to describe which container(s) a parameter impacts, so the Stadernode knows which
// ones to restart upon a settings change
//
//revive:disable
const (
ContainerID_Unknown ContainerID = ""
ContainerID_Api ContainerID = "api"
Expand Down Expand Up @@ -112,9 +114,12 @@ const (
MevRelayID_Eden MevRelayID = "eden"
MevRelayID_Ultrasound MevRelayID = "ultrasound"
MevRelayID_Aestus MevRelayID = "aestus"
MevRelayID_Agnostic MevRelayID = "agnostic"
)

// Enum to describe MEV-Boost relay selection mode
//
//revive:enable
const (
MevSelectionMode_Unknow MevSelectionMode = ""
MevSelectionMode_Profile MevSelectionMode = "profile"
Expand Down
2 changes: 1 addition & 1 deletion shared/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package shared

const BinaryBucket string = "/stader-node-build/permissionless"
const DockerAccount string = "staderlabs"
const StaderVersion string = "1.4.2"
const StaderVersion string = "1.4.3-dev"

const Logo string = `
_____ _ _ _ _ 𝅺
Expand Down
Loading
Loading