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
779ddb18
Commit
779ddb18
authored
Oct 20, 2016
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm, params: EIP160: EXP reprice
parent
445feaee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
vm.go
core/vm/vm.go
+2
-1
gas_table.go
params/gas_table.go
+4
-8
No files found.
core/vm/vm.go
View file @
779ddb18
...
...
@@ -313,7 +313,8 @@ func calculateGasAndSize(gasTable params.GasTable, env Environment, contract *Co
quadMemGas
(
mem
,
newMemSize
,
gas
)
case
EXP
:
gas
.
Add
(
gas
,
new
(
big
.
Int
)
.
Mul
(
big
.
NewInt
(
int64
(
len
(
stack
.
data
[
stack
.
len
()
-
2
]
.
Bytes
()))),
params
.
ExpByteGas
))
expByteLen
:=
int64
((
stack
.
data
[
stack
.
len
()
-
2
]
.
BitLen
()
+
7
)
/
8
)
gas
.
Add
(
gas
,
new
(
big
.
Int
)
.
Mul
(
big
.
NewInt
(
expByteLen
),
gasTable
.
ExpByte
))
case
SSTORE
:
err
:=
stack
.
require
(
2
)
if
err
!=
nil
{
...
...
params/gas_table.go
View file @
779ddb18
...
...
@@ -26,9 +26,7 @@ type GasTable struct {
Calls
*
big
.
Int
Suicide
*
big
.
Int
Exp
*
big
.
Int
ExpOneByte
*
big
.
Int
Exp256
*
big
.
Int
ExpByte
*
big
.
Int
// CreateBySuicide occurs when the
// refunded account is one that does
...
...
@@ -48,7 +46,7 @@ var (
SLoad
:
big
.
NewInt
(
50
),
Calls
:
big
.
NewInt
(
40
),
Suicide
:
big
.
NewInt
(
0
),
Exp
:
big
.
NewInt
(
2
0
),
Exp
Byte
:
big
.
NewInt
(
1
0
),
// explicitly set to nil to indicate
// this rule does not apply to homestead.
...
...
@@ -66,7 +64,7 @@ var (
SLoad
:
big
.
NewInt
(
200
),
Calls
:
big
.
NewInt
(
700
),
Suicide
:
big
.
NewInt
(
5000
),
Exp
:
big
.
NewInt
(
2
0
),
Exp
Byte
:
big
.
NewInt
(
1
0
),
CreateBySuicide
:
big
.
NewInt
(
25000
),
}
...
...
@@ -78,9 +76,7 @@ var (
SLoad
:
big
.
NewInt
(
200
),
Calls
:
big
.
NewInt
(
700
),
Suicide
:
big
.
NewInt
(
5000
),
Exp
:
big
.
NewInt
(
80
),
ExpOneByte
:
big
.
NewInt
(
160
),
Exp256
:
big
.
NewInt
(
2640
),
ExpByte
:
big
.
NewInt
(
50
),
CreateBySuicide
:
big
.
NewInt
(
25000
),
}
...
...
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