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

refactor: move network validation to GetFullNodeAPIV1Curio #345

Merged

Conversation

Winter-Soren
Copy link
Contributor

This PR implements network validation at the API connection level to prevent mismatched network connections early in the startup process.

Changes:

  1. Removed separate network validation function and use existing build.BuildTypeString()
  2. Moved network validation from run.go to GetFullNodeAPIV1Curio()
  3. Added validation for each chain node with proper error handling and logging
  4. Only proceeds if at least one compatible node is found

Fixes #340

Copy link
Contributor

@LexLuthr LexLuthr left a 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 Show resolved Hide resolved
cmd/curio/run.go Outdated Show resolved Hide resolved
deps/apiinfo.go Show resolved Hide resolved
deps/apiinfo.go Outdated Show resolved Hide resolved
Copy link
Contributor

@LexLuthr LexLuthr left a 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.

cmd/curio/run.go Outdated Show resolved Hide resolved
@LexLuthr
Copy link
Contributor

LexLuthr commented Jan 6, 2025

@Winter-Soren Can you please run make gen in the curio repo? It should fix the failing test. It might complaint about missing dependencies, please install those.

@LexLuthr
Copy link
Contributor

@Winter-Soren Follow up on last message. Can you please finish the PR so we can merge this?

Copy link
Contributor

@LexLuthr LexLuthr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the following changed to fix the conflict.

cmd/curio/run.go Outdated Show resolved Hide resolved
deps/apiinfo.go Outdated Show resolved Hide resolved
@Winter-Soren
Copy link
Contributor Author

@LexLuthr as suggested I have added the build package "github.com/filecoin-project/curio/build" in apiinfo.go
but its still failing.

@LexLuthr
Copy link
Contributor

@Winter-Soren https://app.circleci.com/pipelines/github/filecoin-project/curio/1566/workflows/bfbb7f65-b38a-4802-b754-0f0d3bfa6352/jobs/13668 will tell you why test are not passing. We group the go dependencies. Just run make fix-imports and commit the changes. It should fix the test.

@LexLuthr
Copy link
Contributor

@Winter-Soren Can we please finish this PR? Can you please make the requested changes so tests can pass?

@Winter-Soren Winter-Soren requested a review from LexLuthr January 16, 2025 20:15
@Winter-Soren
Copy link
Contributor Author

@LexLuthr I’ve run the make fix-imports command as suggested, and it seems that all test cases have passed.

@LexLuthr LexLuthr merged commit 156ad37 into filecoin-project:main Jan 17, 2025
32 checks passed
@magik6k magik6k mentioned this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refuse to start if binary network doesn't match chain node network
2 participants