Skip to content

Bff fix#5294

Open
SirTyson wants to merge 2 commits into
stellar:masterfrom
SirTyson:bff-fix
Open

Bff fix#5294
SirTyson wants to merge 2 commits into
stellar:masterfrom
SirTyson:bff-fix

Conversation

@SirTyson
Copy link
Copy Markdown
Contributor

Description

Fixes an additional out of bounds vector access bug that occasionally occurs in the binary fuse filter.

In the original fix here, I fixed an out of bounds issue and removed the parent try-catch loop around binary fuse filter construction. Unfortunately, there were two more out of bounds bugs that I did not catch, that have since been throwing after I removed the catch statement.

Given that these failures are probabilistic, I added a code coverage test and some instrumentation to deterministically trigger these failures in the original PR. However, I only triggered them once, and these out of bounds issues were only triggered when hitting the unlikely path multiple times in a loop. I have changed the unit test to now trigger the rare condition up to the maximum number of allowed times in the affected loops and fixed the bugs. I also added a little more hardening and unit tests around serialization while I was looking at it.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes additional out-of-bounds risks in the binary fuse filter’s retry/seed-rotation logic and strengthens deserialization validation, along with expanding unit tests to cover these rare paths deterministically.

Changes:

  • Reworked seed rotation into a bounded, carry-aware increment routine and ensured populate error retries don’t fall through into peeling with cleared scratch state.
  • Added validation for SerializedBinaryFuseFilter fields during deserialization and tests for malformed serialized filters.
  • Expanded tests to force repeated populate/peeling retry paths and verify correctness / failure behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/util/test/BinaryFuseTests.cpp Expands retry-path and serialization hardening tests; adds forced-retry instrumentation usage.
src/test/CovMark.h Adds new coverage marks to assert seed-carry and max-retries-exhausted paths in tests.
lib/binaryfusefilter.h Fixes seed rotation to avoid out-of-bounds indexing; adds serialized-filter validation and retry instrumentation.

Comment thread src/util/test/BinaryFuseTests.cpp
Comment thread src/util/test/BinaryFuseTests.cpp
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