Skip to content

Conversation

@dnwiebe
Copy link
Collaborator

@dnwiebe dnwiebe commented Nov 17, 2025

Note

Enforces rate-pack limits in config and gossip, adds DB support and migration, introduces malefactor banning, and refactors neighborhood initialization with broad test updates.

  • Database:
    • Bump CURRENT_SCHEMA_VERSION to 12; add migration 11_to_12 inserting default rate_pack_limits.
    • Initialize and persist rate_pack_limits; update initializer and tests accordingly.
  • Config/Runtime:
    • Add RatePackLimits and DEFAULT_RATE_PACK_LIMITS; validate RatePack on configuration and during gossip processing.
    • Extend PersistentConfiguration to read rate_pack_limits; add factory and "invalid" placeholders.
  • Gossip/Neighborhood:
    • Introduce Malefactor type and switch ban path to carry structured data; handlers may return multiple results.
    • Validate incoming Debut/Introduction/Standard gossip against rate-pack limits; improve logging/formatting (Display for records, agrs_to_string).
    • Refactor neighborhood start-up to use PersistentConfigurationFactory and construct GossipAcceptor with limits.
  • Tests/Integrations:
    • Update tests to new APIs, larger default rate-pack values, longer timeouts, and additional nodes; add new unit tests for limits and parsing.
    • Integration: remove existing Docker network before create.
  • Misc:
    • Add time feature local-offset; minor renames/var tweaks; .gitignore adds Copilot files.

Written by Cursor Bugbot for commit 45e87b6. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

let pieces = vec![
&inner_string[0..index_of_space_after_pk],
addr_string.as_str(),
&inner_string[index_of_space_after_pk + 1..],
Copy link

Choose a reason for hiding this comment

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

Bug: Slice bounds panic when no space found in string

The Display implementation for AccessibleGossipRecord searches for a space character starting at position 9 in inner_string. If no space is found before the end of the string, the while loop exits with index_of_space_after_pk equal to inner_string.len(). The subsequent slice &inner_string[index_of_space_after_pk + 1..] would then try to create a slice starting at len + 1, causing an index out-of-bounds panic. The code assumes a space always exists but doesn't verify one was actually found before using the index.

Fix in Cursor Fix in Web

candidate.hi.exit_service_rate,
"exit_service_rate",
);
Ok(candidate)
Copy link

Choose a reason for hiding this comment

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

Bug: Rate pack limits panics instead of returning errors

The rate_pack_limits() function returns Result<RatePackLimits, PersistentConfigError> but panics on syntax errors and invalid limit ordering instead of returning errors. This is inconsistent with similar functions like rate_pack(), payment_thresholds(), and scan_intervals() that use combined_params_get_method and properly return parsing errors via the Result type. The syntax error handling via unwrap_or_else(|| panic!(...)) and the validation in check_rate_pack_limit_order that panics on low >= high both violate the function's contract of returning errors.

Additional Locations (1)

Fix in Cursor Fix in Web

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