Skip to content

Commit

Permalink
Merge pull request #126 from stader-labs/update_copies
Browse files Browse the repository at this point in the history
Remove no longer support relays
  • Loading branch information
batphonghan authored Oct 11, 2023
2 parents d22895a + 0485d7e commit 8b12f4e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 69 deletions.
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-20230926094913-43f98210e69c
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20230926094913-43f98210e69c
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231010150025-cdbbe61da8dc
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231010150025-cdbbe61da8dc
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-20230926094913-43f98210e69c h1:HTFSDQ0xaeY6Rj9mEoYmT2Byl8Qk195KG+VMi5ig57E=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20230926094913-43f98210e69c/go.mod h1:gZcnx3O0sm+mEO2INhKDHw+iUzJH5tPaX4cv5SN5tsQ=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20230926094913-43f98210e69c h1:vaJB0NeDg5tewMgsYpp30gfX7CNp7qOQfgVqfEAkamw=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20230926094913-43f98210e69c/go.mod h1:5ojn2lxD9wd5sF0KYaHBDcpUC3ACFgqr0XG1atCIeAs=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231010150025-cdbbe61da8dc h1:vWFxcgi1WU9J2oY6rhUAAQS4R/c1Pbn63rcjyv4Bms4=
github.com/stader-labs/ethcli-ui/configuration v0.0.0-20231010150025-cdbbe61da8dc/go.mod h1:gZcnx3O0sm+mEO2INhKDHw+iUzJH5tPaX4cv5SN5tsQ=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231010150025-cdbbe61da8dc h1:hXzsyqCaeqm0s22ocuzGxs2rflHOg/QoX7zMYHJdGSE=
github.com/stader-labs/ethcli-ui/wizard v0.0.0-20231010150025-cdbbe61da8dc/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
50 changes: 1 addition & 49 deletions shared/services/config/mev-boost-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,12 @@ type MevBoostConfig struct {
// Flashbots relay
FlashbotsRelay config.Parameter `yaml:"flashbotsEnabled,omitempty"`

// bloXroute ethical relay
BloxRouteEthicalRelay config.Parameter `yaml:"bloxRouteEthicalEnabled,omitempty"`

// bloXroute max profit relay
BloxRouteMaxProfitRelay config.Parameter `yaml:"bloxRouteMaxProfitEnabled,omitempty"`

// bloXroute regulated relay
BloxRouteRegulatedRelay config.Parameter `yaml:"bloxRouteRegulatedEnabled,omitempty"`

// Blocknative relay
BlocknativeRelay config.Parameter `yaml:"blocknativeEnabled,omitempty"`

// Eden relay
EdenRelay config.Parameter `yaml:"edenEnabled,omitempty"`

Expand Down Expand Up @@ -174,9 +168,7 @@ func NewMevBoostConfig(cfg *StaderConfig) *MevBoostConfig {
// Explicit relay params
FlashbotsRelay: generateRelayParameter("flashbotsEnabled", relayMap[config.MevRelayID_Flashbots]),
BloxRouteMaxProfitRelay: generateRelayParameter("bloxRouteMaxProfitEnabled", relayMap[config.MevRelayID_BloxrouteMaxProfit]),
BloxRouteEthicalRelay: generateRelayParameter("bloxRouteEthicalEnabled", relayMap[config.MevRelayID_BloxrouteEthical]),
BloxRouteRegulatedRelay: generateRelayParameter("bloxRouteRegulatedEnabled", relayMap[config.MevRelayID_BloxrouteRegulated]),
BlocknativeRelay: generateRelayParameter("blocknativeEnabled", relayMap[config.MevRelayID_Blocknative]),
EdenRelay: generateRelayParameter("edenEnabled", relayMap[config.MevRelayID_Eden]),
UltrasoundRelay: generateRelayParameter("ultrasoundEnabled", relayMap[config.MevRelayID_Ultrasound]),
AestusRelay: generateRelayParameter("aestusEnabled", relayMap[config.MevRelayID_Aestus]),
Expand Down Expand Up @@ -256,10 +248,8 @@ func (cfg *MevBoostConfig) GetParameters() []*config.Parameter {
&cfg.EnableUnregulatedAllMev,
&cfg.EnableUnregulatedNoSandwich,
&cfg.FlashbotsRelay,
&cfg.BloxRouteEthicalRelay,
&cfg.BloxRouteMaxProfitRelay,
&cfg.BloxRouteRegulatedRelay,
&cfg.BlocknativeRelay,
&cfg.EdenRelay,
&cfg.UltrasoundRelay,
&cfg.AestusRelay,
Expand Down Expand Up @@ -356,12 +346,6 @@ func (cfg *MevBoostConfig) GetEnabledMevRelays() []config.MevRelay {
relays = append(relays, cfg.relayMap[config.MevRelayID_Flashbots])
}
}
if cfg.BloxRouteEthicalRelay.Value == true {
_, exists := cfg.relayMap[config.MevRelayID_BloxrouteEthical].Urls[currentNetwork]
if exists {
relays = append(relays, cfg.relayMap[config.MevRelayID_BloxrouteEthical])
}
}
if cfg.BloxRouteMaxProfitRelay.Value == true {
_, exists := cfg.relayMap[config.MevRelayID_BloxrouteMaxProfit].Urls[currentNetwork]
if exists {
Expand All @@ -374,12 +358,7 @@ func (cfg *MevBoostConfig) GetEnabledMevRelays() []config.MevRelay {
relays = append(relays, cfg.relayMap[config.MevRelayID_BloxrouteRegulated])
}
}
if cfg.BlocknativeRelay.Value == true {
_, exists := cfg.relayMap[config.MevRelayID_Blocknative].Urls[currentNetwork]
if exists {
relays = append(relays, cfg.relayMap[config.MevRelayID_Blocknative])
}
}

if cfg.EdenRelay.Value == true {
_, exists := cfg.relayMap[config.MevRelayID_Eden].Urls[currentNetwork]
if exists {
Expand Down Expand Up @@ -447,19 +426,6 @@ func createDefaultRelays() []config.MevRelay {
Regulated: false,
NoSandwiching: false,
},

// bloXroute Ethical
{
ID: config.MevRelayID_BloxrouteEthical,
Name: "bloXroute Ethical",
Description: "Select this to enable the \"ethical\" relay from bloXroute.",
Urls: map[config.Network]string{
config.Network_Mainnet: "https://0xad0a8bb54565c2211cee576363f3a347089d2f07cf72679d16911d740262694cadb62d7fd7483f27afd714ca0f1b9118@bloxroute.ethical.blxrbdn.com?id=staderlabs",
},
Regulated: false,
NoSandwiching: true,
},

// bloXroute Regulated
{
ID: config.MevRelayID_BloxrouteRegulated,
Expand All @@ -472,20 +438,6 @@ func createDefaultRelays() []config.MevRelay {
NoSandwiching: false,
},

// Blocknative
{
ID: config.MevRelayID_Blocknative,
Name: "Blocknative",
Description: "Blocknative is a large blockchain infrastructure company that provides a popular MEV relay.",
Urls: map[config.Network]string{
config.Network_Mainnet: "https://0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@builder-relay-mainnet.blocknative.com?id=staderlabs",
config.Network_Prater: "https://0x8f7b17a74569b7a57e9bdafd2e159380759f5dc3ccbd4bf600414147e8c4e1dc6ebada83c0139ac15850eb6c975e82d0@builder-relay-goerli.blocknative.com?id=staderlabs",
config.Network_Devnet: "https://0x8f7b17a74569b7a57e9bdafd2e159380759f5dc3ccbd4bf600414147e8c4e1dc6ebada83c0139ac15850eb6c975e82d0@builder-relay-goerli.blocknative.com?id=staderlabs",
},
Regulated: true,
NoSandwiching: false,
},

// Eden
{
ID: config.MevRelayID_Eden,
Expand Down
2 changes: 1 addition & 1 deletion shared/types/api/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ type CanUpdateOperatorRewardAddress struct {
OperatorRewardAddressZero bool `json:"operatorRewardAddressZero"`
NothingToUpdate bool `json:"nothingToUpdate"`
IsPermissionlessNodeRegistryPaused bool `json:"isPermissionlessNodeRegistryPaused"`
OperatorAddressAndRewardNotTheSame bool `json:operatorAddressAndRewardNotTheSame`
OperatorAddressAndRewardNotTheSame bool `json:"operatorAddressAndRewardNotTheSame"`
GasInfo stader.GasInfo `json:"gasInfo"`
}

Expand Down
2 changes: 0 additions & 2 deletions shared/types/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ const (
const (
MevRelayID_Unknown MevRelayID = ""
MevRelayID_Flashbots MevRelayID = "flashbots"
MevRelayID_BloxrouteEthical MevRelayID = "bloxrouteEthical"
MevRelayID_BloxrouteMaxProfit MevRelayID = "bloxrouteMaxProfit"
MevRelayID_BloxrouteRegulated MevRelayID = "bloxrouteRegulated"
MevRelayID_Blocknative MevRelayID = "blocknative"
MevRelayID_Eden MevRelayID = "eden"
MevRelayID_Ultrasound MevRelayID = "ultrasound"
MevRelayID_Aestus MevRelayID = "aestus"
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.3.0"
const StaderVersion string = "1.4.0"

const Logo string = `
_____ _ _ _ _ 𝅺
Expand Down
2 changes: 1 addition & 1 deletion stader-cli/node/update-operator-reward-address.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func SetRewardAddress(c *cli.Context, operatorRewardAddress common.Address) erro
return err
}

fmt.Printf("%sYour reward address changed in pending state. Please \nconfirm the request using this contract: %s and the reward address.%s", infoResponse.PermissionlessNodeRegistry, colorLightBlue, colorReset)
fmt.Printf("%sYour reward address changed in pending state. Please \nconfirm the request using this contract: %s and the reward address.%s", colorLightBlue, infoResponse.PermissionlessNodeRegistry, colorReset)

return nil
}
Expand Down
6 changes: 1 addition & 5 deletions stader-cli/service/configMEVBoost.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func setUIMEVBoost(cfg *stdCf.StaderConfig, newSettings map[string]interface{})
// Relay Mode
newSettings[keys.Mev_boost_rm_enable_flashbots] = cfg.MevBoost.FlashbotsRelay.Value.(bool)
newSettings[keys.Mev_boost_rm_enable_bloXroute_max_profit] = cfg.MevBoost.BloxRouteMaxProfitRelay.Value.(bool)
newSettings[keys.Mev_boost_rm_enable_blocknative] = cfg.MevBoost.BlocknativeRelay.Value.(bool)
newSettings[keys.Mev_boost_rm_enable_eden_network] = cfg.MevBoost.EdenRelay.Value.(bool)
newSettings[keys.Mev_boost_rm_enable_ultra_sound] = cfg.MevBoost.UltrasoundRelay.Value.(bool)

Expand All @@ -57,8 +56,6 @@ func setUIMEVBoost(cfg *stdCf.StaderConfig, newSettings map[string]interface{})
newSettings[keys.Mev_boost_rm_container_tag] = cfg.MevBoost.ContainerTag.Value
newSettings[keys.Mev_boost_rm_additional_flags] = cfg.MevBoost.AdditionalFlags.Value

newSettings[keys.Mev_boost_rm_enable_bloXroute_ethical] = cfg.MevBoost.BloxRouteEthicalRelay.Value.(bool)

v, _ := cfg.MevBoost.AestusRelay.Value.(bool)
newSettings[keys.Mev_boost_rm_enable_aestus] = v

Expand All @@ -84,11 +81,10 @@ func updateMEVBoost(cfg *stdCf.StaderConfig, newSettings map[string]interface{})
// Relay Mode
cfg.MevBoost.FlashbotsRelay.Value = newSettings[keys.Mev_boost_rm_enable_flashbots]
cfg.MevBoost.BloxRouteMaxProfitRelay.Value = newSettings[keys.Mev_boost_rm_enable_bloXroute_max_profit]
cfg.MevBoost.BlocknativeRelay.Value = newSettings[keys.Mev_boost_rm_enable_blocknative]

cfg.MevBoost.EdenRelay.Value = newSettings[keys.Mev_boost_rm_enable_eden_network]
cfg.MevBoost.UltrasoundRelay.Value = newSettings[keys.Mev_boost_rm_enable_ultra_sound]

cfg.MevBoost.BloxRouteEthicalRelay.Value = newSettings[keys.Mev_boost_rm_enable_bloXroute_ethical]
cfg.MevBoost.BloxRouteRegulatedRelay.Value = newSettings[keys.Mev_boost_rm_enable_bloXroute_regulated]
cfg.MevBoost.AestusRelay.Value = newSettings[keys.Mev_boost_rm_enable_aestus]

Expand Down
8 changes: 4 additions & 4 deletions stader-cli/service/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func migrate(c *cli.Context) ([]ConfigUpgrader, error) {
}

// Create versions
v131, err := parseVersion("1.3.1")
v140, err := parseVersion("1.4.0")
if err != nil {
return nil, err
}
Expand All @@ -37,8 +37,8 @@ func migrate(c *cli.Context) ([]ConfigUpgrader, error) {
upgradeFunc: upgradeFuncV30,
},
{
version: v131,
upgradeFunc: upgradeFuncV31,
version: v140,
upgradeFunc: upgradeFuncV140,
},
}

Expand Down Expand Up @@ -90,7 +90,7 @@ func upgradeFuncV30(c *cli.Context) error {
return nil
}

func upgradeFuncV31(c *cli.Context) error {
func upgradeFuncV140(c *cli.Context) error {
staderClient, err := stader.NewClientFromCtx(c)
if err != nil {
return fmt.Errorf("error NewClientFromCtx: %w", err)
Expand Down

0 comments on commit 8b12f4e

Please sign in to comment.