-
Notifications
You must be signed in to change notification settings - Fork 110
fix(orderbook): reduce invalid states and improve sync reliability #2626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
regarding 9bd5e53 i think @dimxy also did some clippy fixes in one of his PRs. but clippy fixes will usually create conflicts anyway even if done by a single person in an isolated PR :/, albeit less messy. |
f69b690 to
9bd5e53
Compare
This reverts commit 9a76d11.
…SyncFailure to prevent bans during initial sync
- Sync: request diffs from our local “from” roots (SyncPlan), reducing FullTrie fallbacks and false mismatches; apply diffs tentatively and revert on mismatch. - Bans: add cause/role-aware temp-ban with per-peer grace (120s, TTL 600s, temp-ban 20m). Relays do not ban Unavailable light nodes; light nodes ban Unavailable relays. Remote role detected via relay mesh query. - Treat Ok(None) on SyncPubkeyOrderbookState as InvalidOrIncomplete (not Unavailable). - Keep-alive: avoid creating pubkey state on stale messages (read-only pre-scan). - Logging: single structured decision log for SyncFailure ban action. Risk/rollout: minor policy tuning; no protocol changes. Verify behavior under lossy links and observe reduced false bans.
- Route message forwarding through libp2p’s validation path instead of manual propagation - This achieves faster gossip cache cleanup while avoiding forwarding malformed/invalid messages as before
…mong other things
… keepalive messages
- Observed repeated PubkeyKeepAlive messages; root cause not confirmed yet. Hypotheses include seq no. based MessageId dedup gaps and equal-timestamp behavior. - Added investigation notes and TODOs: considered content‑derived MessageId. - Deferred code changes until we gather more evidence to avoid risky churn. No functional changes; comments and guidance only.
…erbookState` - Prepares for exact from→to trie diffs, enabling strict landing on expected roots (security/consistency hardening) while maintaining backward compatibility. Behavioral impact: - No functional change in this commit, purely protocol scaffolding.
…ate` - Plumb `expected_roots` into the sync handler rejects unsound requests
9bd5e53 to
f7baf4f
Compare
Better to be reviewed commit by commit, no need to review the first 2 commits a73a714 and e3ad3ca as they were the ones reverted in #2631 and reapplied here. PR description to follow...