Merge bitcoin/bitcoin#31288: Add destroy to BlockTemplate schema
Some checks are pending
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run

9aa50152c1 Add destroy to BlockTemplate schema (Sjors Provoost)

Pull request description:

  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.

  This has a trivial silent merge conflict with #31283 because it also used the number `@9` (gaps are not allowed). I'll rebase whichever is merged last.

ACKs for top commit:
  TheCharlatan:
    Re-ACK 9aa50152c1
  ryanofsky:
    Code review ACK 9aa50152c1

Tree-SHA512: 393571b4455969cba71c7572feaeff4503738205331ab198b9181c156c75eb65933a8e5ceff66fc06d1efb8f2528bdb254e5eee7df75735b912526de1e7b166d
This commit is contained in:
Ryan Ofsky 2024-11-20 10:43:33 -05:00
commit 22ef95dbe3
No known key found for this signature in database
GPG key ID: 46800E30FC748A66

View file

@ -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") {