-
Notifications
You must be signed in to change notification settings - Fork 1.6k
staking miner: reuse ws conn for remote-ext #4849
staking miner: reuse ws conn for remote-ext #4849
Conversation
This reverts commit 5fddbbe.
…into na-staking-miner-reuse-ws-conn
From what I understand the changes lgtm. I looked at the diff via https://github.com/paritytech/polkadot/compare/na-staking-miner-playground..na-staking-miner-reuse-ws-conn# To make sure I understand please let me know if the following is correct:
|
You got everything correct Zeke again :) Yeah, we could wrap |
utils/staking-miner/src/rpc.rs
Outdated
|
||
/// Dry run an extrinsic at a given block. Return SCALE encoded ApplyExtrinsicResult. | ||
#[method(name = "system_dryRun", aliases = ["system_dryRunAt"])] | ||
async fn dry_run(&self, extrinsic: &Bytes, at: Option<&Hash>) -> RpcResult<Bytes>; |
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 Hash
is Copy
and making it a ref doesn't make sense
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.
fair enough, it was more to have a uniform API since all other methods takes that params by ref
but sure I can change that.
#[derive(Clone, Debug)] | ||
pub(crate) struct SharedRpcClient(Arc<WsClient>); | ||
|
||
impl Deref for SharedRpcClient { |
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.
noice
utils/staking-miner/src/rpc.rs
Outdated
Ok(Self(Arc::new(client))) | ||
} | ||
|
||
/// Get the storage item. |
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 would expect this doc to explain how this is different than self.storage
. In the same spirit, I would name it decode_storage
or get_storage_decoded
.
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.
very nice refactors, appreciated!
bot merge |
* master: (27 commits) Bump `tokio` to 1.17.0 (#4965) bump transaction_version (#4956) Bump tracing-subscriber from 0.3.8 to 0.3.9 (#4954) staking miner: reuse ws conn for remote-ext (#4849) Revert "collator-protocol: short-term fixes for connectivity (#4640)" (#4914) Bump tracing from 0.1.30 to 0.1.31 (#4941) Better spam slots handling (#4845) Bump proc-macro-crate from 1.1.0 to 1.1.2 (#4936) corrected paras code validation event comments (#4932) Companion for refactor election score #10834 (#4927) Companion CI: Make sure to pass the update crates properly (#4928) update digest to v0.10.2 (#4907) Companion for #10832 (#4918) Companion for `Remove u32_trait` (#4920) Bump serde_json from 1.0.78 to 1.0.79 (#4916) Bump rand from 0.8.4 to 0.8.5 (#4917) Remove stale migrations post 9.16 release (#4848) Add proxy type for Kappa Sigma Mu (#4851) Baseline weights for `force_apply_min_commission` (#4896) Allow two Parachains to swap (#4772) ...
Builds on top of #4716
It passes the already established WebSocket connection down to
remote externalities
to re-use the already established connection for that part.In addition this PR introduces a
SharedRpcClient
abstraction with a RPC API with macros to make things a little bit cleaner and easier to understand I hope.