-
Notifications
You must be signed in to change notification settings - Fork 671
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 chain manager subnets #2711
Merged
Merged
Conversation
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
joshua-kim
force-pushed
the
refactor-chains-subnets
branch
4 times, most recently
from
February 7, 2024 16:06
357bc93
to
bed8d13
Compare
joshua-kim
changed the title
refactor chain manager subnets
Refactor chain manager subnets
Feb 7, 2024
joshua-kim
force-pushed
the
refactor-chains-subnets
branch
4 times, most recently
from
February 7, 2024 16:37
b220924
to
a8e7e35
Compare
joshua-kim
commented
Feb 7, 2024
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
joshua-kim
force-pushed
the
refactor-chains-subnets
branch
from
February 7, 2024 17:12
a8e7e35
to
a625386
Compare
aaronbuchwald
approved these changes
Feb 7, 2024
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.
LGTM with optional nits
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com> Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
darioush
approved these changes
Feb 7, 2024
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.
Running locally resulted in:
[02-10|13:01:49.389] INFO node/node.go:899 initializing chains
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1028a12c8]
goroutine 1 [running]:
github.com/ava-labs/avalanchego/chains.(*Subnets).Get(0x0?, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
/Users/stephen/go/src/github.com/ava-labs/avalanchego/chains/subnets.go:50 +0x28
github.com/ava-labs/avalanchego/chains.(*manager).StartChainCreator(0x14002a64380, {{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
/Users/stephen/go/src/github.com/ava-labs/avalanchego/chains/manager.go:1337 +0x4c
github.com/ava-labs/avalanchego/node.(*Node).initChains(0x1400024b200, {0x1400175f800, 0x1bc2, 0x3800})
/Users/stephen/go/src/github.com/ava-labs/avalanchego/node/node.go:910 +0x12c
github.com/ava-labs/avalanchego/node.New(0x140000d7600, {0x1039e9b18, 0x14000362380}, {0x1039f0320, 0x14000398080})
/Users/stephen/go/src/github.com/ava-labs/avalanchego/node/node.go:261 +0x14e4
github.com/ava-labs/avalanchego/app.New({{{0x6fc23ac00, 0x6fc23ac00, 0x6fc23ac00, 0x1bf08eb000}, {{0x0, {...}}, {0x0, 0x0}, {0x0, {...}, ...}, ...}, ...}, ...})
/Users/stephen/go/src/github.com/ava-labs/avalanchego/app/app.go:73 +0x3a0
main.main()
/Users/stephen/go/src/github.com/ava-labs/avalanchego/main/main.go:48 +0x2cc
(which is presumably why all the E2E tests are failing).
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
StephenButtolph
approved these changes
Feb 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
Needed as a pre-requisite to remove
vm.Initialize
. This refactors the currently running subnets into its own struct, so it can be shared with a futurechains.Factory
struct which will be responsible for creatingchain
instances (currently this is created internally in the chain manager). Ideally we'll have a chain factory to create chains and a chain manager that holds the chains that are currently running. This way, the chain manager doesn't need to know about the p-chain at all since the caller can choose arguments passed into the chain factory instead and the p-chain logic can be in the caller instead of inchains/manager
How this works
Refactors currently running subnets into its own struct
How this was tested
Added unit tests