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
d02301f7
Unverified
Commit
d02301f7
authored
May 13, 2020
by
Gary Rong
Committed by
GitHub
May 13, 2020
Browse files
Options
Downloads
Patches
Plain Diff
core: fix missing receipt on Clique crashes (#21045)
* core: fix missing receipt * core: address comment
parent
0b639154
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/blockchain.go
+14
-0
14 additions, 0 deletions
core/blockchain.go
with
14 additions
and
0 deletions
core/blockchain.go
+
14
−
0
View file @
d02301f7
...
@@ -1731,6 +1731,20 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
...
@@ -1731,6 +1731,20 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
"uncles"
,
len
(
block
.
Uncles
()),
"txs"
,
len
(
block
.
Transactions
()),
"gas"
,
block
.
GasUsed
(),
"uncles"
,
len
(
block
.
Uncles
()),
"txs"
,
len
(
block
.
Transactions
()),
"gas"
,
block
.
GasUsed
(),
"root"
,
block
.
Root
())
"root"
,
block
.
Root
())
// Special case. Commit the empty receipt slice if we meet the known
// block in the middle. It can only happen in the clique chain. Whenever
// we insert blocks via `insertSideChain`, we only commit `td`, `header`
// and `body` if it's non-existent. Since we don't have receipts without
// reexecution, so nothing to commit. But if the sidechain will be adpoted
// as the canonical chain eventually, it needs to be reexecuted for missing
// state, but if it's this special case here(skip reexecution) we will lose
// the empty receipt entry.
if
len
(
block
.
Transactions
())
==
0
{
rawdb
.
WriteReceipts
(
bc
.
db
,
block
.
Hash
(),
block
.
NumberU64
(),
nil
)
}
else
{
log
.
Error
(
"Please file an issue, skip known block execution without receipt"
,
"hash"
,
block
.
Hash
(),
"number"
,
block
.
NumberU64
())
}
if
err
:=
bc
.
writeKnownBlock
(
block
);
err
!=
nil
{
if
err
:=
bc
.
writeKnownBlock
(
block
);
err
!=
nil
{
return
it
.
index
,
err
return
it
.
index
,
err
}
}
...
...
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