feat(swqos): align endpoint tables with SwqosRegion and document fallbacks

- Extend SWQOS regional constants to 10 entries (Dublin, Singapore, Default)
  so indices match SwqosRegion 0..9 everywhere
- Document geographic nearest-fill among published PoPs; call out Default and
  single-PoP provider constraints in comments
- Fix Node1 QUIC Default endpoint to match HTTP; tune ZeroSlot/Blox/Speedlanding
  regional mappings where a closer published PoP exists
- Add unit tests for table length and Astralane/Node1 cross-table consistency
- Update SwqosRegion rustdoc, README, and trading_client example accordingly

Made-with: Cursor
This commit is contained in:
0xfnzero
2026-04-14 02:13:42 +08:00
parent a391539000
commit 06ef2fed84
8 changed files with 333 additions and 174 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ pub struct InfrastructureConfig {
/// When true, SWQOS sender threads use the *last* N cores instead of the first N. Reduces contention with main thread / default tokio workers that often use low-numbered cores. Default false.
pub swqos_cores_from_end: bool,
/// Global MEV protection flag. When true, SWQOS providers that support MEV protection
/// (Astralane QUIC port 9000, BlockRazor revert_protection) will use their MEV-protected
/// (Astralane QUIC `:9000` or HTTP `mev-protect=true`, BlockRazor) use MEV-protected
/// endpoints/modes. Default false.
pub mev_protection: bool,
}
@@ -92,8 +92,8 @@ pub struct TradeConfig {
/// When true, SWQOS uses the *last* N cores (instead of the first N). Use when main thread / tokio use low-numbered cores to reduce CPU contention. Default false.
pub swqos_cores_from_end: bool,
/// Global MEV protection flag. When true, SWQOS providers that support MEV protection
/// (Astralane QUIC port 9000, BlockRazor sandwichMitigation mode) will use their
/// MEV-protected endpoints/modes. Default false (no MEV protection, lower latency).
/// (Astralane QUIC `:9000` or Plain/Binary HTTP `mev-protect=true`, BlockRazor sandwichMitigation)
/// use their MEV-protected endpoints/modes. Default false (no MEV protection, lower latency).
pub mev_protection: bool,
}
@@ -199,7 +199,7 @@ impl TradeConfigBuilder {
}
/// Enable global MEV protection. When `true`:
/// - **Astralane QUIC** uses port `9000` (MEV-protected endpoint)
/// - **Astralane QUIC** uses port `9000`; **Astralane HTTP** adds `mev-protect=true`
/// - **BlockRazor** uses `mode=sandwichMitigation` (skips blacklisted Leader slots)
///
/// May reduce landing speed. Default: `false`.