From 9aa50152c1cfa1c41215b2b51ed7a516aa67137a Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 15 Nov 2024 19:14:54 +0100 Subject: [PATCH] Add destroy to BlockTemplate schema This ensures that if a client no longer needs a block template, the node can clear its memory as soon as possible. A block template may hold on to transactions that are no longer in the mempool, so this can be significant. --- src/ipc/capnp/mining.capnp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/ipc/capnp/mining.capnp b/src/ipc/capnp/mining.capnp index 5e0216aceacf1..f8faaa0c4246d 100644 --- a/src/ipc/capnp/mining.capnp +++ b/src/ipc/capnp/mining.capnp @@ -24,15 +24,16 @@ interface Mining $Proxy.wrap("interfaces::Mining") { } interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") { - getBlockHeader @0 (context: Proxy.Context) -> (result: Data); - getBlock @1 (context: Proxy.Context) -> (result: Data); - getTxFees @2 (context: Proxy.Context) -> (result: List(Int64)); - getTxSigops @3 (context: Proxy.Context) -> (result: List(Int64)); - getCoinbaseTx @4 (context: Proxy.Context) -> (result: Data); - getCoinbaseCommitment @5 (context: Proxy.Context) -> (result: Data); - getWitnessCommitmentIndex @6 (context: Proxy.Context) -> (result: Int32); - getCoinbaseMerklePath @7 (context: Proxy.Context) -> (result: List(Data)); - submitSolution@8 (context: Proxy.Context, version: UInt32, timestamp: UInt32, nonce: UInt32, coinbase :Data) -> (result: Bool); + destroy @0 (context :Proxy.Context) -> (); + getBlockHeader @1 (context: Proxy.Context) -> (result: Data); + getBlock @2 (context: Proxy.Context) -> (result: Data); + getTxFees @3 (context: Proxy.Context) -> (result: List(Int64)); + getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64)); + getCoinbaseTx @5 (context: Proxy.Context) -> (result: Data); + getCoinbaseCommitment @6 (context: Proxy.Context) -> (result: Data); + getWitnessCommitmentIndex @7 (context: Proxy.Context) -> (result: Int32); + getCoinbaseMerklePath @8 (context: Proxy.Context) -> (result: List(Data)); + submitSolution @9 (context: Proxy.Context, version: UInt32, timestamp: UInt32, nonce: UInt32, coinbase :Data) -> (result: Bool); } struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions") {