This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(whisper): change expiry unix_time + ttl + work
#10587
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
niklasad1
added
A0-pleasereview 🤓
Pull request needs code review.
A2-insubstantial 👶
Pull request requires no code review (e.g., a sub-repository hash update).
B1-patch-beta 🕷🕷
B0-patch-stable 🕷
Pull request should also be back-ported to the stable branch.
labels
Apr 11, 2019
niklasad1
force-pushed
the
whisper-fix-unintentional-sub
branch
from
April 11, 2019 16:05
e105b81
to
52c35b1
Compare
niklasad1
removed
the
A2-insubstantial 👶
Pull request requires no code review (e.g., a sub-repository hash update).
label
Apr 11, 2019
TriplEight
approved these changes
Apr 11, 2019
rphmeier
reviewed
Apr 15, 2019
whisper/src/message.rs
Outdated
@@ -271,7 +271,7 @@ impl Message { | |||
assert!(params.ttl > 0); | |||
|
|||
let expiry = { | |||
let after_mining = SystemTime::now().checked_sub(Duration::from_millis(params.work)) | |||
let after_mining = SystemTime::now().checked_add(Duration::from_secs(params.ttl)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be SystemTime::now() + params.work + params.ttl
? And the var name should be changed to reflect meaning of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agree
niklasad1
force-pushed
the
whisper-fix-unintentional-sub
branch
from
April 15, 2019 12:45
52c35b1
to
c74a50e
Compare
niklasad1
changed the title
fix(whisper): expiry should be
fix(whisper): change expiry Apr 15, 2019
UNIX_TIME
+ TTL
unix_time + ttl + work
rphmeier
approved these changes
Apr 15, 2019
soc1c
pushed a commit
that referenced
this pull request
May 10, 2019
soc1c
pushed a commit
that referenced
this pull request
May 10, 2019
soc1c
added a commit
that referenced
this pull request
May 10, 2019
* version: bump stable to 2.4.6 * fix(whisper expiry): current time + work + ttl (#10587) * update bootnodes (#10595) * config: update goerli bootnodes * config: update kotti bootnodes * Constantinople HF on POA Core (#10606) * Constantinople HF on POA Core Plan Constantinople/St.Petersfork HF on POA Core network at block 8582254. Original PR in POA repository: poanetwork/poa-chain-spec#110 * Remove extra empty line * evm: add some mulmod benches (#10600) * evm: add blockhash_mulmod bench * evm: use num-bigint for mod ops * Update kovan.json to switch validator set to POA Consensus Contracts (#10628) * Fix publish docs (#10635) * Fix publish docs * this never should be forced, either way compiling previous versions will produce outdated docs * fix array, var was moved to the group project global variables list
soc1c
added a commit
that referenced
this pull request
May 10, 2019
* version: bump beta to 2.5.1 * fix(whisper expiry): current time + work + ttl (#10587) * update bootnodes (#10595) * config: update goerli bootnodes * config: update kotti bootnodes * adds rpc error message for --no-ancient-blocks (#10608) * adds error message for --no-ancient-blocks, closes #10261 * Apply suggestions from code review Co-Authored-By: seunlanlege <seunlanlege@gmail.com> * Constantinople HF on POA Core (#10606) * Constantinople HF on POA Core Plan Constantinople/St.Petersfork HF on POA Core network at block 8582254. Original PR in POA repository: poanetwork/poa-chain-spec#110 * Remove extra empty line * evm: add some mulmod benches (#10600) * evm: add blockhash_mulmod bench * evm: use num-bigint for mod ops * Clique: zero-fill extradata when the supplied value is less than 32 bytes in length (#10605) * Update kovan.json to switch validator set to POA Consensus Contracts (#10628) * Fix publish docs (#10635) * Fix publish docs * this never should be forced, either way compiling previous versions will produce outdated docs * fix array, var was moved to the group project global variables list * Fix rinkeby petersburg fork (#10632)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-pleasereview 🤓
Pull request needs code review.
B0-patch-stable 🕷
Pull request should also be back-ported to the stable branch.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
timestamp_checked_add
as lib) #10383, subtraction instead of additiontime + ttl + work
instead ofwork factor
to calculate expiry (https://github.com/ethereum/wiki/wiki/Whisper-PoC-2-Protocol-Spec#inserting-authoring-messages)