Merge bitcoin/bitcoin#33026: test, refactor: Embedded ASMap [1/3]: Selected minor preparatory work

7f318e1dd0 test: Add better coverage for Autofile size() (Fabian Jahr)
b7af960eb8 refactor: Add AutoFile::size (Fabian Jahr)
ec0f75862e refactor: Modernize logging in util/asmap.cpp (Fabian Jahr)
606a251e0a tests: add unit test vectors for asmap interpreter (Pieter Wuille)

Pull request description:

  This contains some commits from #28792 that can be easily reviewed and merged independently. I hope splitting this change off can make this part move a bit faster and reduce frequency of needed rebases for #28792.

  The commits in order:
  - Add additional unit test vectors to the asmap interpreter (written by sipa). This helps to ensure that the further refactors in #28792 don't change behavior.
  - Modernizes the logging in `util/asmap.cpp`, I added this while touching the rest of the file all over anyway.
  - Adds an `AutoFile::size` helper function with some additional test coverage in a separate commit

ACKs for top commit:
  maflcko:
    review ACK 7f318e1dd0 🏀
  hodlinator:
    tACK 7f318e1dd0
  laanwj:
    Code review ACK 7f318e1dd0

Tree-SHA512: 45156b74e4bd9278a7ec24521dfdafe4dab1ba3384243c7d589ef17e16ca374ee2af7178c86b7229e80ca262dbe78c4d456d80a6ee742ec31d2ab5243dac8b57
This commit is contained in:
merge-script committed 2025-11-19 09:28:44 +00:00
commit 509dc91db1
6 files changed
+116 -8

No files matched your search

+1 -2
View File
@@ -544,8 +544,7 @@ void BerkeleyRODatabase::Open()
page_size = outer_meta.pagesize;
// Verify the size of the file is a multiple of the page size
db_file.seek(0, SEEK_END);
int64_t size = db_file.tell();
const int64_t size{db_file.size()};
// Since BDB stores everything in a page, the file size should be a multiple of the page size;
// However, BDB doesn't actually check that this is the case, and enforcing this check results