-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(sdk, node-builder): add BuilderInternals trait #14686
base: main
Are you sure you want to change the base?
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.
the internals trait makes sense if we can erase a bunch of additional generics,
but this currently cascades, because we no longer use any (internal) adapter types to deconstruct the builder state.
I think one issue here is that NodeBuilderWithComponents
directly wraps T
and not some (internal) helper struct that is generic over T.
I need to experiment with this a bit
@@ -165,7 +165,9 @@ where | |||
let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config.clone()) | |||
.testing_node(exec.clone()) | |||
.with_types_and_provider::<N, BlockchainProvider<_>>() | |||
.with_components(node.components_builder()) | |||
.with_components::<BuilderComponentsAdapter<FullNodeTypesAdapter<_, _, _>, _>>( |
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.
this we don't want because this leaks into user code, forcing the user to provide this adapter mapping
for EngineNodeLauncher | ||
where |
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.
hmm, I see because we removed the adapter type here this requires more bloat now?
pub components_builder: CB, | ||
/// Additional node extensions. | ||
pub add_ons: AddOns<NodeAdapter<T, CB::Components>, AO>, | ||
pub adapter: T, |
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 what we should try here is introducing an actual Adapter struct on this level, which I should would allow us to hide most of this, this is like nodeadapter but over internals.
then this maybe doesn't cascade
@@ -65,36 +67,42 @@ impl EngineNodeLauncher { | |||
} | |||
} | |||
|
|||
impl<Types, DB, T, CB, AO> LaunchNode<NodeBuilderWithComponents<T, CB, AO>> for EngineNodeLauncher | |||
impl<T> LaunchNode<NodeBuilderWithComponents<T>> |
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.
this looks a loot better I think
d8e9603
to
d0c05fa
Compare
d0c05fa
to
fd54886
Compare
Closes #14592