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
e7c86936
Unverified
Commit
e7c86936
authored
Jun 30, 2021
by
Marius van der Wijden
Committed by
GitHub
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/ethapi: fix panic in access list creation (#23133)
Fixes test failure in the last commit.
parent
ec88bd0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
gethclient_test.go
ethclient/gethclient/gethclient_test.go
+4
-4
api.go
internal/ethapi/api.go
+2
-2
No files found.
ethclient/gethclient/gethclient_test.go
View file @
e7c86936
...
@@ -40,7 +40,7 @@ import (
...
@@ -40,7 +40,7 @@ import (
var
(
var
(
testKey
,
_
=
crypto
.
HexToECDSA
(
"b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"
)
testKey
,
_
=
crypto
.
HexToECDSA
(
"b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"
)
testAddr
=
crypto
.
PubkeyToAddress
(
testKey
.
PublicKey
)
testAddr
=
crypto
.
PubkeyToAddress
(
testKey
.
PublicKey
)
testBalance
=
big
.
NewInt
(
2e1
0
)
testBalance
=
big
.
NewInt
(
2e1
5
)
)
)
func
newTestBackend
(
t
*
testing
.
T
)
(
*
node
.
Node
,
[]
*
types
.
Block
)
{
func
newTestBackend
(
t
*
testing
.
T
)
(
*
node
.
Node
,
[]
*
types
.
Block
)
{
...
@@ -88,7 +88,7 @@ func generateTestChain() (*core.Genesis, []*types.Block) {
...
@@ -88,7 +88,7 @@ func generateTestChain() (*core.Genesis, []*types.Block) {
return
genesis
,
blocks
return
genesis
,
blocks
}
}
func
Test
E
thClient
(
t
*
testing
.
T
)
{
func
Test
Ge
thClient
(
t
*
testing
.
T
)
{
backend
,
_
:=
newTestBackend
(
t
)
backend
,
_
:=
newTestBackend
(
t
)
client
,
err
:=
backend
.
Attach
()
client
,
err
:=
backend
.
Attach
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -159,7 +159,7 @@ func testAccessList(t *testing.T, client *rpc.Client) {
...
@@ -159,7 +159,7 @@ func testAccessList(t *testing.T, client *rpc.Client) {
From
:
testAddr
,
From
:
testAddr
,
To
:
nil
,
To
:
nil
,
Gas
:
100000
,
Gas
:
100000
,
GasPrice
:
big
.
NewInt
(
1
),
GasPrice
:
big
.
NewInt
(
1
000000000
),
Value
:
big
.
NewInt
(
1
),
Value
:
big
.
NewInt
(
1
),
Data
:
common
.
FromHex
(
"0x608060806080608155fd"
),
Data
:
common
.
FromHex
(
"0x608060806080608155fd"
),
}
}
...
@@ -286,7 +286,7 @@ func testCallContract(t *testing.T, client *rpc.Client) {
...
@@ -286,7 +286,7 @@ func testCallContract(t *testing.T, client *rpc.Client) {
From
:
testAddr
,
From
:
testAddr
,
To
:
&
common
.
Address
{},
To
:
&
common
.
Address
{},
Gas
:
21000
,
Gas
:
21000
,
GasPrice
:
big
.
NewInt
(
1
),
GasPrice
:
big
.
NewInt
(
1
000000000
),
Value
:
big
.
NewInt
(
1
),
Value
:
big
.
NewInt
(
1
),
}
}
// CallContract without override
// CallContract without override
...
...
internal/ethapi/api.go
View file @
e7c86936
...
@@ -1417,11 +1417,11 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
...
@@ -1417,11 +1417,11 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
}
}
// Copy the original db so we don't modify it
// Copy the original db so we don't modify it
statedb
:=
db
.
Copy
()
statedb
:=
db
.
Copy
()
msg
:=
types
.
NewMessage
(
args
.
from
(),
args
.
To
,
uint64
(
*
args
.
Nonce
),
args
.
Value
.
ToInt
(),
uint64
(
*
args
.
Gas
),
args
.
GasPrice
.
ToInt
(),
nil
,
nil
,
args
.
data
(),
accessList
,
false
)
msg
:=
types
.
NewMessage
(
args
.
from
(),
args
.
To
,
uint64
(
*
args
.
Nonce
),
args
.
Value
.
ToInt
(),
uint64
(
*
args
.
Gas
),
args
.
GasPrice
.
ToInt
(),
big
.
NewInt
(
0
),
big
.
NewInt
(
0
)
,
args
.
data
(),
accessList
,
false
)
// Apply the transaction with the access list tracer
// Apply the transaction with the access list tracer
tracer
:=
vm
.
NewAccessListTracer
(
accessList
,
args
.
from
(),
to
,
precompiles
)
tracer
:=
vm
.
NewAccessListTracer
(
accessList
,
args
.
from
(),
to
,
precompiles
)
config
:=
vm
.
Config
{
Tracer
:
tracer
,
Debug
:
true
}
config
:=
vm
.
Config
{
Tracer
:
tracer
,
Debug
:
true
,
NoBaseFee
:
true
}
vmenv
,
_
,
err
:=
b
.
GetEVM
(
ctx
,
msg
,
statedb
,
header
,
&
config
)
vmenv
,
_
,
err
:=
b
.
GetEVM
(
ctx
,
msg
,
statedb
,
header
,
&
config
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
0
,
nil
,
err
return
nil
,
0
,
nil
,
err
...
...
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