mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
verify age of uncle's parent (#719)
why: parent must be older => check needed for bcFrontierToHomestead test cases UncleFromFrontierInHomestead and UnclePopulation
This commit is contained in:
parent
e7745a6456
commit
cad1b5a678
@ -19,7 +19,9 @@ template runTest*(suiteName: string, caseFolder: string, body: untyped) =
|
||||
disableParamFiltering()
|
||||
suite suiteName:
|
||||
var status = initOrderedTable[string, OrderedTable[string, Status]]()
|
||||
for fileName {.inject.} in walkDirRec(caseFolder):
|
||||
for fileName {.inject.} in walkDirRec(
|
||||
caseFolder, yieldFilter = {pcFile,pcLinkToFile}):
|
||||
|
||||
if not fileName.endsWith(".json"):
|
||||
continue
|
||||
|
||||
|
@ -249,6 +249,13 @@ proc validateUncles(chainDB: BaseChainDB; header: BlockHeader;
|
||||
(uncle.parentHash == header.parentHash):
|
||||
return err("Uncle's parent is not an ancestor")
|
||||
|
||||
# check uncle against own parent
|
||||
var parent: BlockHeader
|
||||
if not chainDB.getBlockHeader(uncle.parentHash,parent):
|
||||
return err("Uncle's parent has gone missing")
|
||||
if uncle.timestamp <= parent.timestamp:
|
||||
return err("Uncle's parent must me older")
|
||||
|
||||
# Now perform VM level validation of the uncle
|
||||
if checkSealOK:
|
||||
result = hashCache.validateSeal(uncle)
|
||||
|
Loading…
x
Reference in New Issue
Block a user