Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Jun 3, 2025

Issue being fixed or feature implemented

Functional test p2p_node_network_limited.py is occasionally fails with error while waiting pong message:

2025-06-03T08:29:40.701000Z TestFramework (INFO): Mine enough blocks to reach the NODE_NETWORK_LIMITED range.
2025-06-03T08:30:40.761000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: check_bytesrecv(find_conn(to_connection, from_connection_subver, inbound=True), 'pong', 29), sleep=0.05)
'''
2025-06-03T08:30:40.762000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "DASH/test/functional/test_framework/test_framework.py", line 162, in main
    self.run_test()
  File "DASH/test/functional/p2p_node_network_limited.py", line 69, in run_test
    self.connect_nodes(0, 1)
  File "DASH/test/functional/test_framework/test_framework.py", line 736, in connect_nodes
  File "DASH/test/functional/test_framework/test_framework.py", line 903, in wait_until
    # Private helper methods. These should not be accessed by the subclass test scripts.
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "DASH/test/functional/test_framework/util.py", line 287, in wait_until_helper
    raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        self.wait_until(lambda: check_bytesrecv(find_conn(to_connection, from_connection_subver, inbound=True), 'pong', 29), sleep=0.05)
''' not true after 60.0 seconds

ot it fails while just waiting connection:

2025-06-03T08:42:35.518000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None)
'''
2025-06-03T08:42:35.518000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "DASH/test/functional/test_framework/test_framework.py", line 162, in main
    self.run_test()
  File "DASH/test/functional/p2p_node_network_limited.py", line 83, in run_test
    self.connect_nodes(0, 2)
  File "DASH/test/functional/test_framework/test_framework.py", line 726, in connect_nodes
    self.wait_until(lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None)
  File "DASH/test/functional/test_framework/test_framework.py", line 905, in wait_until
    return wait_until_helper(test_function, timeout=timeout, lock=lock, timeout_factor=self.options.timeout_factor, sleep=sleep, do_assert=do_assert)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "DASH/test/functional/test_framework/util.py", line 287, in wait_until_helper
    raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        self.wait_until(lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None)
''' not true after 60.0 seconds

This failure happens, because node 2, once connected to node 0:

  • requests headers
  • receive headers
  • sync headers
  • request blocks
  • got disconnected

Timeline is here (some lines are omitted)

 node2 2025-06-03T07:28:25.210493Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: version (148 bytes) peer=0 
 node2 2025-06-03T07:28:25.211692Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: sendaddrv2 (0 bytes) peer=0 
 node2 2025-06-03T07:28:25.211715Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: verack (0 bytes) peer=0 
 node2 2025-06-03T07:28:25.211868Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: getaddr (0 bytes) peer=0 
 node2 2025-06-03T07:28:25.211966Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: sendheaders2 (0 bytes) peer=0 
 node2 2025-06-03T07:28:25.211989Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: sendcmpct (9 bytes) peer=0 
 node2 2025-06-03T07:28:25.212007Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: senddsq (1 bytes) peer=0 
 node2 2025-06-03T07:28:25.212026Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: ping (8 bytes) peer=0 
 node2 2025-06-03T07:28:25.212063Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: getheaders2 (677 bytes) peer=0 
 node2 2025-06-03T07:28:25.221532Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: pong (8 bytes) peer=0 
 node2 2025-06-03T07:28:25.221574Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: headers2 (11441 bytes) peer=0 
...
 node2 2025-06-03T07:28:25.432813Z (mocktime: 1417713337) [   msghand] [validationinterface.cpp:270] [NotifyHeaderTip] [validation] NotifyHeaderTip: accepted block header hash=585e13971c392a7042a9ad56355a2e3912329ffa95c7d42cdf69929b9424248d initial=0
 node2 2025-06-03T07:28:25.432853Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3032] [HeadersDirectFetchBlocks] [net] Large reorg, won't direct fetch to 585e13971c392a7042a9ad56355a2e3912329ffa95c7d42cdf69929b9424248d (292)
 node2 2025-06-03T07:28:25.432894Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:6283] [SendMessages] [net] Requesting block 3de6b559afe72b8d41caaa6789031825de056b175a607b5facac4357c696bff2 (1) peer=0
 node0 2025-06-03T07:28:25.447535Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:3518] [ProcessMessage] [net] received: getdata (577 bytes) peer=2
 node0 2025-06-03T07:28:25.447556Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:4194] [ProcessMessage] [net] received getdata (16 invsz) peer=2
 node0 2025-06-03T07:28:25.447574Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:4197] [ProcessMessage] [net] received getdata for: block 3de6b559afe72b8d41caaa6789031825de056b175a607b5facac4357c696bff2 peer=2
 node0 2025-06-03T07:28:25.447600Z (mocktime: 1417713337) [   msghand] [net_processing.cpp:2568] [ProcessGetBlockData] [net] Ignore block request below NODE_NETWORK_LIMITED threshold, disconnect peer=2

