Skip to content

Commit 2e9c9b5

Browse files
authored
consensus: fix ambiguous invalid gas limit error (#32405)
## Description Correct symmetric tolerance in gas limit validation: Replace ambiguous "+-=" with standard "+/-" in the error message. Logic rejects when |header − parent| ≥ limit, so allowed range is |Δ| ≤ limit − 1. No logic or functionality has been modified.
1 parent cbbf686 commit 2e9c9b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

consensus/misc/gaslimit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error {
3232
}
3333
limit := parentGasLimit / params.GasLimitBoundDivisor
3434
if uint64(diff) >= limit {
35-
return fmt.Errorf("invalid gas limit: have %d, want %d +-= %d", headerGasLimit, parentGasLimit, limit-1)
35+
return fmt.Errorf("invalid gas limit: have %d, want %d +/- %d", headerGasLimit, parentGasLimit, limit-1)
3636
}
3737
if headerGasLimit < params.MinGasLimit {
3838
return fmt.Errorf("invalid gas limit below %d", params.MinGasLimit)

0 commit comments

Comments
 (0)