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
c4cd632f
Unverified
Commit
c4cd632f
authored
Aug 10, 2022
by
Péter Szilágyi
Committed by
GitHub
Aug 10, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25506 from ycyraum/apply-transaction-no-bc
core: remove unused bc ChainContext in applyTransaction
parents
1a18c14c
877ef7f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
state_processor.go
core/state_processor.go
+3
-3
No files found.
core/state_processor.go
View file @
c4cd632f
...
@@ -79,7 +79,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
...
@@ -79,7 +79,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
}
}
statedb
.
Prepare
(
tx
.
Hash
(),
i
)
statedb
.
Prepare
(
tx
.
Hash
(),
i
)
receipt
,
err
:=
applyTransaction
(
msg
,
p
.
config
,
p
.
bc
,
nil
,
gp
,
statedb
,
blockNumber
,
blockHash
,
tx
,
usedGas
,
vmenv
)
receipt
,
err
:=
applyTransaction
(
msg
,
p
.
config
,
nil
,
gp
,
statedb
,
blockNumber
,
blockHash
,
tx
,
usedGas
,
vmenv
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"could not apply tx %d [%v]: %w"
,
i
,
tx
.
Hash
()
.
Hex
(),
err
)
}
}
...
@@ -92,7 +92,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
...
@@ -92,7 +92,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
return
receipts
,
allLogs
,
*
usedGas
,
nil
return
receipts
,
allLogs
,
*
usedGas
,
nil
}
}
func
applyTransaction
(
msg
types
.
Message
,
config
*
params
.
ChainConfig
,
bc
ChainContext
,
author
*
common
.
Address
,
gp
*
GasPool
,
statedb
*
state
.
StateDB
,
blockNumber
*
big
.
Int
,
blockHash
common
.
Hash
,
tx
*
types
.
Transaction
,
usedGas
*
uint64
,
evm
*
vm
.
EVM
)
(
*
types
.
Receipt
,
error
)
{
func
applyTransaction
(
msg
types
.
Message
,
config
*
params
.
ChainConfig
,
author
*
common
.
Address
,
gp
*
GasPool
,
statedb
*
state
.
StateDB
,
blockNumber
*
big
.
Int
,
blockHash
common
.
Hash
,
tx
*
types
.
Transaction
,
usedGas
*
uint64
,
evm
*
vm
.
EVM
)
(
*
types
.
Receipt
,
error
)
{
// Create a new context to be used in the EVM environment.
// Create a new context to be used in the EVM environment.
txContext
:=
NewEVMTxContext
(
msg
)
txContext
:=
NewEVMTxContext
(
msg
)
evm
.
Reset
(
txContext
,
statedb
)
evm
.
Reset
(
txContext
,
statedb
)
...
@@ -149,5 +149,5 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
...
@@ -149,5 +149,5 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
// Create a new context to be used in the EVM environment
// Create a new context to be used in the EVM environment
blockContext
:=
NewEVMBlockContext
(
header
,
bc
,
author
)
blockContext
:=
NewEVMBlockContext
(
header
,
bc
,
author
)
vmenv
:=
vm
.
NewEVM
(
blockContext
,
vm
.
TxContext
{},
statedb
,
config
,
cfg
)
vmenv
:=
vm
.
NewEVM
(
blockContext
,
vm
.
TxContext
{},
statedb
,
config
,
cfg
)
return
applyTransaction
(
msg
,
config
,
bc
,
author
,
gp
,
statedb
,
header
.
Number
,
header
.
Hash
(),
tx
,
usedGas
,
vmenv
)
return
applyTransaction
(
msg
,
config
,
author
,
gp
,
statedb
,
header
.
Number
,
header
.
Hash
(),
tx
,
usedGas
,
vmenv
)
}
}
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