All of that happen while connect_nodes in python code still validates if nodes already connected and it that would be eventually faster that python code moves to blocks syncing, the test will fail.

What was done?

This PR helps connect_nodes to work faster to increase chance to complete before nodes will be disconnected.

The race is still here but it happens less often.

See also https://github.com/dashpay/dash/pull/6631/files which has further improvements for connect_nodes by reducing default sleeps from 0.5 to 0.05

How Has This Been Tested?

This PR should increase reliability of other functional tests as well, because it's not the only test that I have seen failed on connect_nodes; but p2p_node_network_limited.py only one that I tested.

To reproduce this issue I run stress benchmark that occupy all cores on my machine and after that run p2p_node_network_limited.py in 40 jobs.

This PR decreased amount of failures from 25% error rate to just 10%.

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

0000276 test: Remove redundant verack check (MarcoFalke)

Pull request description:

  Currently the sync in `connect_nodes` mentions the `version` and `verack` message types, but only checks the `verack`. Neither check is required, as the `pong` check implies both. In case of failure, the debug log will have to be consulted anyway, so the redundant check doesn't add value.

  Also clarify in the comments that the goal is to check the flag `fSuccessfullyConnected` indirectly.

ACKs for top commit:
  furszy:
    utACK 0000276
  brunoerg:
    ACK 0000276
  tdb3:
    ACK 0000276

Tree-SHA512: f9ddcb1436d2f70da462a8dd470ecfc90a534dd6507c23877ef7626e7c02326c077001a42ad0171a87fba5c5275d1970d8c5e5d82c56c8412de944856fdfd6db
@knst knst added this to the 23 milestone Jun 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 3, 2025

Walkthrough

The connect_nodes method in test/functional/test_framework/test_framework.py was updated to alter how it detects the completion of the version handshake between two nodes. The previous approach, which involved waiting for both matching subversion connections and explicit 'verack' message receipt, was replaced with a simplified process that waits only for 'pong' messages with a minimum byte count, indicating handshake completion. All polling intervals in the relevant wait_until calls were standardized to use a sleep=0.05 parameter. Associated comments were revised to clarify the new logic and rationale. No changes were made to the method's signature.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/functional/test_framework/test_framework.py (1)

721-722: Consider line length compliance.

Static analysis flagged these lines as exceeding the 100-character limit (up to 137 characters). While not affecting functionality, consider reformatting for better readability:

-        self.wait_until(lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None, sleep=0.05)
-        self.wait_until(lambda: find_conn(to_connection, from_connection_subver, inbound=True) is not None, sleep=0.05)
+        self.wait_until(
+            lambda: find_conn(from_connection, to_connection_subver, inbound=False) is not None,
+            sleep=0.05
+        )
+        self.wait_until(
+            lambda: find_conn(to_connection, from_connection_subver, inbound=True) is not None,
+            sleep=0.05
+        )

Similar formatting could be applied to the longer wait_until calls on lines 734-735.

Also applies to: 734-735

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 721-721: Line too long (120/100)

(C0301)


[convention] 722-722: Line too long (119/100)

(C0301)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4930ee6 and 987b657.

