good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
60293820
Unverified
Commit
60293820
authored
May 8, 2017
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
core: fix processing regression during receipt import
parent
dd483d7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/blockchain.go
+4
-3
4 additions, 3 deletions
core/blockchain.go
core/state_transition.go
+1
-5
1 addition, 5 deletions
core/state_transition.go
with
5 additions
and
8 deletions
core/blockchain.go
+
4
−
3
View file @
60293820
...
@@ -665,10 +665,11 @@ func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts ty
...
@@ -665,10 +665,11 @@ func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts ty
// The transaction hash can be retrieved from the transaction itself
// The transaction hash can be retrieved from the transaction itself
receipts
[
j
]
.
TxHash
=
transactions
[
j
]
.
Hash
()
receipts
[
j
]
.
TxHash
=
transactions
[
j
]
.
Hash
()
tx
,
_
:=
transactions
[
j
]
.
AsMessage
(
signer
)
// The contract address can be derived from the transaction itself
// The contract address can be derived from the transaction itself
if
MessageCreatesContract
(
tx
)
{
if
transactions
[
j
]
.
To
()
==
nil
{
receipts
[
j
]
.
ContractAddress
=
crypto
.
CreateAddress
(
tx
.
From
(),
tx
.
Nonce
())
// Deriving the signer is expensive, only do if it's actually needed
from
,
_
:=
types
.
Sender
(
signer
,
transactions
[
j
])
receipts
[
j
]
.
ContractAddress
=
crypto
.
CreateAddress
(
from
,
transactions
[
j
]
.
Nonce
())
}
}
// The used gas can be calculated based on previous receipts
// The used gas can be calculated based on previous receipts
if
j
==
0
{
if
j
==
0
{
...
...
This diff is collapsed.
Click to expand it.
core/state_transition.go
+
1
−
5
View file @
60293820
...
@@ -78,10 +78,6 @@ type Message interface {
...
@@ -78,10 +78,6 @@ type Message interface {
Data
()
[]
byte
Data
()
[]
byte
}
}
func
MessageCreatesContract
(
msg
Message
)
bool
{
return
msg
.
To
()
==
nil
}
// IntrinsicGas computes the 'intrinsic gas' for a message
// IntrinsicGas computes the 'intrinsic gas' for a message
// with the given data.
// with the given data.
//
//
...
@@ -220,7 +216,7 @@ func (self *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *b
...
@@ -220,7 +216,7 @@ func (self *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *b
sender
:=
self
.
from
()
// err checked in preCheck
sender
:=
self
.
from
()
// err checked in preCheck
homestead
:=
self
.
evm
.
ChainConfig
()
.
IsHomestead
(
self
.
evm
.
BlockNumber
)
homestead
:=
self
.
evm
.
ChainConfig
()
.
IsHomestead
(
self
.
evm
.
BlockNumber
)
contractCreation
:=
MessageCreatesContract
(
msg
)
contractCreation
:=
msg
.
To
()
==
nil
// Pay intrinsic gas
// Pay intrinsic gas
// TODO convert to uint64
// TODO convert to uint64
intrinsicGas
:=
IntrinsicGas
(
self
.
data
,
contractCreation
,
homestead
)
intrinsicGas
:=
IntrinsicGas
(
self
.
data
,
contractCreation
,
homestead
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment