core/types/bal: enhance the bal validation

This commit is contained in:
Gary Rong 2026-07-02 21:53:25 +08:00
parent dd8dd1520f
commit bbb53f4a88

View file

@ -80,7 +80,7 @@ func (e *BlockAccessList) DecodeRLP(s *rlp.Stream) error {
// according to the spec or any code changes are contained which exceed protocol
// max code size.
func (e *BlockAccessList) Validate(blockGasLimit uint64, blockTxCount int) error {
if !slices.IsSortedFunc(*e, func(a, b AccountAccess) int {
if !isStrictlySortedFunc(*e, func(a, b AccountAccess) int {
return bytes.Compare(a.Address[:], b.Address[:])
}) {
return errors.New("block access list accounts not in lexicographic order")