Files
bitcoin/src/wallet
merge-script 1360001f43 Merge bitcoin/bitcoin#34959: wallet: Enforce BDB btree levels and overflow item sizes
b2de59d486 wallet, bdbro: Validate btree page levels (Ava Chow)
dc3a2b9c3b wallet, bdbro: Enforce overflow data lengths (Ava Chow)

Pull request description:

  Alternative to #34946

  BDB's overflow records include the total length of the data to be read from the overflow pages. If this length is impossible (larger than max page * page size), or if the data that we are reading exceeds the stated length, then throw an exception as this is an invalid BDB file. This prevents infinite looping if an overflow page makes a circular reference.

  BDB BTrees also include the level in the tree that the page is supposed to be at. Leaf pages are always at level 1. Starting from the root page, we can validate that each child has a level one less than the parent, until we reach a leaf page with a level of 1. This also ensures that we cannot have circular internal page references.

ACKs for top commit:
  sedited:
    ACK b2de59d486
  rkrux:
    code review ACK b2de59d486

Tree-SHA512: b740c349f68c78150ee57b77e8e81605bb45a7db4fbca3c3a0d87318178dfa197f37faf0cbfd8bef791ab20f4a9afc3d2571842960055a70b6c081d605f59f94
2026-07-04 12:17:42 +02:00
..
2026-07-02 14:49:37 -07:00
2026-06-11 21:32:46 +02:00
2026-06-03 21:40:48 +02:00
2026-06-03 21:40:48 +02:00