-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from nodeset-org/dev
Add Warnings about Reth
- Loading branch information
Showing
5 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
hyperdrive-cli/commands/service/config/step-ec-warnings.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/rocket-pool/node-manager-core/config" | ||
) | ||
|
||
const ( | ||
localRethWarning string = "[orange]WARNING: Reth is still in beta and has been shown to have some incompatibilities with the StakeWise Operator service, preventing you from submitting validator deposits properly. We strongly recommend you pick a different client instead until the incompatibility is fixed." | ||
externalRethWarning string = "[orange]WARNING: Reth is still in beta and has been shown to have some incompatibilities with the StakeWise Operator service, preventing you from submitting validator deposits properly. We strongly recommend avoiding it as your external client until the incompatibility is fixed." | ||
) | ||
|
||
// Get a more verbose client description, including warnings | ||
func getAugmentedLocalEcDescription(client config.ExecutionClient, originalDescription string) string { | ||
switch client { | ||
case config.ExecutionClient_Reth: | ||
if !strings.HasSuffix(originalDescription, localRethWarning) { | ||
return fmt.Sprintf("%s\n\n%s", originalDescription, localRethWarning) | ||
} | ||
} | ||
|
||
return originalDescription | ||
} | ||
|
||
// Get a more verbose client description, including warnings | ||
func getAugmentedExternalEcDescription(client config.ExecutionClient, originalDescription string) string { | ||
switch client { | ||
case config.ExecutionClient_Reth: | ||
if !strings.HasSuffix(originalDescription, externalRethWarning) { | ||
return fmt.Sprintf("%s\n\n%s", originalDescription, externalRethWarning) | ||
} | ||
} | ||
|
||
return originalDescription | ||
} | ||
|
||
func createLocalRethWarningStep(wiz *wizard, currentStep int, totalSteps int) *choiceWizardStep { | ||
helperText := localRethWarning | ||
|
||
show := func(modal *choiceModalLayout) { | ||
wiz.md.setPage(modal.page) | ||
modal.focus(0) | ||
} | ||
|
||
done := func(buttonIndex int, buttonLabel string) { | ||
if buttonIndex == 0 { | ||
wiz.localEcModal.show() | ||
} else { | ||
wiz.localBnModal.show() | ||
} | ||
} | ||
|
||
back := func() { | ||
wiz.localEcModal.show() | ||
} | ||
|
||
return newChoiceStep( | ||
wiz, | ||
currentStep, | ||
totalSteps, | ||
helperText, | ||
[]string{"Choose Again", "Keep Reth"}, | ||
[]string{}, | ||
76, | ||
"Execution Client > Selection", | ||
DirectionalModalHorizontal, | ||
show, | ||
done, | ||
back, | ||
"step-local-reth-warning", | ||
) | ||
} | ||
|
||
func createExternalRethWarningStep(wiz *wizard, currentStep int, totalSteps int) *choiceWizardStep { | ||
helperText := externalRethWarning | ||
|
||
show := func(modal *choiceModalLayout) { | ||
wiz.md.setPage(modal.page) | ||
modal.focus(0) | ||
} | ||
|
||
done := func(buttonIndex int, buttonLabel string) { | ||
wiz.externalEcSettingsModal.show() | ||
} | ||
|
||
back := func() { | ||
wiz.externalEcSelectModal.show() | ||
} | ||
|
||
return newChoiceStep( | ||
wiz, | ||
currentStep, | ||
totalSteps, | ||
helperText, | ||
[]string{"I Understand"}, | ||
[]string{}, | ||
76, | ||
"Execution Client (External) > Selection", | ||
DirectionalModalHorizontal, | ||
show, | ||
done, | ||
back, | ||
"step-external-reth-warning", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters