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
080b6ebe
Unverified
Commit
080b6ebe
authored
Jun 16, 2021
by
Martin Holst Swende
Committed by
GitHub
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: evm fix panic (#23047)
* core/vm: evm fix panic * core/vm/runtime: default to params.initialbasefee
parent
ae315ef7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
env.go
core/vm/runtime/env.go
+1
-0
runtime.go
core/vm/runtime/runtime.go
+5
-1
No files found.
core/vm/runtime/env.go
View file @
080b6ebe
...
@@ -35,6 +35,7 @@ func NewEnv(cfg *Config) *vm.EVM {
...
@@ -35,6 +35,7 @@ func NewEnv(cfg *Config) *vm.EVM {
Time
:
cfg
.
Time
,
Time
:
cfg
.
Time
,
Difficulty
:
cfg
.
Difficulty
,
Difficulty
:
cfg
.
Difficulty
,
GasLimit
:
cfg
.
GasLimit
,
GasLimit
:
cfg
.
GasLimit
,
BaseFee
:
cfg
.
BaseFee
,
}
}
return
vm
.
NewEVM
(
blockContext
,
txContext
,
cfg
.
State
,
cfg
.
ChainConfig
,
cfg
.
EVMConfig
)
return
vm
.
NewEVM
(
blockContext
,
txContext
,
cfg
.
State
,
cfg
.
ChainConfig
,
cfg
.
EVMConfig
)
...
...
core/vm/runtime/runtime.go
View file @
080b6ebe
...
@@ -43,6 +43,7 @@ type Config struct {
...
@@ -43,6 +43,7 @@ type Config struct {
Value
*
big
.
Int
Value
*
big
.
Int
Debug
bool
Debug
bool
EVMConfig
vm
.
Config
EVMConfig
vm
.
Config
BaseFee
*
big
.
Int
State
*
state
.
StateDB
State
*
state
.
StateDB
GetHashFn
func
(
n
uint64
)
common
.
Hash
GetHashFn
func
(
n
uint64
)
common
.
Hash
...
@@ -66,7 +67,7 @@ func setDefaults(cfg *Config) {
...
@@ -66,7 +67,7 @@ func setDefaults(cfg *Config) {
IstanbulBlock
:
new
(
big
.
Int
),
IstanbulBlock
:
new
(
big
.
Int
),
MuirGlacierBlock
:
new
(
big
.
Int
),
MuirGlacierBlock
:
new
(
big
.
Int
),
BerlinBlock
:
new
(
big
.
Int
),
BerlinBlock
:
new
(
big
.
Int
),
LondonBlock
:
n
il
,
LondonBlock
:
n
ew
(
big
.
Int
)
,
}
}
}
}
...
@@ -93,6 +94,9 @@ func setDefaults(cfg *Config) {
...
@@ -93,6 +94,9 @@ func setDefaults(cfg *Config) {
return
common
.
BytesToHash
(
crypto
.
Keccak256
([]
byte
(
new
(
big
.
Int
)
.
SetUint64
(
n
)
.
String
())))
return
common
.
BytesToHash
(
crypto
.
Keccak256
([]
byte
(
new
(
big
.
Int
)
.
SetUint64
(
n
)
.
String
())))
}
}
}
}
if
cfg
.
BaseFee
==
nil
{
cfg
.
BaseFee
=
big
.
NewInt
(
params
.
InitialBaseFee
)
}
}
}
// Execute executes the code using the input as call data during the execution.
// Execute executes the code using the input as call data during the execution.
...
...
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