-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore(rpc): expose ethapi in node builder for op customisation #9444
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.
I'd like to explore if we can leave the AddOns type entirely up the user and instead have the AddOns type as an available AddOns that can be used in this location
…try generic over EthApi
…lder until as late as possible
…api builder until as late as possible
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.
cool, this gets us one step closer.
I believe there are some things we can simplify but I need to think about UX a bit first.
perhaps it's time to rethink some nodebuilder design approaches
only doc nit otherwise lgtm
ye, the whole node builder design could be simplified. in general I prefer
can't open the link! |
gh added this for some reason lol all of these points are valid, could you open an issue for this please ? |
done #9543 ! |
Closes #8781
Exposes customisable types encompassed by node-add ons.
AddOns: NodeAddOns<N: FullNodeComponents>
toNode
trait.NodeAddOns<N: FullNodeComponents>
, that aggregates the customisable types in node add-ons. This is future proof, so we don't have to add a new generic to many types in the node builder, if we make a new add-on type customisable, for example the engine rpc api implementation.NodeAddOns<N>
should have the new traitBuilderProvider<N: FullNodeComponents
as trait bound, as is done already for ATEthApi
. This way we defer instantiating the builder until the entry point to the specific library for this type, i.e. when we leavereth-node-builder
scope into thereth-rpc-builder
scope. This saves us a lot of hassle of passing around the specific builder instance inreth-node-builder
, which comes with the constraint that the type would need to beSend + Sync + Unpin + Default
among others to satisfies the existingreth-node-builder
code.BuilderProvider<N>
trait,EthApiBuilderProvider<N>
, which specifies the exact context type that needed to build theEthApi
. This requirement is set byreth-rpc-builder
and propagates toreth-node-builder
.OpEthApi<Eth>
into the node builder.