Skip to content

Commit 7fc04f1

Browse files
authored
Merge branch 'develop' into thomas/access-list-support
Signed-off-by: Thomas <[email protected]>
2 parents cc498c9 + 9f5d1db commit 7fc04f1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4848
* (ante) [#775](https://github.com/crypto-org-chain/ethermint/pull/775) fix: race condition in antecache
4949
* (ante) [#789](https://github.com/crypto-org-chain/ethermint/pull/789) fix: add check on evm transaction tip
5050
* (api) [#768](https://github.com/crypto-org-chain/ethermint/pull/768) feat: support create access list
51+
* (evm) [#789](https://github.com/crypto-org-chain/ethermint/pull/795) chore: add validation for HeaderHashNum and HistoryServeWindow in params
5152

5253
## [v0.22.0] - 2025-08-12
5354

x/evm/types/params.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package types
1717

1818
import (
1919
"fmt"
20+
"math"
2021
"math/big"
2122

2223
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -89,6 +90,14 @@ func (p Params) Validate() error {
8990
return err
9091
}
9192

93+
if err := ValidateInt64Overflow(p.HeaderHashNum); err != nil {
94+
return err
95+
}
96+
97+
if err := ValidateInt64Overflow(p.HistoryServeWindow); err != nil {
98+
return err
99+
}
100+
92101
return ValidateChainConfig(p.ChainConfig)
93102
}
94103

@@ -140,6 +149,17 @@ func ValidateChainConfig(i interface{}) error {
140149
return cfg.Validate()
141150
}
142151

152+
func ValidateInt64Overflow(i interface{}) error {
153+
num, ok := i.(uint64)
154+
if !ok {
155+
return fmt.Errorf("invalid parameter type: %T", i)
156+
}
157+
if num > math.MaxInt64 {
158+
return fmt.Errorf("value too large: %d, maximum value is: %d", num, uint64(math.MaxInt64))
159+
}
160+
return nil
161+
}
162+
143163
// IsLondon returns if london hardfork is enabled.
144164
func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
145165
return ethConfig.IsLondon(big.NewInt(height))

0 commit comments

Comments
 (0)