From 3d50e3eb0ec3ef626900a6dce9fd04e052b61054 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Fri, 3 Jul 2026 14:30:56 +0800 Subject: [PATCH] core/types/bal: enhance the bal validation (#35281) EIP-7928 requires that each address appears exactly once in the block access list. In the `BlockAccessList.Validate`, the strict `isStrictlySortedFunc` is required to detect the duplicated accounts. --- core/types/bal/bal_encoding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/types/bal/bal_encoding.go b/core/types/bal/bal_encoding.go index 522192cee8..db891b92d0 100644 --- a/core/types/bal/bal_encoding.go +++ b/core/types/bal/bal_encoding.go @@ -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")