-
Notifications
You must be signed in to change notification settings - Fork 741
Refactor feature extensions out of VMManager #2578
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
Merged
Merged
Conversation
This file contains hidden or 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
53b9485
to
4763258
Compare
4763258
to
6dee9e9
Compare
6dee9e9
to
c27a8a4
Compare
joshua-kim
commented
Jan 17, 2024
|
||
// Factory returns an instance of a feature extension | ||
type Factory interface { | ||
New() any |
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.
Another idea is to return an fx.Interface
interface here, but we're already currently returning the any
type so I'm going to punt this off to a follow-up since my focus is to currently just refactor the vm code.
c27a8a4
to
bdba82a
Compare
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
bdba82a
to
7bff8b9
Compare
StephenButtolph
approved these changes
Jan 19, 2024
dhrubabasu
approved these changes
Jan 19, 2024
dhrubabasu
approved these changes
Jan 19, 2024
chand1012
pushed a commit
to multisig-labs/avalanchego
that referenced
this pull request
Oct 1, 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
Currently, all feature extension code is registered as a VM (even though they aren't actually VMs) under the
VMManager
. This leads to strange hacks like returning the opaqueany
type since we can return either a vm factory or an fx factory, which leads to us also having to perform more type casting to sanity check that we're actually using a vm instead of a potential fx.This PR hard-codes the fxs that we're using to just be a map, effectively deprecating plugin feature extensions that aren't used anyways. Only the AVM as far as I am aware is using these.
How this was tested
CI passes. Calling the GetVMs api additionally now only returns vms, instead of previously returning the feature extensions as well.