mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-06 07:28:23 +00:00
Static threshold 200 silently truncated historic filters on Ditto-shaped relays whose omitted-limit pages contain 100 events. NIP-11 max_limit cannot correct that because it describes explicit limits, while GRASP deliberately omits limit to preserve unbounded relay responses. Learn the largest raw page per relay connection session and combine it with NIP-11 default_limit, then paginate at max(90, floor(90% of the estimate)). Refetch NIP-11 on each successful connection, reset learning on disconnect, and ignore max_limit. Treat default_limit only as a hint: one suspiciously short page receives an inclusive-cursor verification request; any unseen event discards the hint session-wide. Preserve verification state across rate-limit deferral and across every filter in grouped REQs. Correctness assumes the audited relays apply result caps per filter rather than across the merged REQ, and that a cap of at least 90 covers the observed interoperability floor. Relays capped below 90 remain a documented residual risk. Explicit limits, configurable thresholds, aggregate-cap support, and the pre-existing transient-REQ concurrency defect are deliberately excluded. Validation: nix develop -c cargo test --lib (623 passed); nix develop -c cargo test --test sync adaptive_pagination -- --nocapture (3 passed: Ditto-shaped, honest hint, lying-high hint); nix develop -c cargo check --workspace --all-targets passed. The required standalone req-concurrency scenario failed twice with its documented proxy-rejection failure. Under this diff the same too many concurrent REQs signature repeated during phase-one pagination, a noisier form which is reported rather than masked.
48 lines
1.4 KiB
Rust
48 lines
1.4 KiB
Rust
//! Proactive Sync Integration Tests
|
|
//!
|
|
//! This test file organizes tests for ngit-grasp's proactive sync functionality.
|
|
//! Tests are grouped into submodules by sync scenario:
|
|
//!
|
|
//! - `historic_sync` - Tests for sync from pre-configured bootstrap relay (historic events)
|
|
//! - `discovery` - Tests for relay discovery from announcement events
|
|
//! - `live_sync` - Tests for real-time sync after connection established
|
|
//! - `tag_variations` - Tests for different Layer 2/3 tag types
|
|
//! - `catchup` - Tests for catchup sync after disconnect (not yet implemented)
|
|
//! - `metrics` - Tests for Prometheus metrics integration
|
|
//!
|
|
//! # Running Tests
|
|
//!
|
|
//! ```bash
|
|
//! # Run all sync tests
|
|
//! cargo test --test sync
|
|
//!
|
|
//! # Run with output
|
|
//! cargo test --test sync -- --nocapture
|
|
//!
|
|
//! # Run specific test
|
|
//! cargo test --test sync test_bootstrap_syncs -- --nocapture
|
|
//!
|
|
//! # Run ignored tests (like catchup)
|
|
//! cargo test --test sync -- --ignored
|
|
//! ```
|
|
|
|
// Include the common test utilities
|
|
mod common;
|
|
|
|
// Include sync test submodules (located in tests/sync/)
|
|
mod sync {
|
|
pub mod adaptive_pagination;
|
|
pub mod catchup;
|
|
pub mod discovery;
|
|
pub mod historic_recovery;
|
|
pub mod historic_sync;
|
|
pub mod live_sync;
|
|
pub mod maintainer_reprocessing;
|
|
pub mod metrics;
|
|
pub mod naughty_list_scheduling;
|
|
pub mod neg_concurrency;
|
|
pub mod purgatory_fetch;
|
|
pub mod req_concurrency;
|
|
pub mod tag_variations;
|
|
}
|