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

tmpnet: Break config.go up into coherent parts #2462

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

marun
Copy link
Contributor

@marun marun commented Dec 11, 2023

Largely mechanical reorganization to improve maintainability:

  • Move NetworkConfig functionality to Network
  • Move NodeConfig functionality to Node
  • Move FlagsMap to flags.go
  • Move genesis helpers to genesis.go
  • Move NodeURI and key generation to utils.go
  • Remove redundant node_test.go

@marun marun added the testing This primarily focuses on testing label Dec 11, 2023
@marun marun self-assigned this Dec 11, 2023
@marun marun force-pushed the tmpnet-refactor-config branch from 99909be to e446b6a Compare December 11, 2023 00:27
@marun marun force-pushed the tmpnet-move-local branch from 3e42f16 to 184b8d8 Compare December 11, 2023 03:19
@marun marun force-pushed the tmpnet-refactor-config branch from e446b6a to 0a2ab0a Compare December 11, 2023 03:21
@marun marun changed the title tmpnet: Break config.go up into coherent parts tmpnet: Break config.go up into coherent parts Dec 11, 2023
@marun marun force-pushed the tmpnet-move-local branch 2 times, most recently from ae08b7e to 19dca4a Compare December 11, 2023 18:58
@marun marun force-pushed the tmpnet-refactor-config branch from 0a2ab0a to 2597b74 Compare December 11, 2023 19:01
@marun marun marked this pull request as ready for review December 13, 2023 20:35
@marun marun requested review from abi87 and gyuho as code owners December 13, 2023 20:35
@marun marun force-pushed the tmpnet-move-local branch 2 times, most recently from e20e8f7 to 93dc814 Compare December 14, 2023 00:27
@marun marun force-pushed the tmpnet-refactor-config branch from 5c35f62 to dab364e Compare December 14, 2023 00:33
@marun marun force-pushed the tmpnet-move-local branch from 4b22d47 to cb968e8 Compare December 15, 2023 02:49
@marun marun force-pushed the tmpnet-refactor-config branch from dab364e to e338c6e Compare December 15, 2023 02:50
Base automatically changed from tmpnet-move-local to dev December 15, 2023 04:27
@marun marun force-pushed the tmpnet-refactor-config branch from e338c6e to fe08729 Compare December 15, 2023 04:38
- Move NetworkConfig functionality to Network
- Move NodeConfig functionality to Node
- Move FlagsMap to flags.go
- Move genesis helpers to genesis.go
- Move NodeURI and key generation to utils.go
- Remove redundant node_test.go
@marun marun force-pushed the tmpnet-refactor-config branch from fe08729 to 205f6e8 Compare December 15, 2023 04:42
@@ -19,6 +19,15 @@ const (
DefaultNetworkStartTimeout = 2 * time.Minute
DefaultNodeInitTimeout = 10 * time.Second
DefaultNodeStopTimeout = 5 * time.Second

// Minimum required to ensure connectivity-based health checks will pass
DefaultNodeCount = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

probably out of scope here but should this be MinNodeCount? And should we assert that we never have a single node network? Not sure if the latter is too restrictive for our testing.

Copy link
Contributor Author

@marun marun Dec 15, 2023

Choose a reason for hiding this comment

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

Funny, I had the same thought. I figured default made a bit more sense even if 2 happens to be the minimum.

I don't think anyone should be starting a single node network with the tmpnet fixture - easier to just run the binary yourself. Attempting to do so would fail by default, would require disabling sybil protection. I'm inclined to ignore that possibility until such time as it becomes a requirement.

Copy link
Contributor

@abi87 abi87 left a comment

Choose a reason for hiding this comment

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

just nits and questions

@StephenButtolph StephenButtolph added this to the v1.10.18 milestone Dec 15, 2023
@StephenButtolph StephenButtolph added this pull request to the merge queue Dec 15, 2023
Merged via the queue into dev with commit 2dcce4c Dec 15, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the tmpnet-refactor-config branch December 15, 2023 17:52
@marun marun linked an issue Dec 18, 2023 that may be closed by this pull request
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add subnet support to the tmpnet fixture
4 participants