Add TemplateProvider::rpc_info#1429
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1429 +/- ##
==========================================
+ Coverage 18.05% 18.27% +0.22%
==========================================
Files 127 127
Lines 9559 9738 +179
==========================================
+ Hits 1726 1780 +54
- Misses 7833 7958 +125
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| "tp_username".to_string(), | ||
| "tp_password".to_string(), |
There was a problem hiding this comment.
we also need to set username and password on the conf object that goes into Node::with_conf()
and make them match these
otherwise, the RPC authentication will fail
There was a problem hiding this comment.
should we consider adding some verification into start_jds?
that way, JDS will never start unless there is:
- a bitcoin core RPC port available
- the authentication parameters are correct
the fact that JDS doesn't have this kind of early verification is probably the reason why this issue went un-noticed until now
| // taken. Consequentally new_block_receiver in JDsMempool::on_submit is never read, possibly | ||
| // reaching the channel bound. The new_block_sender is given as input to | ||
| // JobDeclarator::start() | ||
| if url.contains("http") { |
There was a problem hiding this comment.
This commit only removes this if
|
looks like we need to fix Clippy CI here |
There was a problem hiding this comment.
approving as this is an amazing progress in different parts of the code (more robust JDS and ITF)
but I think it's important to highlight that the current approach on ITF is using TP as an umbrella term for ANY bitcoin node, and this could potentially re-inforce some misconceptions
as clarified here #1418 (comment), in strict terms of Sv2 Protocol, JDS never participates in TDP, and therefore labeling the node it connects to as TP is conceptually misleading
but anyways, I don't think this is a blocker here, as adapting this PR to allow for more primitives for labeling of different bitcoin nodes would not necessarily be a trivial change (and a bit out of scope)
we already solved the fundamental problem from #1418 (replacing Sv2 port with RPC, tests, etc)
just taking note for future reference
|
MG CI looks like we are triggering the newly introduced so I can see two possible paths forward:
option 1. feels like taking a steps backwards to unblock a step forward, so I'd lean towards 2., which actually feels like taking 2 steps forward unfortunately #1419 is blocked by #1420, so we also need to fix a few other things to allow our progress here |
(1) seemed like a quick solution as it is just not including the bitcoind rpc data ccc2b52 , it seems to be ok now https://github.com/stratum-mining/stratum/actions/runs/13257911698/job/37007907249?pr=1429 |
|
oops, looks like this is still not ready to be merged CI now consistently breaking at https://github.com/stratum-mining/stratum/actions/runs/13270694992/job/37050470055?pr=1429 |
| // Note that jd-client starts to exchange messages with the Template Provider after it has accepted | ||
| // a downstream connection. | ||
| #[tokio::test] | ||
| async fn jdc_tp_success_setup() { |
There was a problem hiding this comment.
I don't think it's a good idea to add this test on this PR
this new test will block this PR from being merged due to CI
and this is blocked by #1420
There was a problem hiding this comment.
It seems to be failing only on macos
|
Rebased without further changes |
|
Hey @jbesraa, your PR cannot be rebased due to conflicts. Could you resolve them, please? |
|
pav bot 🤌 |
.. to return rpc info for outside connection
.. Used in JDS to validate RPC input contains a full URL including the scheme. Added to utility as it can be used by other crates.
- RPC client - JdsMempool RPC client simply tries to fetch `getblockchaininfo` request to validate it is able to establish a connection with the node. JdsMempool only calls `rpc_client.helath`.
.. Validate template provider RPC URL before initializing JDS. + Check mempool connection health before starting JDS
..Too verbose, code/test title are quite readable anyway
|
@plebhash @GitGab19 while bot above is cool, perhaps in the future we should consider detaching it from my personal account and have it under an account labeled as bot. I presume it can be confusing that a bot replies from my account for contributors who don't have context, now a high-priority but would be good to tackle it as we try to improve dev process structure. |
this is needed for
start_jdswhich does not connect to sv2 port but through rpc for bitcoindthis function should be used in order to avoid #1418
maybe this should be tested like the following:
the tricky part is (4) as we dont have access to jds mempool from ITF