📒 Files selected for processing (1)
  • test/functional/test_framework/test_framework.py (2 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
test/functional/test_framework/test_framework.py

[convention] 721-721: Line too long (120/100)

(C0301)


[convention] 722-722: Line too long (119/100)

(C0301)


[convention] 734-734: Line too long (137/100)

(C0301)


[convention] 735-735: Line too long (136/100)

(C0301)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: mac-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: linux64_multiprocess-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: win64-build / Build source
🔇 Additional comments (3)
test/functional/test_framework/test_framework.py (3)

2-2: LGTM: Copyright year update.

The copyright year update to "2014-present" is appropriate and follows common practices for open source projects.


721-722: Good optimization: Reduced polling intervals.

The addition of sleep=0.05 reduces polling intervals from the default 0.5 seconds to 0.05 seconds, which aligns with the PR objective to mitigate race conditions in connection establishment. This faster polling should help connections complete before potential timeouts.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 721-721: Line too long (120/100)

(C0301)


[convention] 722-722: Line too long (119/100)

(C0301)


728-735: Excellent logic simplification: Streamlined handshake detection.

The change from waiting for explicit 'verack' messages to relying solely on 'pong' messages is a smart optimization. Since 'pong' messages can only be sent after the fSuccessfullyConnected flag is set, this approach effectively ensures handshake completion while reducing connection delays. The updated comments clearly explain the rationale and improve code maintainability.

This change directly addresses the race condition mentioned in the PR objectives where longer delays increased the chance of disconnection during synchronization.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 734-734: Line too long (137/100)

(C0301)


[convention] 735-735: Line too long (136/100)

(C0301)

@UdjinM6
Copy link

UdjinM6 commented Jun 3, 2025

Looks good but PR title should be updated cause it's not a "fix", it's a "backport"

@knst
Copy link
Collaborator Author

knst commented Jun 3, 2025

Looks good but PR title should be updated cause it's not a "fix", it's a "backport"

it had before some extra changes, but eventually they duplicate #6631 so I dropped them. updated!

@knst knst changed the title fix: intermittent error in p2p_node_network_limited.py backport: Merge bitcoin#30252: test: Remove redundant verack check Jun 3, 2025
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK 1163aec

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK 1163aec

@PastaPastaPasta PastaPastaPasta merged commit 09aa42e into dashpay:develop Jun 3, 2025
58 of 62 checks passed
@knst knst deleted the fix-backport-30252 branch June 3, 2025 21:16
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 5, 2025
Documents the change to enable BIP157 block filters by default.
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jul 16, 2025
Documents the change to enable BIP157 block filters by default.
PastaPastaPasta added a commit that referenced this pull request Aug 20, 2025
2b17480 fix(tests): add feature_masternode_params.py to test runner (pasta)
bcff97a test: remove unused import from feature_masternode_params (pasta)
fcd1b8c doc: add disk space requirement note to release notes (pasta)
cec4ae0 test: address code review feedback for feature_masternode_params (pasta)
4e33c24 fix: specify utf8 (pasta)
ac5c499 chore: trailing whitespace (pasta)
2fabaa9 fix: Address code review feedback for masternode-only BIP157 (pasta)
90ef2d5 refactor: Enable BIP157 block filters only for masternodes (pasta)
d40ae45 test: fix tests incompatible with default peerblockfilters=1 (pasta)
d6c11f0 test: fix feature_index_prune.py for new peerblockfilters default (pasta)
2a88db9 test: Fix feature_index_prune.py to explicitly disable indices (pasta)
4412ced test: Fix feature_index_prune.py to work with new blockfilterindex defaults (pasta)
e6e9ff8 test: Fix functional tests to work with new blockfilterindex defaults (pasta)
ef2a1e3 Fix initialization error when using default blockfilterindex value (pasta)
fbde721 docs: Fix PR number in release notes - rename to 6711 (pasta)
0274cd2 docs: Add release notes for PR #6708 (pasta)
ac7e03e Enable BIP157 block filters index and serving by default (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This pull request introduces automatic enabling of BIP157 compact block filters specifically for masternodes to improve privacy and functionality for light clients connecting to them. Regular nodes retain the existing default settings.

  ## What was done?
  - **Automatic Enablement for Masternodes**: When a node is configured as a masternode (via `-masternodeblsprivkey`), both `-peerblockfilters` and `-blockfilterindex=basic` are now automatically enabled.
  - **Regular Nodes Unchanged**: Regular (non-masternode) nodes keep the previous defaults with both options disabled (`-peerblockfilters=false` and `-blockfilterindex=0`).
  - **Opt-out Available**: Masternodes can still explicitly disable these features if needed by setting `-peerblockfilters=0` or `-blockfilterindex=0`.
  - **Release Notes**: Updated to clearly document this masternode-specific behavior and the ~1GB disk space requirement for the block filter index.
  - **Tests**: Added functional test to verify the parameter interactions and that the settings are correctly applied only to masternodes.

  ## How Has This Been Tested?
  - Built locally
  - Added new functional test `feature_masternode_params.py` that verifies:
    - Regular nodes have filters disabled by default
    - Masternodes have filters auto-enabled
    - Masternodes can explicitly disable filters
    - Parameter interaction logging works correctly

  ## Breaking Changes
  None - this only affects masternodes and they can opt out if needed.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 2b17480

Tree-SHA512: 6a11305cf54c7584de4ca8dbe520e022e23f211ec6b0e2ee7679073f75a465ead927814f3f01f77e8576f96a187167511204d1906d380937f98310948933dc83
DashCoreAutoGuix pushed a commit to DashCoreAutoGuix/dash that referenced this pull request Aug 22, 2025
Documents the change to enable BIP157 block filters by default.
knst pushed a commit to knst/dash that referenced this pull request Sep 15, 2025
…nodes only

2b17480 fix(tests): add feature_masternode_params.py to test runner (pasta)
bcff97a test: remove unused import from feature_masternode_params (pasta)
fcd1b8c doc: add disk space requirement note to release notes (pasta)
cec4ae0 test: address code review feedback for feature_masternode_params (pasta)
4e33c24 fix: specify utf8 (pasta)
ac5c499 chore: trailing whitespace (pasta)
2fabaa9 fix: Address code review feedback for masternode-only BIP157 (pasta)
90ef2d5 refactor: Enable BIP157 block filters only for masternodes (pasta)
d40ae45 test: fix tests incompatible with default peerblockfilters=1 (pasta)
d6c11f0 test: fix feature_index_prune.py for new peerblockfilters default (pasta)
2a88db9 test: Fix feature_index_prune.py to explicitly disable indices (pasta)
4412ced test: Fix feature_index_prune.py to work with new blockfilterindex defaults (pasta)
e6e9ff8 test: Fix functional tests to work with new blockfilterindex defaults (pasta)
ef2a1e3 Fix initialization error when using default blockfilterindex value (pasta)
fbde721 docs: Fix PR number in release notes - rename to 6711 (pasta)
0274cd2 docs: Add release notes for PR dashpay#6708 (pasta)
ac7e03e Enable BIP157 block filters index and serving by default (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This pull request introduces automatic enabling of BIP157 compact block filters specifically for masternodes to improve privacy and functionality for light clients connecting to them. Regular nodes retain the existing default settings.

  ## What was done?
  - **Automatic Enablement for Masternodes**: When a node is configured as a masternode (via `-masternodeblsprivkey`), both `-peerblockfilters` and `-blockfilterindex=basic` are now automatically enabled.
  - **Regular Nodes Unchanged**: Regular (non-masternode) nodes keep the previous defaults with both options disabled (`-peerblockfilters=false` and `-blockfilterindex=0`).
  - **Opt-out Available**: Masternodes can still explicitly disable these features if needed by setting `-peerblockfilters=0` or `-blockfilterindex=0`.
  - **Release Notes**: Updated to clearly document this masternode-specific behavior and the ~1GB disk space requirement for the block filter index.
  - **Tests**: Added functional test to verify the parameter interactions and that the settings are correctly applied only to masternodes.

  ## How Has This Been Tested?
  - Built locally
  - Added new functional test `feature_masternode_params.py` that verifies:
    - Regular nodes have filters disabled by default
    - Masternodes have filters auto-enabled
    - Masternodes can explicitly disable filters
    - Parameter interaction logging works correctly

  ## Breaking Changes
  None - this only affects masternodes and they can opt out if needed.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 2b17480

Tree-SHA512: 6a11305cf54c7584de4ca8dbe520e022e23f211ec6b0e2ee7679073f75a465ead927814f3f01f77e8576f96a187167511204d1906d380937f98310948933dc83
knst pushed a commit to knst/dash that referenced this pull request Sep 17, 2025
…nodes only

2b17480 fix(tests): add feature_masternode_params.py to test runner (pasta)
bcff97a test: remove unused import from feature_masternode_params (pasta)
fcd1b8c doc: add disk space requirement note to release notes (pasta)
cec4ae0 test: address code review feedback for feature_masternode_params (pasta)
4e33c24 fix: specify utf8 (pasta)
ac5c499 chore: trailing whitespace (pasta)
2fabaa9 fix: Address code review feedback for masternode-only BIP157 (pasta)
90ef2d5 refactor: Enable BIP157 block filters only for masternodes (pasta)
d40ae45 test: fix tests incompatible with default peerblockfilters=1 (pasta)
d6c11f0 test: fix feature_index_prune.py for new peerblockfilters default (pasta)
2a88db9 test: Fix feature_index_prune.py to explicitly disable indices (pasta)
4412ced test: Fix feature_index_prune.py to work with new blockfilterindex defaults (pasta)
e6e9ff8 test: Fix functional tests to work with new blockfilterindex defaults (pasta)
ef2a1e3 Fix initialization error when using default blockfilterindex value (pasta)
fbde721 docs: Fix PR number in release notes - rename to 6711 (pasta)
0274cd2 docs: Add release notes for PR dashpay#6708 (pasta)
ac7e03e Enable BIP157 block filters index and serving by default (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This pull request introduces automatic enabling of BIP157 compact block filters specifically for masternodes to improve privacy and functionality for light clients connecting to them. Regular nodes retain the existing default settings.

  ## What was done?
  - **Automatic Enablement for Masternodes**: When a node is configured as a masternode (via `-masternodeblsprivkey`), both `-peerblockfilters` and `-blockfilterindex=basic` are now automatically enabled.
  - **Regular Nodes Unchanged**: Regular (non-masternode) nodes keep the previous defaults with both options disabled (`-peerblockfilters=false` and `-blockfilterindex=0`).
  - **Opt-out Available**: Masternodes can still explicitly disable these features if needed by setting `-peerblockfilters=0` or `-blockfilterindex=0`.
  - **Release Notes**: Updated to clearly document this masternode-specific behavior and the ~1GB disk space requirement for the block filter index.
  - **Tests**: Added functional test to verify the parameter interactions and that the settings are correctly applied only to masternodes.

  ## How Has This Been Tested?
  - Built locally
  - Added new functional test `feature_masternode_params.py` that verifies:
    - Regular nodes have filters disabled by default
    - Masternodes have filters auto-enabled
    - Masternodes can explicitly disable filters
    - Parameter interaction logging works correctly

  ## Breaking Changes
  None - this only affects masternodes and they can opt out if needed.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 2b17480

Tree-SHA512: 6a11305cf54c7584de4ca8dbe520e022e23f211ec6b0e2ee7679073f75a465ead927814f3f01f77e8576f96a187167511204d1906d380937f98310948933dc83
knst pushed a commit to knst/dash that referenced this pull request Sep 17, 2025
…nodes only

2b17480 fix(tests): add feature_masternode_params.py to test runner (pasta)
bcff97a test: remove unused import from feature_masternode_params (pasta)
fcd1b8c doc: add disk space requirement note to release notes (pasta)
cec4ae0 test: address code review feedback for feature_masternode_params (pasta)
4e33c24 fix: specify utf8 (pasta)
ac5c499 chore: trailing whitespace (pasta)
2fabaa9 fix: Address code review feedback for masternode-only BIP157 (pasta)
90ef2d5 refactor: Enable BIP157 block filters only for masternodes (pasta)
d40ae45 test: fix tests incompatible with default peerblockfilters=1 (pasta)
d6c11f0 test: fix feature_index_prune.py for new peerblockfilters default (pasta)
2a88db9 test: Fix feature_index_prune.py to explicitly disable indices (pasta)
4412ced test: Fix feature_index_prune.py to work with new blockfilterindex defaults (pasta)
e6e9ff8 test: Fix functional tests to work with new blockfilterindex defaults (pasta)
ef2a1e3 Fix initialization error when using default blockfilterindex value (pasta)
fbde721 docs: Fix PR number in release notes - rename to 6711 (pasta)
0274cd2 docs: Add release notes for PR dashpay#6708 (pasta)
ac7e03e Enable BIP157 block filters index and serving by default (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This pull request introduces automatic enabling of BIP157 compact block filters specifically for masternodes to improve privacy and functionality for light clients connecting to them. Regular nodes retain the existing default settings.

  ## What was done?
  - **Automatic Enablement for Masternodes**: When a node is configured as a masternode (via `-masternodeblsprivkey`), both `-peerblockfilters` and `-blockfilterindex=basic` are now automatically enabled.
  - **Regular Nodes Unchanged**: Regular (non-masternode) nodes keep the previous defaults with both options disabled (`-peerblockfilters=false` and `-blockfilterindex=0`).
  - **Opt-out Available**: Masternodes can still explicitly disable these features if needed by setting `-peerblockfilters=0` or `-blockfilterindex=0`.
  - **Release Notes**: Updated to clearly document this masternode-specific behavior and the ~1GB disk space requirement for the block filter index.
  - **Tests**: Added functional test to verify the parameter interactions and that the settings are correctly applied only to masternodes.

  ## How Has This Been Tested?
  - Built locally
  - Added new functional test `feature_masternode_params.py` that verifies:
    - Regular nodes have filters disabled by default
    - Masternodes have filters auto-enabled
    - Masternodes can explicitly disable filters
    - Parameter interaction logging works correctly

  ## Breaking Changes
  None - this only affects masternodes and they can opt out if needed.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 2b17480

Tree-SHA512: 6a11305cf54c7584de4ca8dbe520e022e23f211ec6b0e2ee7679073f75a465ead927814f3f01f77e8576f96a187167511204d1906d380937f98310948933dc83
knst pushed a commit to knst/dash that referenced this pull request Sep 18, 2025
…nodes only

2b17480 fix(tests): add feature_masternode_params.py to test runner (pasta)
bcff97a test: remove unused import from feature_masternode_params (pasta)
fcd1b8c doc: add disk space requirement note to release notes (pasta)
cec4ae0 test: address code review feedback for feature_masternode_params (pasta)
4e33c24 fix: specify utf8 (pasta)
ac5c499 chore: trailing whitespace (pasta)
2fabaa9 fix: Address code review feedback for masternode-only BIP157 (pasta)
90ef2d5 refactor: Enable BIP157 block filters only for masternodes (pasta)
d40ae45 test: fix tests incompatible with default peerblockfilters=1 (pasta)
d6c11f0 test: fix feature_index_prune.py for new peerblockfilters default (pasta)
2a88db9 test: Fix feature_index_prune.py to explicitly disable indices (pasta)
4412ced test: Fix feature_index_prune.py to work with new blockfilterindex defaults (pasta)
e6e9ff8 test: Fix functional tests to work with new blockfilterindex defaults (pasta)
ef2a1e3 Fix initialization error when using default blockfilterindex value (pasta)
fbde721 docs: Fix PR number in release notes - rename to 6711 (pasta)
0274cd2 docs: Add release notes for PR dashpay#6708 (pasta)
ac7e03e Enable BIP157 block filters index and serving by default (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This pull request introduces automatic enabling of BIP157 compact block filters specifically for masternodes to improve privacy and functionality for light clients connecting to them. Regular nodes retain the existing default settings.

  ## What was done?
  - **Automatic Enablement for Masternodes**: When a node is configured as a masternode (via `-masternodeblsprivkey`), both `-peerblockfilters` and `-blockfilterindex=basic` are now automatically enabled.
  - **Regular Nodes Unchanged**: Regular (non-masternode) nodes keep the previous defaults with both options disabled (`-peerblockfilters=false` and `-blockfilterindex=0`).
  - **Opt-out Available**: Masternodes can still explicitly disable these features if needed by setting `-peerblockfilters=0` or `-blockfilterindex=0`.
  - **Release Notes**: Updated to clearly document this masternode-specific behavior and the ~1GB disk space requirement for the block filter index.
  - **Tests**: Added functional test to verify the parameter interactions and that the settings are correctly applied only to masternodes.

  ## How Has This Been Tested?
  - Built locally
  - Added new functional test `feature_masternode_params.py` that verifies:
    - Regular nodes have filters disabled by default
    - Masternodes have filters auto-enabled
    - Masternodes can explicitly disable filters
    - Parameter interaction logging works correctly

  ## Breaking Changes
  None - this only affects masternodes and they can opt out if needed.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 2b17480

Tree-SHA512: 6a11305cf54c7584de4ca8dbe520e022e23f211ec6b0e2ee7679073f75a465ead927814f3f01f77e8576f96a187167511204d1906d380937f98310948933dc83
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.

4 participants