Skip to content

Conversation

@oskarszoon
Copy link
Contributor

Summary

  • Disabled ban score and reputation penalties for invalid subtree reports
  • All current reasons (peer_cannot_provide_transactions, malformed_transaction_data, transaction_count_mismatch) are more likely network issues than malicious behavior

Changes

  • Commented out AddBanScore call in ReportInvalidSubtree
  • Commented out RecordMaliciousInteraction call in ReportInvalidSubtree
  • Added TODO to refactor penalty system in a separate PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🤖 Claude Code Review

Status: Complete

The change to disable penalty scoring for invalid subtree reports is reasonable given the identified failure modes. All three reasons (peer_cannot_provide_transactions, malformed_transaction_data, transaction_count_mismatch) can legitimately occur from network issues, timeouts, or transient failures rather than malicious behavior.

Observations:

The commented-out penalty logic is well-preserved with clear TODO explaining the rationale. The function still logs the invalid subtree report and removes it from the map to prevent memory leaks, maintaining necessary housekeeping while removing the punitive actions.

One consideration: Since this completely disables consequences for invalid subtrees, there is no mechanism to detect if a peer is repeatedly failing or if patterns emerge. However, the PR description indicates this will be addressed in a separate refactor of the penalty system, which is the appropriate approach.

No issues found - the change is conservative and well-documented.

@oskarszoon oskarszoon merged commit 27b8160 into bsv-blockchain:main Dec 8, 2025
16 of 20 checks passed
liam pushed a commit to liam/teranode that referenced this pull request Dec 9, 2025
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.

2 participants