Skip to content

Commit

Permalink
feat: enable eip and update check (#335)
Browse files Browse the repository at this point in the history
* enable eip and update check

* Update version.go

---------

Co-authored-by: Péter Garamvölgyi <[email protected]>
Co-authored-by: HAOYUatHZ <[email protected]>
  • Loading branch information
3 people authored May 19, 2023
1 parent 910d4f1 commit 1094569
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package core

import (
"errors"
"fmt"
"math"
"math/big"
"sort"
Expand Down Expand Up @@ -614,6 +615,10 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
if uint64(tx.Size()) > txMaxSize {
return ErrOversizedData
}
// Check whether the init code size has been exceeded.
if pool.shanghai && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
return fmt.Errorf("%w: code size %v limit %v", ErrMaxInitCodeSizeExceeded, len(tx.Data()), params.MaxInitCodeSize)
}
// Transactions can't be negative. This may never happen using RLP decoded
// transactions but may occur if you create a transaction using the RPC.
if tx.Value().Sign() < 0 {
Expand Down
5 changes: 4 additions & 1 deletion core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ var (
// JumpTable contains the EVM opcodes supported at a given fork.
type JumpTable [256]*operation

// newShanghaiInstructionSet returns the frontier, homestead, byzantium,
// contantinople, istanbul, petersburg, berlin, london and shanghai instructions.
func newShanghaiInstructionSet() JumpTable {
instructionSet := newLondonInstructionSet()
enable3860(&instructionSet)
enable3855(&instructionSet) // PUSH0 instruction https://eips.ethereum.org/EIPS/eip-3855
enable3860(&instructionSet) // Limit and meter initcode https://eips.ethereum.org/EIPS/eip-3860
return instructionSet
}

Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 3 // Major version component of the current release
VersionMinor = 2 // Minor version component of the current release
VersionPatch = 1 // Patch version component of the current release
VersionPatch = 2 // Patch version component of the current release
VersionMeta = "alpha" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 1094569

Please sign in to comment.