core/types/bal: check correct max code size

This commit is contained in:
Marius van der Wijden 2026-03-10 18:27:18 +01:00
parent 3f41dd1c5b
commit 19c51b5098

View file

@ -23,12 +23,13 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/log"
"io" "io"
"maps" "maps"
"slices" "slices"
"strings" "strings"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
@ -413,10 +414,10 @@ func (e *AccountAccess) validate(blockTxCount int) error {
} }
} }
// validate that code changes could plausibly be correct (none exceed // validate that code changes could plausibly be correct
// max code size of a contract) // (none exceed max code size of a contract)
for _, codeChange := range e.CodeChanges { for _, codeChange := range e.CodeChanges {
if len(codeChange.Code) > params.MaxCodeSize { if len(codeChange.Code) > params.MaxCodeSizeAmsterdam {
return fmt.Errorf("code change contained oversized code") return fmt.Errorf("code change contained oversized code")
} }
} }