Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e69130d9
Unverified
Commit
e69130d9
authored
Apr 29, 2021
by
Paweł Bylica
Committed by
Martin Holst Swende
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm, params: implement EIP 3541
parent
cc606be7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
errors.go
core/vm/errors.go
+1
-0
evm.go
core/vm/evm.go
+5
-0
No files found.
core/vm/errors.go
View file @
e69130d9
...
@@ -34,6 +34,7 @@ var (
...
@@ -34,6 +34,7 @@ var (
ErrWriteProtection
=
errors
.
New
(
"write protection"
)
ErrWriteProtection
=
errors
.
New
(
"write protection"
)
ErrReturnDataOutOfBounds
=
errors
.
New
(
"return data out of bounds"
)
ErrReturnDataOutOfBounds
=
errors
.
New
(
"return data out of bounds"
)
ErrGasUintOverflow
=
errors
.
New
(
"gas uint64 overflow"
)
ErrGasUintOverflow
=
errors
.
New
(
"gas uint64 overflow"
)
ErrInvalidCode
=
errors
.
New
(
"invalid code: must not begin with 0xef"
)
)
)
// ErrStackUnderflow wraps an evm error when the items on the stack less
// ErrStackUnderflow wraps an evm error when the items on the stack less
...
...
core/vm/evm.go
View file @
e69130d9
...
@@ -468,6 +468,11 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
...
@@ -468,6 +468,11 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
err
=
ErrMaxCodeSizeExceeded
err
=
ErrMaxCodeSizeExceeded
}
}
// Reject code starting with 0xEF if EIP-3541 is enabled.
if
err
==
nil
&&
len
(
ret
)
>=
1
&&
ret
[
0
]
==
0xEF
&&
evm
.
chainRules
.
IsLondon
{
err
=
ErrInvalidCode
}
// if the contract creation ran successfully and no errors were returned
// if the contract creation ran successfully and no errors were returned
// calculate the gas required to store the code. If the code could not
// calculate the gas required to store the code. If the code could not
// be stored due to not enough gas set an error and let it be handled
// be stored due to not enough gas set an error and let it be handled
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment