fixes fork choice
This commit is contained in:
parent
10fb81b781
commit
ed01201233
|
@ -50,13 +50,13 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
|
|||
```diff
|
||||
+ CallContractThatCreateContractBeforeAndAfterSwitchover.json OK
|
||||
+ ContractCreationFailsOnHomestead.json OK
|
||||
HomesteadOverrideFrontier.json Skip
|
||||
+ HomesteadOverrideFrontier.json OK
|
||||
+ UncleFromFrontierInHomestead.json OK
|
||||
+ UnclePopulation.json OK
|
||||
blockChainFrontierWithLargerTDvsHomesteadBlockchain.json Skip
|
||||
blockChainFrontierWithLargerTDvsHomesteadBlockchain2.json Skip
|
||||
+ blockChainFrontierWithLargerTDvsHomesteadBlockchain.json OK
|
||||
+ blockChainFrontierWithLargerTDvsHomesteadBlockchain2.json OK
|
||||
```
|
||||
OK: 4/7 Fail: 0/7 Skip: 3/7
|
||||
OK: 7/7 Fail: 0/7 Skip: 0/7
|
||||
## bcGasPricerTest
|
||||
```diff
|
||||
+ RPC_API_Test.json OK
|
||||
|
@ -404,4 +404,4 @@ OK: 20/20 Fail: 0/20 Skip: 0/20
|
|||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
|
||||
---TOTAL---
|
||||
OK: 266/318 Fail: 0/318 Skip: 52/318
|
||||
OK: 269/318 Fail: 0/318 Skip: 49/318
|
||||
|
|
|
@ -516,9 +516,10 @@ proc importBlock(tester: var Tester, chainDB: BaseChainDB,
|
|||
discard chainDB.persistHeaderToDb(preminedBlock.header)
|
||||
|
||||
proc applyFixtureBlockToChain(tester: var Tester, tb: TesterBlock,
|
||||
chainDB: BaseChainDB, fork: Fork, checkSeal, validation = true): (PlainBlock, PlainBlock, Blob) =
|
||||
chainDB: BaseChainDB, checkSeal, validation = true): (PlainBlock, PlainBlock, Blob) =
|
||||
var
|
||||
preminedBlock = rlp.decode(tb.headerRLP, PlainBlock)
|
||||
fork = vmConfigToFork(tester.vmConfig, preminedBlock.header.blockNumber)
|
||||
minedBlock = tester.importBlock(chainDB, preminedBlock, fork, checkSeal, validation)
|
||||
rlpEncodedMinedBlock = rlp.encode(minedBlock)
|
||||
result = (preminedBlock, minedBlock, rlpEncodedMinedBlock)
|
||||
|
@ -532,22 +533,18 @@ proc runTester(tester: var Tester, chainDB: BaseChainDB, testStatusIMPL: var Tes
|
|||
check chainDB.getCanonicalHead().blockHash == tester.genesisBlockHeader.blockHash
|
||||
let checkSeal = tester.shouldCheckSeal
|
||||
|
||||
for testerBlock in tester.blocks:
|
||||
for idx, testerBlock in tester.blocks:
|
||||
let shouldBeGoodBlock = testerBlock.blockHeader.isSome
|
||||
|
||||
if shouldBeGoodBlock:
|
||||
let blockNumber = testerBlock.blockHeader.get().blockNumber
|
||||
let fork = vmConfigToFork(tester.vmConfig, blockNumber)
|
||||
|
||||
let (preminedBlock, minedBlock, blockRlp) = tester.applyFixtureBlockToChain(
|
||||
testerBlock, chainDB, fork, checkSeal, validation = false) # we manually validate below
|
||||
testerBlock, chainDB, checkSeal, validation = false) # we manually validate below
|
||||
check validateBlock(chainDB, preminedBlock, checkSeal) == true
|
||||
else:
|
||||
var noError = true
|
||||
try:
|
||||
let fork = vmConfigToFork(tester.vmConfig, 1.u256)
|
||||
let (_, _, _) = tester.applyFixtureBlockToChain(testerBlock,
|
||||
chainDB, fork, checkSeal, validation = true)
|
||||
chainDB, checkSeal, validation = true)
|
||||
except ValueError, ValidationError, BlockNotFound, MalformedRlpError, RlpTypeMismatch:
|
||||
# failure is expected on this bad block
|
||||
noError = false
|
||||
|
|
|
@ -73,14 +73,5 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
|
|||
"randomStatetest623BC.json",
|
||||
"randomStatetest76BC.json",
|
||||
"randomStatetest79BC.json",
|
||||
|
||||
# bcFrontierToHomestead
|
||||
"HomesteadOverrideFrontier.json",
|
||||
"blockChainFrontierWithLargerTDvsHomesteadBlockchain.json",
|
||||
"blockChainFrontierWithLargerTDvsHomesteadBlockchain2.json",
|
||||
|
||||
# bcInvalidHeaderTest
|
||||
#"DifficultyIsZero.json",
|
||||
#"wrongDifficulty.json",
|
||||
]
|
||||
result = name in allowedFailingGeneralStateTests
|
||||
|
|
Loading…
Reference in New Issue