This repository was archived by the owner on Nov 6, 2020. It is now read-only.
fix(light cull): poll light cull instead of timer#10559
Merged
Conversation
niklasad1
commented
Apr 2, 2019
| pub fn light_cull(&self, txq: Arc<RwLock<TransactionQueue>>) -> impl Future <Item = (), Error = Error> + Send { | ||
| let senders = txq.read().queued_senders(); | ||
| if senders.is_empty() { | ||
| return Either::B(future::err(errors::no_light_transactions())); |
Collaborator
Author
There was a problem hiding this comment.
This is very unlikely to happen but it could happen if there is a race with calls to eth_getTransactionByHash i.e, a cull finished just between the transaction_by_hash and light_cull.
Then don't do a needless network request
Contributor
There was a problem hiding this comment.
I think you should leave this is a comment within the code, just in case
niklasad1
commented
Apr 2, 2019
| if in_txqueue { | ||
| // Note, this will block (relies on HTTP timeout) to make sure `cull` will finish to avoid having to call | ||
| // `eth_getTransactionByHash` more than once to ensure the `txqueue` is up to `date` when it is called | ||
| if let Err(e) = self.fetcher().light_cull(self.transaction_queue.clone()).wait() { |
Collaborator
Author
There was a problem hiding this comment.
This is probably the most controversial thing about this PR.
The light_cull could be spawned in an executor but then we would most likely not get result in this call (accessing an atomic variable is much faster than a network request) and we would have to call this at least one more time to get the result!
HCastano
reviewed
Apr 3, 2019
HCastano
reviewed
Apr 3, 2019
HCastano
reviewed
Apr 3, 2019
ordian
reviewed
Apr 3, 2019
d338c0a to
23d41cb
Compare
ordian
approved these changes
Apr 3, 2019
HCastano
approved these changes
Apr 4, 2019
ordian
added a commit
that referenced
this pull request
Apr 5, 2019
* master: fix(light cull): poll light cull instead of timer (#10559) Update Issue Template to direct security issue to email (#10562) RPC: Implements eth_subscribe("syncing") (#10311) Explicitly enable or disable Stratum in config file (Issue 9785) (#10521) version: bump master to 2.6 (#10560) tx-pool: check transaction readiness before replacing (#10526) fix(light account response): update `tx_queue` (#10545) Update light client harcoded headers (#10547) fix(light eth_gasPrice): ask network if not in cache (#10535) Implement caching for service transactions checker (#10088) build android with cache, win fixes (#10546) clique: make state backfill time measurement more accurate (#10551) updated lru-cache to 0.1.2 (#10542)
soc1c
pushed a commit
that referenced
this pull request
Apr 8, 2019
* fix(light cull): poll light cull instead of timer * fix(grumbles): remove error + updated docs * fix(on-demand request): `expect()` reason * docs(remove misleading info)
soc1c
added a commit
that referenced
this pull request
Apr 8, 2019
* Reject crazy timestamps instead of truncating. * fix(light cull): poll light cull instead of timer (#10559) * fix(light cull): poll light cull instead of timer * fix(grumbles): remove error + updated docs * fix(on-demand request): `expect()` reason * docs(remove misleading info)
cdetrio
pushed a commit
to cdetrio/parity
that referenced
this pull request
Apr 12, 2019
* Reject crazy timestamps instead of truncating. * fix(light cull): poll light cull instead of timer (openethereum#10559) * fix(light cull): poll light cull instead of timer * fix(grumbles): remove error + updated docs * fix(on-demand request): `expect()` reason * docs(remove misleading info) running code return data is working
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
cull pollingon every call oneth_getTransactiobByHashrequestcull servicewhich used a hardcoded timer every 10th minute