[WIP] new rpc-client for JD-Server mempool#716
Closed
lorbax wants to merge 8 commits intostratum-mining:devfrom
Closed
[WIP] new rpc-client for JD-Server mempool#716lorbax wants to merge 8 commits intostratum-mining:devfrom
lorbax wants to merge 8 commits intostratum-mining:devfrom
Conversation
6cba292 to
9c38b68
Compare
Add a new script that compiles all the worspaces at once. This is useful because after the workspace split all the remaining workspaces have to be compiled separately, which is not practical
mini_rcp_client module added, removed dependance over previous rcp_client. Also added task where the mempool listed if submit_solution arrives, in order to send the block to bitcoin node. Still very much WIP, only compiles
Now the JDS, when receives the SubmitSolution, construct the block send sends its hex serialization to the mempool. At the same time, an asyc tast on main makes the mempool listen for new hex_encoded blocks. When one arrives, it is submitted to the bitcoin node via the MiniRpcclient. Note that this task of submitting a solution to the bitcoin node before was blocking and now it is async.
No more reckless unwrap in "mempool" module code. Good error management
9c38b68 to
5583f43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is in this PR.
A new Rpc client, called MiniRpcClient. This client communicates with a bitcoin node, and the requests that can do are just the following: ask for the mempool, ask for a specific transaction, submit a bitcoin block. This client is used to make the jd-server mempool communicate with the bitcoin node. The previous client was depending upon json-rpc library, which caused some issues because imported serde in a way that the SRI "doesn't like". This rpc client is made on top of the latest hyper 1.1.0 library for http connections.
The code is asynchronous and non blocking. Before was "almost" non blocking, as the function "submit_block" that concearned submitting a block to the bitcoin node, was blocking.
I also took advantage of introduce some proper error management in the jds mempool module.
There are still some clippyu warning and the code still need to be tested properly, this is why is marked as "Work in Progress".