Skip to content

refactor: remove CTxMemPool::queryHashes() - #29260

Merged
glozow merged 1 commit into
bitcoin:masterfrom
stickies-v:2024-01/remove-queryhashes
Jan 22, 2024
Merged

glozow merged 1 commit into
bitcoin:masterfrom
stickies-v:2024-01/remove-queryhashes

Conversation

@stickies-v

Copy link
Copy Markdown
Contributor

CTxMemPool::queryHashes() is only used in MempoolToJSON(), where it can just as easily be replaced with the more general CTxMemPool::entryAll(). No behaviour change, just cleans up the code.

@DrahtBot

DrahtBot commented Jan 17, 2024 •

Copy link
Copy Markdown
Contributor

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK dergoegge, TheCharlatan, glozow

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

Comment thread src/test/fuzz/tx_pool.cpp Resolved
Comment thread src/rpc/mempool.cpp Outdated
Comment on lines 359 to 363

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be cool if we could use infoAll since that doesn't require the lock externally but we need the sequence to be in sync so we can't, oh well...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

entryAll returning just refs has less overhead than infoAll so I think regardless this is a preferred approach? (even if it's not a huge difference)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That overhead is tiny if any, I'd think. You can benchmark MempoolToJSON and it'd bet it won't even show up. But anyway we can't use it due to the sequence sync requirement.

Actually, maybe it's worth considering removing entryAll too? it's only used in two places and we can work around the sync issue somehow, but not in this PR...

@stickies-v
stickies-v force-pushed the 2024-01/remove-queryhashes branch from 17da801 to c84c5f2 Compare January 18, 2024 21:12
@stickies-v

Copy link
Copy Markdown
Contributor Author

Force pushed to re-instate the fuzz test, addressing #29260 (comment)

Comment thread src/test/fuzz/tx_pool.cpp Resolved
Its only usage can easily be replaced with CTxMemPool::entryAll()
@stickies-v
stickies-v force-pushed the 2024-01/remove-queryhashes branch from c84c5f2 to 282b12d Compare January 18, 2024 21:55

@dergoegge dergoegge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code review ACK 282b12d

@sedited sedited left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 282b12d

@DrahtBot
DrahtBot requested review from sedited and removed request for sedited January 19, 2024 13:08

@glozow glozow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 282b12d. Looks like there's no conflicts.

@glozow
glozow merged commit 651fb03 into bitcoin:master Jan 22, 2024
@stickies-v
stickies-v deleted the 2024-01/remove-queryhashes branch January 22, 2024 10:08
@bitcoin bitcoin locked and limited conversation to collaborators Jan 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants