Skip to content

fix: reject block with nil GasTip in verifyGasTip - #113

Merged
hmlee-wm merged 2 commits into
devfrom
fix/wbft-verify-gas-tip-nil-bypass
Jul 20, 2026
Merged

hmlee-wm merged 2 commits into
devfrom
fix/wbft-verify-gas-tip-nil-bypass

Conversation

@eomti-wm

Copy link
Copy Markdown
Contributor

Overview

The GasTip validation condition in block header verification was fixed to treat nil as a mismatch against the governance contract value instead of accepting it as valid.

Problem

A nil GasTip was never validated against the governance contract value because the condition only compared when the value was non-nil.

Solution

Treat nil GasTip as a mismatch against the governance contract value, so validation fails regardless of whether the value is absent or incorrect.
Since the WBFT engine is only active when Anzeon is enabled, and a valid Anzeon configuration always provides a defined GasTip, a nil GasTip is an invalid state and must be rejected.

Changes

  • consensus/wbft/engine/engine.go: update condition in verifyGasTip
  • Before: extra.GasTip != nil && extra.GasTip.Cmp(gastip) != 0
  • After: extra.GasTip == nil || extra.GasTip.Cmp(gastip) != 0

eomti-wm added 2 commits July 13, 2026 21:43
Treat nil extra.GasTip as a mismatch error to resolve the bypass
where nil was silently accepted instead of being validated against
the governance contract value.
@eomti-wm
eomti-wm requested review from 0xmhha, colinkim and hmlee-wm July 14, 2026 03:07
@eomti-wm eomti-wm self-assigned this Jul 14, 2026
@eomti-wm eomti-wm added the bug Something isn't working label Jul 14, 2026

@0xmhha 0xmhha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@colinkim colinkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hmlee-wm hmlee-wm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@hmlee-wm
hmlee-wm merged commit b46ef9e into dev Jul 20, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the fix/wbft-verify-gas-tip-nil-bypass branch July 20, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants