Skip to content

fix(inbound): retry duplicate block advertisers#320

Open
evan-forbes wants to merge 1 commit into
ironwood-mainfrom
codex/inbound-block-fallbacks
Open

fix(inbound): retry duplicate block advertisers#320
evan-forbes wants to merge 1 commit into
ironwood-mainfrom
codex/inbound-block-fallbacks

Conversation

@evan-forbes

Copy link
Copy Markdown

Motivation

Closes: N/A

When multiple peers advertised the same gossiped block, Zebra previously kept only the first advertiser. A malicious first advertiser could race honest peers, then timeout or return malformed data, causing the gossip download to fail even though other peers had also advertised the block.

Solution

  • Record bounded fallback advertisers for active gossiped block downloads.
  • Retry eligible source failures with the next fallback source.
  • Avoid fallback retries for consensus-invalid matching blocks, including production-shaped RouterError::Block verifier errors.
  • Add regression tests for fallback retry after malformed data and no retry after consensus-invalid data.

Validation

  • cargo test -p zebrad components::inbound
  • cargo fmt --all -- --check

In this environment the zebrad tests were run with CXXFLAGS='-include cstdint' to work around a local librocksdb-sys C++ include issue.

AI Disclosure

Used OpenAI Codex to audit, implement, and test this change.

@evan-forbes
evan-forbes force-pushed the codex/inbound-block-fallbacks branch from e283fad to 20193ab Compare June 29, 2026 20:57
@evan-forbes
evan-forbes marked this pull request as ready for review June 30, 2026 00:03
@ValarDragon

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2baa4e038

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread zebrad/src/components/inbound/downloads.rs
Comment thread zebrad/src/components/inbound/downloads.rs
@evan-forbes
evan-forbes changed the base branch from feat/pre-release-main to ironwood-main July 1, 2026 21:15
@evan-forbes
evan-forbes force-pushed the codex/inbound-block-fallbacks branch 2 times, most recently from aa11e16 to 5c1cf16 Compare July 1, 2026 22:33
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.

2 participants