Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative time for Whisper TTL #49

Open
mandrigin opened this issue Feb 20, 2018 · 0 comments
Open

Use relative time for Whisper TTL #49

mandrigin opened this issue Feb 20, 2018 · 0 comments

Comments

@mandrigin
Copy link

mandrigin commented Feb 20, 2018

If a device has skewed clock settings, then the whisper messages it sends are discarded by the TTL check.

From the upstream issue:

Instead of keeping the absolute timestamp of when the envelope was created, we can make TTL counter relative to now() of the current node.

To do that, we create an envelope with a creation time and a TTL (e.g. 50 seconds), we enqueue it.
Just before sending it to another peer via a socket, we subtract now() - creation_time from TTL, and write this value there.
On the receiving node, we update creation_time to now(). Again, just before sending, we subtract now() - creation_time from TTL.

That makes TTL to be smaller and smaller with each hop.

We can keep the logic of discarding messages as it is now.

Upstream issue: ethereum#16134
Status-go issue: status-im/status-go#687

richard-ramos pushed a commit that referenced this issue Mar 2, 2023
* ethdb: use pebble

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

foo

update

* apply suggested changes

* flags: go format

node: fix ddir lookup mistake

accounts/abi/bind: fix go.mod replacement for generated binding

deps: update pebble + with fix 32-bit build

* ethdb/pebble: respect max memtable size

* core/rawdb, ethdb: enable pebble on non-32bit platforms only

* core/rawdb: fix build tags, fix some review concerns

* core/rawdb: refactor methods for database opening

* core/rawdb: remove erroneous build tag

* cmd/geth: fix the flag default handling + testcase

* cmd/geth: improve testing regarding custom backends

* ethdb/pebble, deps: update pebble dependency

* core/rawdb: replace method with Open

* ethdb/pebble: several updates for pebble (#49)

* ethdb/pebble: fix size count in batch

* ethdb/pebble: disable seek compaction

* ethdb/pebble: more fixes

* ethdb, core, cmd: polish and fixes (#50)

* cmd/utils, core/rawdb, ethdb/pebble: address some review concerns

* Update flags.go

* ethdb/pebble: minor refactors

* ethdb/pebble: avoid copy on batch replay

* ethdb: fix compilation flaw

* cmd: fix test fail due to mismatching error message

* cmd/geth, node: rename backingdb to db.engine

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants