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
6e6b5087
Unverified
Commit
6e6b5087
authored
Aug 30, 2022
by
Sina Mahmoodi
Committed by
GitHub
Aug 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: fix legacy receipt detection for empty db (#25609)
parent
c394c308
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
config.go
cmd/geth/config.go
+3
-2
dbcmd.go
cmd/geth/dbcmd.go
+5
-1
No files found.
cmd/geth/config.go
View file @
6e6b5087
...
...
@@ -175,12 +175,13 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
if
cfg
.
Eth
.
NetworkId
==
1
&&
ghash
==
params
.
MainnetGenesisHash
{
firstIdx
=
46147
}
isLegacy
,
_
,
err
:=
dbHasLegacyReceipts
(
eth
.
ChainDb
(),
firstIdx
)
isLegacy
,
firstLegacy
,
err
:=
dbHasLegacyReceipts
(
eth
.
ChainDb
(),
firstIdx
)
if
err
!=
nil
{
log
.
Error
(
"Failed to check db for legacy receipts"
,
"err"
,
err
)
}
else
if
isLegacy
{
stack
.
Close
()
utils
.
Fatalf
(
"Database has receipts with a legacy format. Please run `geth db freezer-migrate`."
)
log
.
Error
(
"Database has receipts with a legacy format"
,
"firstLegacy"
,
firstLegacy
)
utils
.
Fatalf
(
"Aborting. Please run `geth db freezer-migrate`."
)
}
}
...
...
cmd/geth/dbcmd.go
View file @
6e6b5087
...
...
@@ -822,11 +822,15 @@ func dbHasLegacyReceipts(db ethdb.Database, firstIdx uint64) (bool, uint64, erro
}
}
}
// Is first non-empty receipt legacy?
first
,
err
:=
db
.
Ancient
(
"receipts"
,
firstIdx
)
if
err
!=
nil
{
return
false
,
0
,
err
}
// We looped over all receipts and they were all empty
if
bytes
.
Equal
(
first
,
emptyRLPList
)
{
return
false
,
0
,
nil
}
// Is first non-empty receipt legacy?
legacy
,
err
=
types
.
IsLegacyStoredReceipts
(
first
)
return
legacy
,
firstIdx
,
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