Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Nov 5, 2024

BDB may choose to use a pagesize other than 4096. As such, the parser should use the pagesize given by the BDB file.

Fixes #31210

BDB may choose to use a pagesize other than 4096. As such, the parser
should use the pagesize given by the BDB file.
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 5, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31222.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK theStack

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #30125 (test: improve BDB parser (handle internal/overflow pages, support all page sizes) by theStack)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the Tests label Nov 5, 2024
with open(filename, 'rb') as f:
data = f.read(PAGESIZE)
# Read the outer meta page for the page size. It will always be at least 512 bytes.
metadata = dump_meta_page(f.read(MIN_PAGESIZE))
Copy link
Member

@laanwj laanwj Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to do some basic checks on the pagesize; eg

MIN_PAGESIZE = 512
MAX_PAGESIZE = 65536assert pagesize >= MIN_PAGESIZE and pagesize <= MAX_PAGESIZE and (pagesize & (pagesize-1) == 0)

@theStack
Copy link
Contributor

theStack commented Nov 6, 2024

Concept ACK

Note that a similar change is also included in #30125, but happy to rebase if this one goes in first.

@achow101
Copy link
Member Author

achow101 commented Nov 6, 2024

Note that a similar change is also included in #30125,

Oh, right, forgot about that PR. Closing in favor of it.

@achow101 achow101 closed this Nov 6, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intermittent issue in wallet_upgradewallet.py: AssertionError: bdb magic does not match bdb btree magic

4 participants