mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
core: clean up parallal state processor
This commit is contained in:
parent
1d942bddf3
commit
8182ab0b06
2 changed files with 14 additions and 2 deletions
|
|
@ -100,6 +100,12 @@ func (p *ParallelStateProcessor) prepareExecResult(block *types.Block, allStateR
|
|||
allLogs = append(allLogs, result.receipt.Logs...)
|
||||
allReceipts = append(allReceipts, result.receipt)
|
||||
}
|
||||
// Block gas limit is enforced against usedGas (pre-refund after Amsterdam, post-refund before).
|
||||
if usedGas > header.GasLimit {
|
||||
return &ProcessResultWithMetrics{
|
||||
ProcessResult: &ProcessResult{Error: fmt.Errorf("gas limit exceeded")},
|
||||
}
|
||||
}
|
||||
|
||||
// Read requests if Prague is enabled.
|
||||
if p.chainConfig().IsPrague(block.Number(), block.Time()) {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ func TestBlockchain(t *testing.T) {
|
|||
bt.skipLoad(`.*\.meta/.*`)
|
||||
|
||||
bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
|
||||
execBlockTest(t, bt, test)
|
||||
execBlockTest(t, bt, test, false)
|
||||
})
|
||||
// There is also a LegacyTests folder, containing blockchain tests generated
|
||||
// prior to Istanbul. However, they are all derived from GeneralStateTests,
|
||||
|
|
@ -144,7 +144,7 @@ func testExecutionSpecBlocktests(t *testing.T, testDir string) {
|
|||
bt.skipLoad(".*prague/eip7002_el_triggerable_withdrawals/test_system_contract_deployment.json")
|
||||
|
||||
bt.walk(t, testDir, func(t *testing.T, name string, test *BlockTest) {
|
||||
execBlockTest(t, bt, test)
|
||||
execBlockTest(t, bt, test, true)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -158,6 +158,8 @@ func TestExecutionSpecBlocktestsBAL(t *testing.T) {
|
|||
testExecutionSpecBlocktests(t, executionSpecBALBlockchainTestDir)
|
||||
}
|
||||
|
||||
var failures = 0
|
||||
|
||||
func execBlockTest(t *testing.T, bt *testMatcher, test *BlockTest, buildAndVerifyBAL bool) {
|
||||
// Define all the different flag combinations we should run the tests with,
|
||||
// picking only one for short tests.
|
||||
|
|
@ -175,6 +177,10 @@ func execBlockTest(t *testing.T, bt *testMatcher, test *BlockTest, buildAndVerif
|
|||
for _, snapshot := range snapshotConf {
|
||||
for _, dbscheme := range dbschemeConf {
|
||||
if err := bt.checkFailure(t, test.Run(snapshot, dbscheme, true, buildAndVerifyBAL, nil, nil)); err != nil {
|
||||
failures++
|
||||
if failures > 10 {
|
||||
panic("adsf")
|
||||
}
|
||||
t.Errorf("test with config {snapshotter:%v, scheme:%v} failed: %v", snapshot, dbscheme, err)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue