-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
remove transaction forwarder trait #9678
remove transaction forwarder trait #9678
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.
awesome
some design suggestion,
needs input from @emhane on how to include the sequencer URL in the nodeaddon / op-ethapi builder
not sure if we can remove the trait |
I see, @nkysg I'll try something with this to get this unblocked and will get back to you |
I have tried add pub ext_args: Addons::ExtArgs in pub struct Addons pub struct AddOns<Node: FullNodeComponents, AddOns: NodeAddOns<Node>> {
/// Additional `NodeHooks` that are called at specific points in the node's launch lifecycle.
pub hooks: NodeHooks<Node, AddOns>,
/// The `ExExs` (execution extensions) of the node.
pub exexs: Vec<(String, Box<dyn BoxedLaunchExEx<Node>>)>,
/// Additional RPC add-ons.
pub rpc: RpcAddOns<Node, AddOns::EthApi>,
/// Additional node add-ons args.
+ pub ext_args: AddOns::ExtArgs,
}
pub trait NodeAddOns<N: FullNodeComponents>: Send + Sync + Unpin + Clone + 'static {
/// The core `eth` namespace API type to install on the RPC server (see
/// `reth_rpc_eth_api::EthApiServer`).
type EthApi: Send + Clone;
/// The extent arguments required for the node add-ons.
+ type ExtArgs: Send + Clone + Default;
}
impl<N: FullNodeComponents> NodeAddOns<N> for OptimismAddOns {
type EthApi = OpEthApi<N>;
+ type ExtArgs = Option<String>;
} And I have defined func update_ext_args in WithLaunchContext and NodeBuilderWithComponents impl<T, CB, AO> WithLaunchContext<NodeBuilderWithComponents<T, CB, AO>>
where
T: FullNodeTypes,
CB: NodeComponentsBuilder<T>,
AO: NodeAddOns<NodeAdapter<T, CB::Components>>,
AO::EthApi: FullEthApiServer + AddDevSigners,
{
/// Update Addons extent args
pub fn update_ext_args(self, args: AO::ExtArgs) -> Self {
Self { builder: self.builder.update_ext_args(args), task_executor: self.task_executor }
}
}
impl<T, CB, AO> NodeBuilderWithComponents<T, CB, AO>
where
T: FullNodeTypes,
CB: NodeComponentsBuilder<T>,
AO: NodeAddOns<NodeAdapter<T, CB::Components>>,
{
/// update the AddOns extent args
pub fn update_ext_args(mut self, args: AO::ExtArgs) -> Self {
self.add_ons.ext_args = args;
self
}
} right now I need to process the ext_args into EngineApi::new, async fn launch_node(
self,
target: NodeBuilderWithComponents<T, CB, AO>,
) -> eyre::Result<Self::Node> {
let NodeBuilderWithComponents {
adapter: NodeTypesAdapter { database },
components_builder,
add_ons: AddOns { hooks, rpc, exexs: installed_exex, ext_args: ext_args },
config,
} = target;
....
let engine_api = EngineApi::new(
ctx.blockchain_db().clone(),
ctx.chain_spec(),
beacon_engine_handle,
ctx.components().payload_builder().clone().into(),
Box::new(ctx.task_executor().clone()),
client,
EngineCapabilities::default(),
); one q, How to pass the ext_args and then I can call below func as your mentioned reth/crates/optimism/rpc/src/eth/mod.rs Lines 176 to 180 in 5a9de03
@mattsse please take look at it. Thx |
you need to add the |
Thanks for your guiding. After #10028, I will try this. |
on second look, addressing issue #9562 shouldn't have to touch |
Got it. I will try this. |
actually @nkysg, there should be no need for an |
@emhane I have this mind. Let's do it. |
check it out @nkysg, at this point, it should be known that the eth api type returned by Lines 38 to 47 in 8a802da
so we should be able to add method // register sequencer tx forwarder
if let Some(sequencer_http) = sequencer_http_arg {
ctx.registry.eth_api().set_eth_raw_transaction_forwarder(Arc::new(
SequencerClient::new(sequencer_http),
));
} |
need any help here @nkysg ? |
@emhane Thanks for your help. I need to look into it again. Something I forget it. |
b55284f
to
e56582c
Compare
I don't understand it. At #9562, Want to remove the two traits RawTransactionForwarder and UpdateRawTxForwarder @emhane |
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.
you're doing great!
b7b422a
to
cff0512
Compare
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.
killing it!
// submit the transaction to the pool with a `Local` origin | ||
let hash = self | ||
.pool() | ||
.add_transaction(TransactionOrigin::Local, pool_transaction) | ||
.await | ||
.map_err(Self::Error::from_eth_err)?; |
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.
wonder if this code can be deleted for op? I'm aware it is executed also for op on main...will open issue for it though
cff0512
to
e245a00
Compare
ref fields by name add set_sequencer_client
e245a00
to
6083862
Compare
I see, we can unassigned mattse. @emhane .Thx. |
Closes #9562