Skip to content

fix(sync): ignore stale invalid value responses#1556

Closed
aproskill81 wants to merge 1 commit into
circlefin:mainfrom
aproskill81:fix-sync-stale-invalid-response-1555
Closed

fix(sync): ignore stale invalid value responses#1556
aproskill81 wants to merge 1 commit into
circlefin:mainfrom
aproskill81:fix-sync-stale-invalid-response-1555

Conversation

@aproskill81
Copy link
Copy Markdown

Closes: #1555


Summary

Invalid/undecodable ValueSync responses are represented as Input::ValueResponse(request_id, peer_id, None).

Before this change, on_invalid_value_response penalized the peer before checking whether the request ID was still pending in sync state. This meant a stale invalid response could reduce a peer score even after the corresponding request had already been pruned or cleared.

This makes invalid responses consistent with the valid-response path, which already ignores unknown request IDs.

Changes

  • Return early from on_invalid_value_response when request_id is no longer pending.
  • Keep scoring and retry behavior unchanged for pending invalid responses.
  • Add a regression test for stale invalid responses.

Tests

  • cargo fmt --all --check
  • cargo nextest run -p arc-malachitebft-sync invalid_value_response_ignores_unknown_request_id
  • cargo nextest run -p arc-malachitebft-sync

@github-actions
Copy link
Copy Markdown
Contributor

Hi @aproskill81,

Thank you for your interest in contributing to Malachite.

This PR has been automatically closed because you are not assigned to issue #1555. We require contributors to be explicitly assigned to an issue before submitting a PR.

To contribute properly:

  1. Comment on issue sync: stale invalid value responses can penalize peers #1555 requesting assignment
  2. Wait for maintainer approval
  3. Only submit a PR after you have been assigned

Please see our CONTRIBUTING.md for more details.

@github-actions github-actions Bot added the need-triage This issue needs to be triaged label May 12, 2026
@github-actions github-actions Bot closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-triage This issue needs to be triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sync: stale invalid value responses can penalize peers

1 participant