Skip to content

fix(net): validate block delivery before provider credit - #97

Draft
317787106 wants to merge 1 commit into
release_v4.8.3from
fix/block-provider-accounting
Draft

317787106 wants to merge 1 commit into
release_v4.8.3from
fix/block-provider-accounting

Conversation

@317787106

@317787106 317787106 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

Block responses currently clear fetch requests before validation and can receive activity or contribution credit without useful delivery. Validate the parent hash and height relationship, retain request responsibility through preliminary validation, and distinguish accepted, sync-required, ignored, and state-failed processing outcomes. Credit broadcast and sync providers only at the appropriate validated/useful stage, including shutdown guards.

Keep broadcasting after validation and parent checks but before full execution. Keep the release branch's sync BAD_BLOCK penalties.

Why?

Invalid data must remain recoverable through disconnect handling, and peer-quality timestamps should reflect validated interaction and useful block delivery.

Split scope

Independent split 1 of #91, based directly on release_v4.8.3. It does not require the inventory activity or scheduling PR. INV confirmation and download retry/recovery are separate changes; the retry PR will follow after the first three splits merge. Existing public signatures, wire/storage formats, configuration, and dependency versions are unchanged.

Validation

  • ARM64/JDK 17: 36 focused and existing regression tests passed.
  • checkstyleMain checkstyleTest passed.
  • Semgrep: no findings in changed files.
  • Repository-wide test: 3,470 tests, 26 skipped, zero failures/errors.
  • FindSecBugs: no new security findings versus the release base (25 existing logging warnings).
  • Local integration rehearsal of all three independent splits: 159 networking tests and Checkstyle passed after reconciling the overlapping handlers, peer-method insertion, and sync test fixture.
  • Local worktree commands skip :framework:generateGitProperties because the existing metadata plugin cannot resolve linked worktrees.

CI status

Linux JDK 8/17 builds, coverage gate, Checkstyle, and the JDK 8 smoke test passed. The first macOS run exited with Gradle Test Executor 11 status 1 without a reported failing assertion; all 22 new tests passed in that run. A single rerun of the failed macOS job has been requested; its root cause is not established.

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