Skip to content

fix: precedence to avoid masking Byzantine errors in SharesAvailable - #4708

Closed
ANtutov wants to merge 1 commit into
celestiaorg:mainfrom
ANtutov:fix/full-avail-byzantine-precedence
Closed

fix: precedence to avoid masking Byzantine errors in SharesAvailable#4708
ANtutov wants to merge 1 commit into
celestiaorg:mainfrom
ANtutov:fix/full-avail-byzantine-precedence

Conversation

@ANtutov

@ANtutov ANtutov commented Nov 22, 2025

Copy link
Copy Markdown

The error handling in share/availability/full/availability.go used a disjunction combined with a conjunction without explicit parentheses, relying on Go’s operator precedence where && binds tighter than ||. As a result, shwap.ErrNotFound was always mapped to share.ErrNotAvailable even when the same error chain also contained a *byzantine.ErrByzantine via errors.Join, which could mask Byzantine faults as mere unavailability. This change groups the NotFound and DeadlineExceeded checks together and only maps to ErrNotAvailable if neither condition is accompanied by a Byzantine error. The intended behavior aligns with tests expecting NotFound and DeadlineExceeded to map to ErrNotAvailable while propagating Byzantine errors distinctly.

@github-actions github-actions Bot added the external Issues created by non node team members label Nov 22, 2025
@vgonkivs vgonkivs closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants