lint: enforce Q-54 memory caps 128 / 320 / 16 / follow_live - #621
Closed
Hero-Gamer wants to merge 3 commits into
Closed
Hero-Gamer wants to merge 3 commits into
Hero-Gamer wants to merge 3 commits into
Conversation
First named-cap rule from docs/ibd-memory.md. pending_blocks is 128 decoded bodies / session with FIFO evict (fixed in 8b28c19). Easy to accidentally delete or raise to unbounded, causing RSS blowup like reardencode#421. Quality.md Q-54: one rule per cap that is easy to delete: pending_blocks 128, held_bodies 320, MAX_SERVE_BLOCKS 16, follow_live vs max_outbound. Each rule needs fixtures per quality.md.
- held-bodies-cap: impl HeldBodies CAP must be 320, not 64/1008 from tx_relay - serve-blocks-cap: MAX_SERVE_BLOCKS must be 16 - both with bad/good fixtures per quality.md, ast-grep.sh clean
1 task
Contributor
|
Sorry — Q-54 should not have been on Open. It asked ast-grep to pin You implemented the row as written. The defect was the inventory item, not the PR. Closing this rather than merging. Q-54 is moving to Won't-fix in #624. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes Q-54 per docs/quality.md:32 and docs/ibd-memory.md:61
Today: four structural rules, zero cap rules. After: 4 structural + 4 cap rules, each with lint/ast-grep/fixtures/{good,bad}/
Caps enforced (easy-to-delete -> RSS blowup #421)
const MAX_PENDING_BLOCKS = 128(ibd)HeldBodies::CAP = 320(ibd)const MAX_SERVE_BLOCKS = 16(serve)fn stale_follow_needs_room(follow_live, max_outbound) -> bool { follow_live >= max_outbound.max(1) }incrates/rbitcoin-node/src/run.rs:1615max_outbounddefault 16 fromconfig.rs:98PeerHub::outbound_full_relay_ids()inpeers.rs:1872— skips inbound and noban per testoutbound_full_relay_ids_skips_inbound_and_nobanfollow_livegrowsEvidence
./scripts/ast-grep.sh # clean on crates/
./scripts/ast-grep.test.sh # 12 passed, good fixtures []
ast-grep scan lint/ast-grep/fixtures/bad # 12 errors including 4 caps
pending-blocks-cap
held-bodies-cap
serve-blocks-cap
follow-live-vs-max-outbound
Each cap has good (keeps cap) and bad (deletes cap -> unbounded) fixture.
Fixes Q-54.