-
Notifications
You must be signed in to change notification settings - Fork 12
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
refactor: move network validation to GetFullNodeAPIV1Curio #345
base: main
Are you sure you want to change the base?
refactor: move network validation to GetFullNodeAPIV1Curio #345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cleanup from previous approach is pending.
build/params.go
Outdated
NetworkTestnet = "testnet" | ||
) | ||
|
||
func CurrentNetwork() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this function or above constants
cmd/curio/run.go
Outdated
@@ -135,7 +138,13 @@ var runCmd = &cli.Command{ | |||
return xerrors.Errorf("starting market RPCs: %w", err) | |||
} | |||
|
|||
err = rpc.ListenAndServe(ctx, dependencies, shutdownChan) // Monitor for shutdown. | |||
api, closer, err := lcli.GetFullNodeAPI(cctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though I already clarified that we don't need this in run in the original issue
deps/apiinfo.go
Outdated
fullNodes = append(fullNodes, v1api) | ||
closers = append(closers, closer) | ||
} | ||
|
||
if len(fullNodes) == 0 { | ||
return nil, nil, xerrors.Errorf("failed to establish connection with all nodes") | ||
return nil, nil, xerrors.Errorf("no compatible nodes found - all nodes had network mismatches or connection errors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to change this message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just need 1 last change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this file to its original form. There is still unused code there.
This PR implements network validation at the API connection level to prevent mismatched network connections early in the startup process.
Changes:
build.BuildTypeString()
run.go
toGetFullNodeAPIV1Curio()
Fixes #340