Skip to content

fix(net): confirm block inventory activity after processing - #98

Draft
317787106 wants to merge 1 commit into
release_v4.8.3from
fix/validated-block-inventory-activity
Draft

317787106 wants to merge 1 commit into
release_v4.8.3from
fix/validated-block-inventory-activity

Conversation

@317787106

@317787106 317787106 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

A BLOCK INV currently refreshes peer activity before the block is validated. Record receipt-time eligibility and confirm that activity only after the matching block is successfully processed through the broadcast or sync path. Use the recorded receipt time and a monotonic updater; advertisers receive no block-provider contribution credit.

Keep pending receipts in a per-peer cache capped at 100 entries with one-minute expiration, clear it on disconnect, and coordinate registration and confirmation with one lock.

Why?

Unverified announcements should not keep a peer active, while honest advertisers should receive activity credit even when another peer supplies the block.

Split scope

Independent split 2 of #91, based directly on release_v4.8.3. Confirmation hooks use the release branch's existing successful-processing paths and check shutdown directly, so this PR does not depend on the provider-accounting PR (#97). After that PR merges, reconcile the overlapping handler hooks and use the monotonic updater for its new provider activity sites; inject a mock AdvService into the provider-accounting sync test fixture. Download scheduling and retry/recovery are separate changes.

Existing APIs remain available; added APIs are Java 8 compatible. No wire/storage formats, dependencies, or configuration change.

Validation

  • ARM64/JDK 17: 51 focused and existing regression tests passed, including receipt eligibility, failure/shutdown, concurrent confirmation, cache limits/expiration, monotonic updates, and disconnect cleanup.
  • checkstyleMain checkstyleTest passed.
  • Semgrep: no findings in changed files.
  • FindSecBugs: no new security findings versus the release base (36 existing logging warnings; the new mutable-cache getter is an expected internal API warning).
  • Local integration rehearsal of all three splits: 159 networking tests and Checkstyle passed.
  • Repository-wide test: 3,470 tests, 26 skipped, zero failures/errors.
  • Local worktree commands skip :framework:generateGitProperties because the existing metadata plugin cannot resolve linked worktrees.

Related split PRs

All three target release_v4.8.3 independently. The fourth retry/recovery PR will be proposed only after these three merge.

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.

1 participant