we have a path for leveraging IPC on #24 that is arguably suboptimal and results in avoidable ProvideMissingTransactions (relies on createNewBlock and locally keeps an optimistic "mempool-mirror")
@Sjors has this draft PR bitcoin/bitcoin#34020 which could help us optimize that
this PR could potentially land on v32, for which new feature deadline is around August 2026
so the scope here is to adapt bitcoin_core_sv2::BitcoinCoreSv2JDP to leverage this new method
without ProvideMissingTransactions trigger
DeclareMiningJob arrives to JDS
- JDS sends a
JdRequest::DeclareMiningJob to BitcoinCoreSv2JDP with:
- populated
wtxid_list: Vec<Wtxid> (from DeclareMiningJob)
BitcoinCoreSv2JDP sends a getTransactionsByWTxID() to Bitcoin Core
- Bitcoin Core has all txs on its mempool, so it returns an array with all
txdata for the DeclareMiningJob
BitcoinCoreSv2JDP builds a Block (because now it has the full txdata of the DeclareMiningJob)
BitcoinCoreSv2JDP calls checkBlock()
BitcoinCoreSv2JDP sends JdResponse::Success (which includes txdata)
- JDC sends
PushSolution to JDS
- JDS builds
Block and sends to BitcoinCoreSv2JDP
BitcoinCoreSv2JDP sends submitBlock() to Bitcoin Core
with ProvideMissingTransactions trigger
DeclareMiningJob arrives to JDS
- JDS sends a
JdRequest::DeclareMiningJob to BitcoinCoreSv2JDP with:
- populated
wtxid_list: Vec<Wtxid> (from DeclareMiningJob)
BitcoinCoreSv2JDP sends a getTransactionsByWTxID() to Bitcoin Core
- Bitcoin Core is missing some txs on its mempool, so it returns an array where empty elements indicate the missing txs
BitcoinCoreSv2JDP sends a JdResponse::MissingTransactions to JDS, while keeping the non-empty elements in cache
- JDS sends
ProvideMissingTransactions to JDC
- JDC sends
ProvideMissingTransactions.Success to JDS
- JDS sends a
JdRequest::DeclareMiningJob to BitcoinCoreSv2JDP with:
- populated
missing_txs: Vec<Transaction> (contents from ProvideMissingTransactions.Success)
BitcoinCoreSv2JDP builds a Block (because now it has the full txdata of the DeclareMiningJob)
BitcoinCoreSv2JDP calls checkBlock()
BitcoinCoreSv2JDP sends JdResponse::Success (which includes txdata)
- JDC sends
PushSolution to JDS
- JDS builds
Block and sends to BitcoinCoreSv2JDP
BitcoinCoreSv2JDP sends submitBlock() to Bitcoin Core
we have a path for leveraging IPC on #24 that is arguably suboptimal and results in avoidable
ProvideMissingTransactions(relies oncreateNewBlockand locally keeps an optimistic "mempool-mirror")@Sjors has this draft PR bitcoin/bitcoin#34020 which could help us optimize that
this PR could potentially land on v32, for which new feature deadline is around August 2026
so the scope here is to adapt
bitcoin_core_sv2::BitcoinCoreSv2JDPto leverage this new methodwithout
ProvideMissingTransactionstriggerDeclareMiningJobarrives to JDSJdRequest::DeclareMiningJobtoBitcoinCoreSv2JDPwith:wtxid_list: Vec<Wtxid>(fromDeclareMiningJob)BitcoinCoreSv2JDPsends agetTransactionsByWTxID()to Bitcoin Coretxdatafor theDeclareMiningJobBitcoinCoreSv2JDPbuilds aBlock(because now it has the fulltxdataof theDeclareMiningJob)BitcoinCoreSv2JDPcallscheckBlock()BitcoinCoreSv2JDPsendsJdResponse::Success(which includestxdata)PushSolutionto JDSBlockand sends toBitcoinCoreSv2JDPBitcoinCoreSv2JDPsendssubmitBlock()to Bitcoin Corewith
ProvideMissingTransactionstriggerDeclareMiningJobarrives to JDSJdRequest::DeclareMiningJobtoBitcoinCoreSv2JDPwith:wtxid_list: Vec<Wtxid>(fromDeclareMiningJob)BitcoinCoreSv2JDPsends agetTransactionsByWTxID()to Bitcoin CoreBitcoinCoreSv2JDPsends aJdResponse::MissingTransactionsto JDS, while keeping the non-empty elements in cacheProvideMissingTransactionsto JDCProvideMissingTransactions.Successto JDSJdRequest::DeclareMiningJobtoBitcoinCoreSv2JDPwith:missing_txs: Vec<Transaction>(contents fromProvideMissingTransactions.Success)BitcoinCoreSv2JDPbuilds aBlock(because now it has the fulltxdataof theDeclareMiningJob)BitcoinCoreSv2JDPcallscheckBlock()BitcoinCoreSv2JDPsendsJdResponse::Success(which includestxdata)PushSolutionto JDSBlockand sends toBitcoinCoreSv2JDPBitcoinCoreSv2JDPsendssubmitBlock()to Bitcoin Core