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
4be88401
Unverified
Commit
4be88401
authored
Feb 18, 2020
by
Gregory Markou
Committed by
GitHub
Feb 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: use dedicated SLOAD gas constant for EIP-2200 (#20646)
parent
529b81da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
eips.go
core/vm/eips.go
+2
-1
protocol_params.go
params/protocol_params.go
+1
-0
No files found.
core/vm/eips.go
View file @
4be88401
...
@@ -46,9 +46,9 @@ func EnableEIP(eipNum int, jt *JumpTable) error {
...
@@ -46,9 +46,9 @@ func EnableEIP(eipNum int, jt *JumpTable) error {
// - Define SELFBALANCE, with cost GasFastStep (5)
// - Define SELFBALANCE, with cost GasFastStep (5)
func
enable1884
(
jt
*
JumpTable
)
{
func
enable1884
(
jt
*
JumpTable
)
{
// Gas cost changes
// Gas cost changes
jt
[
SLOAD
]
.
constantGas
=
params
.
SloadGasEIP1884
jt
[
BALANCE
]
.
constantGas
=
params
.
BalanceGasEIP1884
jt
[
BALANCE
]
.
constantGas
=
params
.
BalanceGasEIP1884
jt
[
EXTCODEHASH
]
.
constantGas
=
params
.
ExtcodeHashGasEIP1884
jt
[
EXTCODEHASH
]
.
constantGas
=
params
.
ExtcodeHashGasEIP1884
jt
[
SLOAD
]
.
constantGas
=
params
.
SloadGasEIP1884
// New opcode
// New opcode
jt
[
SELFBALANCE
]
=
operation
{
jt
[
SELFBALANCE
]
=
operation
{
...
@@ -88,5 +88,6 @@ func opChainID(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memo
...
@@ -88,5 +88,6 @@ func opChainID(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memo
// enable2200 applies EIP-2200 (Rebalance net-metered SSTORE)
// enable2200 applies EIP-2200 (Rebalance net-metered SSTORE)
func
enable2200
(
jt
*
JumpTable
)
{
func
enable2200
(
jt
*
JumpTable
)
{
jt
[
SLOAD
]
.
constantGas
=
params
.
SloadGasEIP2200
jt
[
SSTORE
]
.
dynamicGas
=
gasSStoreEIP2200
jt
[
SSTORE
]
.
dynamicGas
=
gasSStoreEIP2200
}
}
params/protocol_params.go
View file @
4be88401
...
@@ -90,6 +90,7 @@ const (
...
@@ -90,6 +90,7 @@ const (
SloadGasFrontier
uint64
=
50
SloadGasFrontier
uint64
=
50
SloadGasEIP150
uint64
=
200
SloadGasEIP150
uint64
=
200
SloadGasEIP1884
uint64
=
800
// Cost of SLOAD after EIP 1884 (part of Istanbul)
SloadGasEIP1884
uint64
=
800
// Cost of SLOAD after EIP 1884 (part of Istanbul)
SloadGasEIP2200
uint64
=
800
// Cost of SLOAD after EIP 2200 (part of Istanbul)
ExtcodeHashGasConstantinople
uint64
=
400
// Cost of EXTCODEHASH (introduced in Constantinople)
ExtcodeHashGasConstantinople
uint64
=
400
// Cost of EXTCODEHASH (introduced in Constantinople)
ExtcodeHashGasEIP1884
uint64
=
700
// Cost of EXTCODEHASH after EIP 1884 (part in Istanbul)
ExtcodeHashGasEIP1884
uint64
=
700
// Cost of EXTCODEHASH after EIP 1884 (part in Istanbul)
SelfdestructGasEIP150
uint64
=
5000
// Cost of SELFDESTRUCT post EIP 150 (Tangerine)
SelfdestructGasEIP150
uint64
=
5000
// Cost of SELFDESTRUCT post EIP 150 (Tangerine)
...
...
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