bitcoin/src/rpc
glozow 6b165f5906
Merge bitcoin/bitcoin#31384: mining: bugfix: Fix duplicate coinbase tx weight reservation
386eecff5f doc: add release notes (ismaelsadeeq)
3eaa0a3b66 miner: init: add `-blockreservedweight` startup option (ismaelsadeeq)
777434a2cd doc: rpc: improve `getmininginfo` help text (ismaelsadeeq)
c8acd4032d init: fail to start when `-blockmaxweight` exceeds `MAX_BLOCK_WEIGHT` (ismaelsadeeq)
5bb31633cc test: add `-blockmaxweight` startup option functional test (ismaelsadeeq)
2c7d90a6d6 miner: bugfix: fix duplicate weight reservation in block assembler (ismaelsadeeq)

Pull request description:

  * This PR attempts to fix the duplicate coinbase weight reservation issue we currently have.
  * Fixes #21950

  We reserve 4000 weight units for coinbase transaction in `DEFAULT_BLOCK_MAX_WEIGHT`

  7590e93bc7/src/policy/policy.h (L23)

  And also reserve additional `4000` weight units in the default `BlockCreationOptions` struct.

  7590e93bc7/src/node/types.h (L36-L40)

  **Motivation**

  - This issue was first noticed during a review here https://github.com/bitcoin/bitcoin/pull/11100#discussion_r136157411)
  - It was later reported in issue #21950.
  - I also came across the bug while writing a test for building the block template. I could not create a block template above `3,992,000` in the block assembler, and this was not documented anywhere. It took me a while to realize that we were reserving space for the coinbase transaction weight twice.

  ---
  This PR fixes this by consolidating the reservation to be in a single location in the codebase.

  This PR then adds a new startup option `-blockreservedweight` whose default is `8000` that can be used to lower or increase the block reserved weight for block header, txs count, coinbase tx.

ACKs for top commit:
  Sjors:
    ACK 386eecff5f
  fjahr:
    Code review ACK 386eecff5f
  glozow:
    utACK 386eecff5f, nonblocking nits. I do think the release notes should be clarified more
  pinheadmz:
    ACK 386eecff5f

Tree-SHA512: f27efa1da57947b7f4d42b9322b83d13afe73dd749dd9cac49360002824dd41c99a876a610554ac2d67bad7485020b9dcc423a8e6748fc79d6a10de6d4357d4c
2025-02-10 08:26:01 -05:00
..
blockchain.cpp Merge bitcoin/bitcoin#31583: rpc: add target to getmininginfo field and show next block info 2025-01-22 15:01:23 -05:00
blockchain.h Add target to getblock(header) in RPC and REST 2025-01-22 12:04:02 +01:00
client.cpp Merge bitcoin/bitcoin#30708: rpc: add getdescriptoractivity 2024-11-27 12:23:35 -05:00
client.h refactor: rpc: hide and rename ParseNonRFCJSONValue() 2023-03-23 18:18:46 +00:00
external_signer.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
fees.cpp [rpc, fees]: add more detail on the fee estimation modes 2024-08-02 15:40:43 +01:00
mempool.cpp Merge bitcoin/bitcoin#31397: p2p: track and use all potential peers for orphan resolution 2025-01-16 13:42:26 +00:00
mempool.h rpc: Move mempool RPCs to new file 2022-03-11 17:46:58 +01:00
mining.cpp Merge bitcoin/bitcoin#31384: mining: bugfix: Fix duplicate coinbase tx weight reservation 2025-02-10 08:26:01 -05:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
net.cpp scripted-diff: get rid of remaining "command" terminology in protocol.{h,cpp} 2024-10-26 23:44:15 +02:00
node.cpp scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
output_script.cpp refactor: Fix remaining clang-tidy performance-inefficient-vector errors 2024-11-25 20:09:44 +01:00
protocol.h rpc: clarify ALREADY_IN_CHAIN rpc errors 2024-08-05 15:45:58 +01:00
rawtransaction.cpp scripted-diff: rename block and undo functions for consistency 2025-01-09 15:17:02 +01:00
rawtransaction_util.cpp Merge bitcoin/bitcoin#28307: rpc, wallet: fix incorrect segwit redeem script size limit 2024-06-04 21:39:49 -04:00
rawtransaction_util.h rpc: bugfix, incorrect segwit redeem script size used in signrawtransactionwithkey 2024-05-03 14:20:45 -03:00
register.h scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h 2024-10-10 12:22:12 +02:00
request.cpp args: Support -norpccookiefile for bitcoind and bitcoin-cli 2024-12-03 10:38:21 +01:00
request.h Merge bitcoin/bitcoin#28167: init: Add option for rpccookie permissions (replace 26088) 2024-06-27 17:35:08 -04:00
server.cpp scripted-diff: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:36:19 +00:00
server.h refactor: Split up NodeContext shutdown_signal and shutdown_request 2024-10-01 09:10:54 +02:00
server_util.cpp rpc: add next to getmininginfo 2025-01-22 12:28:45 +01:00
server_util.h rpc: add next to getmininginfo 2025-01-22 12:28:45 +01:00
signmessage.cpp util: move util/message to common/signmessage 2024-05-16 11:16:08 -04:00
txoutproof.cpp scripted-diff: rename block and undo functions for consistency 2025-01-09 15:17:02 +01:00
util.cpp rpc: add GetTarget helper 2025-01-22 12:04:02 +01:00
util.h rpc: add GetTarget helper 2025-01-22 12:04:02 +01:00