Skip to content

Commit

Permalink
Merge pull request #2178 from PlatONnetwork/merge1.4.2_conflict
Browse files Browse the repository at this point in the history
merge 1.4.2
  • Loading branch information
benbaley authored Oct 24, 2023
2 parents 45345f2 + ab3522b commit fc3a613
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 47 deletions.
4 changes: 2 additions & 2 deletions cmd/utils/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ func monitorFreeDiskSpace(sigc chan os.Signal, path string, freeDiskSpaceCritica
break
}
if freeSpace < freeDiskSpaceCritical {
log.Error("Low disk space. Gracefully shutting down Geth to prevent database corruption.", "available", common.StorageSize(freeSpace))
log.Error("Low disk space. Gracefully shutting down PlatON to prevent database corruption.", "available", common.StorageSize(freeSpace))
sigc <- syscall.SIGTERM
break
} else if freeSpace < 2*freeDiskSpaceCritical {
log.Warn("Disk space is running low. Geth will shutdown if disk space runs below critical level.", "available", common.StorageSize(freeSpace), "critical_level", common.StorageSize(freeDiskSpaceCritical))
log.Warn("Disk space is running low. PlatON will shutdown if disk space runs below critical level.", "available", common.StorageSize(freeSpace), "critical_level", common.StorageSize(freeDiskSpaceCritical))
}
time.Sleep(60 * time.Second)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ var (
Usage: "Time interval to regenerate the trie cache journal",
Value: ethconfig.Defaults.TrieCleanCacheRejournal,
}
SnapshotFlag = cli.BoolTFlag{
SnapshotFlag = cli.BoolFlag{
Name: "snapshot",
Usage: `Enables snapshot-database mode (default = enable)`,
Usage: `Enables snapshot-database mode`,
}
BloomFilterSizeFlag = cli.Uint64Flag{
Name: "bloomfilter.size",
Expand Down
10 changes: 6 additions & 4 deletions eth/fetcher/block_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@ func (f *BlockFetcher) loop() {
break
}
// If we have a valid block number, check that it's potentially useful
if dist := int64(notification.number) - int64(f.chainHeight()); dist <= minQueueDist || dist > maxQueueDist {
log.Debug("Peer discarded announcement", "peer", notification.origin, "number", notification.number, "hash", notification.hash, "distance", dist)
blockAnnounceDropMeter.Mark(1)
break
if notification.number > 0 {
if dist := int64(notification.number) - int64(f.chainHeight()); dist <= minQueueDist || dist > maxQueueDist {
log.Debug("Peer discarded announcement", "peer", notification.origin, "number", notification.number, "hash", notification.hash, "distance", dist)
blockAnnounceDropMeter.Mark(1)
break
}
}
// All is well, schedule the announce if block's not yet downloading
if _, ok := f.fetching[notification.hash]; ok {
Expand Down
1 change: 1 addition & 0 deletions eth/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,5 @@ func newTestHandlerWithBlocks2(blocks int) *testHandler {
func (b *testHandler) close() {
b.handler.Stop()
b.chain.Stop()
b.db.Close()
}
2 changes: 1 addition & 1 deletion eth/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func testFastSyncDisabling(t *testing.T, protocol uint) {
t.Parallel()

// Create an empty handler and ensure it's in fast sync mode
empty := newTestHandler2()
empty := newTestHandler()
if atomic.LoadUint32(&empty.handler.fastSync) == 0 {
t.Fatalf("fast sync disabled on pristine blockchain")
}
Expand Down
28 changes: 15 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ go 1.17
require (
github.com/AlayaNetwork/graphql-go v1.2.1-0.20211227063951-8d66eefcb4e3
github.com/PlatONnetwork/wagon v0.6.1-0.20201026015350-67507c2a7b96
github.com/VictoriaMetrics/fastcache v1.6.0
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c
github.com/VictoriaMetrics/fastcache v1.5.7
github.com/btcsuite/btcd/btcutil v1.1.0
github.com/cespare/cp v0.1.0
github.com/davecgh/go-spew v1.1.1
Expand All @@ -29,11 +28,9 @@ require (
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/holiman/bloomfilter/v2 v2.0.3
github.com/holiman/uint256 v1.2.0
github.com/huin/goupnp v1.0.2
github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883
github.com/influxdata/influxdb-client-go/v2 v2.4.0
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
github.com/jackpal/go-nat-pmp v1.0.2
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88
github.com/influxdata/influxdb v1.7.6
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458
github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b
github.com/julienschmidt/httprouter v1.3.0
github.com/karalabe/hid v0.0.0-20170821103837-f00545f9f374
Expand All @@ -51,25 +48,29 @@ require (
github.com/rs/cors v1.7.0
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tealeg/xlsx v1.0.5
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/net v0.9.0
golang.org/x/crypto v0.14.0
golang.org/x/sync v0.1.0
golang.org/x/sys v0.7.0
golang.org/x/text v0.9.0
golang.org/x/sys v0.13.0
golang.org/x/text v0.13.0
golang.org/x/time v0.3.0
golang.org/x/tools v0.8.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6
gopkg.in/urfave/cli.v1 v1.20.0
gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools v2.2.0+incompatible
gotest.tools/v3 v3.4.0 // indirect
)

require (
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c
github.com/herumi/bls v1.37.0
github.com/influxdata/influxdb-client-go/v2 v2.12.3
golang.org/x/net v0.17.0
)

require (
github.com/AlayaNetwork/Alaya-Go v0.16.2 // indirect
Expand All @@ -81,6 +82,7 @@ require (
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
Expand Down
Loading

0 comments on commit fc3a613

Please sign in to comment.