-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Line 333 has a TODO comment requesting test coverage for the
rate limiting timer behavior. Currently, the existing tests verify that templates are sent
after the -sv2interval timer expires, but they don't test the actual rate limiting
functionality - that is, verifying that templates are NOT sent when fees increase before the
timer has triggered.
The rate limiting timer is critical for protecting Bitcoin Core from excessive
createNewBlock() calls during periods of high fee volatility, which is directly related to the
memory management concerns raised in bitcoin/bitcoin#33899. Without testing the blocking
behavior, we only have coverage for half of the feature. This test becomes especially
important as we work on Issue #60 to rename this configuration option - we need regression
protection to ensure the rename doesn't break the rate limiting logic.
The test should verify three scenarios: first, that fee increases are blocked when the timer
hasn't elapsed (e.g., fee increase at 3 seconds with a 10-second interval should NOT send a
template); second, that fee increases are allowed once the timer has elapsed (e.g., fee
increase at 11 seconds should send a template); and third, that new blocks always bypass the
timer and send templates immediately regardless of the timer state.
Related:
- Issue Clarify or drop -sv2interval configuration #60: Clarify or drop -sv2interval configuration
- Bitcoin Core Issue #33899: Block template memory management