The Status module that consumes go-ethereum https://status.im
Go to file
Andrea Maria Piana 58fcf809ea
Bug/fix pending peers segfault (#2004)
* Replace mclock with time in peer pools

we used mclock as golang before 1.9 did not support monotonic clocks,
https://github.com/gavv/monotime, it does now https://golang.org/pkg/time/
so we can fallback on the system implementation, which will return
nanoseconds with a resolution that is system dependent.

* Handle case where peer have same discovered time

In some system the resolution of the clock is not high enough so
multiple peers are added on the same nanosecond.

This result in the peer just added being immediately removed.

This code adds a check making sure we don't assume that a peer is added.

Another approach would be to make sure to include the peer in the list,
so prevent the peer just being added to be evicted, but it's slightly
more complicated and the resolution is generally accurate enough for our
purpose so that peers will be fresh enough if they have the same
discovered time.

It also adds a regression test, I had to use an interface to stub the
clock.

Fixes: https://github.com/status-im/nim-status-client/issues/522

* bump version to 0.55.3
2020-07-24 11:14:05 -04:00
.dependabot Patch/dependabot protocol (#1980) 2020-05-19 00:14:02 +01:00
.github Move to monorepo structure (#1684) 2019-11-21 17:19:22 +01:00
.vscode Add go.formatFlags to VS Code settings 2020-01-16 13:18:36 +01:00
_assets Address feedback 2020-06-03 11:07:04 +02:00
_examples Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
account Separate keystore directory per multiacc 2020-07-09 12:41:47 +03:00
api DeleteMultiaccount method 2020-07-13 16:20:02 +03:00
appdatabase Add replies to messages 2020-04-16 15:51:28 +02:00
bridge Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
build/bin add .gitkeep to build/bin so it always exists 2019-03-05 14:22:00 +01:00
cmd Address feedback 2020-06-03 11:07:04 +02:00
config update rendezvous nodes in configs 2020-03-17 15:47:07 +01:00
contracts Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
db Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
discovery Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
eth-node Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
exportlogs Upgrade geth to 1.9.5 and Whisper (#1617) 2019-10-04 17:21:24 +02:00
extkeys Upgrade extkeys (#1878) 2020-03-04 09:30:31 +01:00
logutils Integrate Whisper-Waku bridge in status-go (#1854) 2020-02-18 12:21:01 +01:00
mailserver use types.BytesToHash to print []byte variables 2020-06-04 09:45:47 +02:00
metrics Ignore full node flag when in topic mode 2020-03-23 15:10:07 +01:00
mobile DeleteMultiaccount method 2020-07-13 16:20:02 +03:00
multiaccounts fix: close resultsets so we don't leak them (#1809) 2020-05-14 11:51:32 +01:00
node Implement rate limiting by bytes 2020-06-15 19:46:23 +02:00
notifier Notifier package to interact with gorush notifications (#910) 2018-05-08 16:30:03 +02:00
params Implement rate limiting by bytes 2020-06-15 19:46:23 +02:00
peers Bug/fix pending peers segfault (#2004) 2020-07-24 11:14:05 -04:00
profiling Add profiling with pprof (#754) 2018-03-23 14:58:40 +01:00
protocol expose getContactByID method 2020-06-17 12:24:58 +02:00
rpc Nimbus node support 2020-01-20 13:15:17 +01:00
rtt rewrite mailserver systemd setup to a Makefile 2019-12-04 13:44:05 +01:00
services expose getContactByID method 2020-06-17 12:24:58 +02:00
signal Split shhext into shhext and wakuext (#1803) 2020-01-20 21:56:06 +01:00
sqlite Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
static Add replies to messages 2020-04-16 15:51:28 +02:00
t Add statusUpdate code (#1861) 2020-02-21 15:48:53 +01:00
timesource Nimbus node support 2020-01-20 13:15:17 +01:00
transactions Upgrade deps (#1892) 2020-03-09 08:55:58 +01:00
vendor Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
waku Use a single throttler per type 2020-06-15 19:46:23 +02:00
whisper Update README (#2003) 2020-07-24 11:16:15 +08:00
.codeclimate.yml add multi-account support (#1500) 2019-07-24 20:59:15 +02:00
.dockerignore Ignore *.test files from all folders (#635) 2018-02-08 14:23:08 +02:00
.gitignore Added IDE file to gitignore 2020-04-21 10:40:39 +02:00
.golangci.yml Remove protocol and eth-node submodules (#1835) 2020-02-10 12:22:37 +01:00
.travis.yml migrate to go 1.12 and go modules 2019-06-12 13:12:00 +02:00
BOOTNODE.md docs: clarify purpose and describe ports 2020-02-06 18:44:23 +01:00
CONTRIBUTING.md Update team collaboration forum (#1946) 2020-04-21 08:12:01 +01:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:29 +08:00
MAILSERVER.md expose the mailserver metrics port by default 2020-04-08 17:08:49 +02:00
Makefile Address feedback 2020-06-03 11:07:04 +02:00
README.md Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
RELEASING.md update RELEASING docs links to CI (#1506) 2019-06-28 10:37:34 +02:00
VERSION Bug/fix pending peers segfault (#2004) 2020-07-24 11:14:05 -04:00
WAKU.md Create WAKU.md with spec support (#1855) 2020-02-21 17:56:15 +08:00
go.mod Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
go.sum Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00