Skip to content

Conversation

@xyephy
Copy link
Contributor

@xyephy xyephy commented Nov 27, 2025

Add test coverage for the fee-based rate limiting timer that was marked with a TODO in template_provider.cpp. The timer blocks fee-based template updates until fee_check_interval seconds have passed (-sv2interval flag).

The test uses is_test=false to exercise the actual timer logic that is normally bypassed in tests. It verifies:

  • Fee increases are blocked when the timer hasn't fired
  • Fee increases are allowed after the timer fires

Also adds a TPTester constructor overload to accept custom options, allowing tests to configure is_test and fee_check_interval independently.

Closes #67

@xyephy xyephy marked this pull request as draft November 27, 2025 18:16
TPTester tester{opts};

tester.handshake();
tester.handshake();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know why the original has two handshake calls, that might be a bug.

It would be good to reduce the amount of duplicated test code, that also makes it more clear how each test case is different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me do a clean up and have a much clearer approach

@xyephy xyephy force-pushed the 2025/11/fee-timer-test branch from fffb55b to d54d4b7 Compare November 28, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test coverage for fee-based rate limiting timer

2 participants