Patch for concurrent iterator & others (onto v1.11.6) #386

Closed
roysc wants to merge 1565 commits from v1.11.6-statediff-v5 into master
4 changed files with 7 additions and 7 deletions
Showing only changes of commit 31870a59ff - Show all commits

View File

@ -62,6 +62,7 @@ func BenchmarkBloomBits32k(b *testing.B) {
const benchFilterCnt = 2000 const benchFilterCnt = 2000
func benchmarkBloomBits(b *testing.B, sectionSize uint64) { func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
b.Skip("test disabled: this tests presume (and modify) an existing datadir.")
benchDataDir := node.DefaultDataDir() + "/geth/chaindata" benchDataDir := node.DefaultDataDir() + "/geth/chaindata"
b.Log("Running bloombits benchmark section size:", sectionSize) b.Log("Running bloombits benchmark section size:", sectionSize)
@ -155,6 +156,7 @@ func clearBloomBits(db ethdb.Database) {
} }
func BenchmarkNoBloomBits(b *testing.B) { func BenchmarkNoBloomBits(b *testing.B) {
b.Skip("test disabled: this tests presume (and modify) an existing datadir.")
benchDataDir := node.DefaultDataDir() + "/geth/chaindata" benchDataDir := node.DefaultDataDir() + "/geth/chaindata"
b.Log("Running benchmark without bloombits") b.Log("Running benchmark without bloombits")
db, err := rawdb.NewLevelDBDatabase(benchDataDir, 128, 1024, "", false) db, err := rawdb.NewLevelDBDatabase(benchDataDir, 128, 1024, "", false)

View File

@ -65,15 +65,19 @@ func BenchmarkFilters(b *testing.B) {
case 2403: case 2403:
receipt := makeReceipt(addr1) receipt := makeReceipt(addr1)
gen.AddUncheckedReceipt(receipt) gen.AddUncheckedReceipt(receipt)
gen.AddUncheckedTx(types.NewTransaction(999, common.HexToAddress("0x999"), big.NewInt(999), 999, gen.BaseFee(), nil))
case 1034: case 1034:
receipt := makeReceipt(addr2) receipt := makeReceipt(addr2)
gen.AddUncheckedReceipt(receipt) gen.AddUncheckedReceipt(receipt)
gen.AddUncheckedTx(types.NewTransaction(999, common.HexToAddress("0x999"), big.NewInt(999), 999, gen.BaseFee(), nil))
case 34: case 34:
receipt := makeReceipt(addr3) receipt := makeReceipt(addr3)
gen.AddUncheckedReceipt(receipt) gen.AddUncheckedReceipt(receipt)
gen.AddUncheckedTx(types.NewTransaction(999, common.HexToAddress("0x999"), big.NewInt(999), 999, gen.BaseFee(), nil))
case 99999: case 99999:
receipt := makeReceipt(addr4) receipt := makeReceipt(addr4)
gen.AddUncheckedReceipt(receipt) gen.AddUncheckedReceipt(receipt)
gen.AddUncheckedTx(types.NewTransaction(999, common.HexToAddress("0x999"), big.NewInt(999), 999, gen.BaseFee(), nil))
} }
}) })

View File

@ -337,6 +337,7 @@ func BenchmarkTransactionTrace(b *testing.B) {
Time: new(big.Int).SetUint64(uint64(5)), Time: new(big.Int).SetUint64(uint64(5)),
Difficulty: big.NewInt(0xffffffff), Difficulty: big.NewInt(0xffffffff),
GasLimit: gas, GasLimit: gas,
BaseFee: big.NewInt(8),
} }
alloc := core.GenesisAlloc{} alloc := core.GenesisAlloc{}
// The code pushes 'deadbeef' into memory, then the other params, and calls CREATE2, then returns // The code pushes 'deadbeef' into memory, then the other params, and calls CREATE2, then returns

View File

@ -22,7 +22,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"io"
"math/rand" "math/rand"
"sync" "sync"
"time" "time"
@ -695,12 +694,6 @@ func (net *Network) Shutdown() {
if err := node.Stop(); err != nil { if err := node.Stop(); err != nil {
log.Warn("Can't stop node", "id", node.ID(), "err", err) log.Warn("Can't stop node", "id", node.ID(), "err", err)
} }
// If the node has the close method, call it.
if closer, ok := node.Node.(io.Closer); ok {
if err := closer.Close(); err != nil {
log.Warn("Can't close node", "id", node.ID(), "err", err)
}
}
} }
close(net.quitc) close(net.quitc)
} }