Skip to content
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

Mempool to jd server applications vendored rebased #632

Merged

Commits on Oct 12, 2023

  1. setting up

    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    1c4a13b View commit details
    Browse the repository at this point in the history
  2. vendored jsomn-rpc

    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    76185e2 View commit details
    Browse the repository at this point in the history
  3. started logic rust_bitcoincore_rpc client

    vendored jsonrpc is working and imported
    adding boilerplate for mempool logic
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    6e7449d View commit details
    Browse the repository at this point in the history
  4. add bitcoincore_rpc client

    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    ce73e17 View commit details
    Browse the repository at this point in the history
  5. add Txid type]

    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    1d4b61f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    455d675 View commit details
    Browse the repository at this point in the history
  7. mempool ordered by fee

    add a method that retrieves the mempool, in which the transactions are
    ordered by size.
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    ba7c0f9 View commit details
    Browse the repository at this point in the history
  8. rpc_client.rs + JDsMempool

    All the logic of the rpc_client is moved in a separate file
    rpc_client.rs
    Now the struct JDsMempool has also a client, which is inizialized
    in the new() method. The get_mempool() method becomes update_mempool
    This is far better as for updateing a mempool we do not reinizialise an
    rpc_clint but we use every time the same.
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    28fb134 View commit details
    Browse the repository at this point in the history
  9. rebased

    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    363f748 View commit details
    Browse the repository at this point in the history
  10. function verify_short__hash_id

    the function in /roles/jd-server/src/lib/mempool/mod.rs named
    verify_short_id must be uncommented and modified to compile
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    bd5d33a View commit details
    Browse the repository at this point in the history
  11. JDsMempool::update_mempool and mempool in main

    the method update_memppol of JDsMempool now is non-blocking. What we pay
    is a bit of performance, as we have to generate a new rpc client every
    time we update the mempool. To fix this requires a major refactoring of
    the rpc client, that I cannot do for lack of time
    the mempool is initialized in main and gets updated every second
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    28478b5 View commit details
    Browse the repository at this point in the history
  12. works, kind of

    no errors in clippy, still few wornings to be solved. All except one are
    relative to unsed variables. This variables are the inputs of the
    function verify_short_id that still has to be implemented and will use
    them.
    The code can, and should, be tested.
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    167a646 View commit details
    Browse the repository at this point in the history
  13. refactored hash_list_tuple

    now this relies on a function that calculates the ShortHashId of a
    transaction, gicven a nonce and the txid. This is good as we can use
    this function elsewhere.
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    66a69a0 View commit details
    Browse the repository at this point in the history
  14. improvements for the jd server

    refactored the function that calculates the short_hash_id of a
    tyransaction given the txid and a nonce. Refacored the method that takes
    a mempool and a short tx id and verifies that there is that tx in the
    mempool. Now gives Some(tx, txid) in positive case, none otherwise.
    
    With all this machinery now we can identify the transactions sent in the
    declared mining job. The identified transaction are stored in a field of
    JobDeclaratorDownstream. It is also added a field that indicates how
    many transactions are unidentified. In the case this field is non zero,
    the JDS must send a ProvideMissingTransactions to the JDC.
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    3047287 View commit details
    Browse the repository at this point in the history
  15. last fixes

    fix clippy wornings and rust tests that do not pass in json vendored
    lorbax committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    f3fe4bb View commit details
    Browse the repository at this point in the history