Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Allow Poll Lifetime to be configured via CLI #8885

Merged

Conversation

gnunicorn
Copy link
Contributor

@gnunicorn gnunicorn commented Jun 13, 2018

... rather than it being a hard-coded constant. fixes #5484 .

However, in order to allow this to be configurable, we have to pass through the from the CLI through a range of structs, for which this is unrelated until it finally reaches the internally used PollManager. To achieve this I had to modify, among others, EthClient and EthClientOptions both of which are public structs exposed by parity-rpc. Thus means, these are technically backwards incompatible API-changes, which - under SemVer - would mean we have to bump the Major version of this crate...? Not sure if we want to do that.

Secondly, I am not super certain I traced the entire flow everywhere and there isn't still a ::Default() somewhere that creates poll-lifetimes other than what the CLI specifies. Happy for any more experienced reviewer to point them out if I missed any!

@parity-cla-bot
Copy link

It looks like @gnunicorn signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@5chdn 5chdn added A0-pleasereview 🤓 Pull request needs code review. M6-rpcapi 📣 RPC API. labels Jun 13, 2018
@5chdn 5chdn added this to the 1.12 milestone Jun 13, 2018
@@ -728,6 +728,10 @@ usage! {
"--gas-price-percentile=[PCT]",
"Set PCT percentile gas price value from last 100 blocks as default gas price when sending transactions.",

ARG arg_poll_lifetime: (u32) = 60u32, or |c: &Config| c.mining.as_ref()?.poll_lifetime.clone(),
"--poll-lifetime=[S]",
"Set the lifetime of the internal index filter to S seconds. Deafult: 60",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't review; just a nitpick: you don't need to specify the default value in the help message; it's automatically appended.

@debris debris added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 14, 2018
@debris
Copy link
Collaborator

debris commented Jun 14, 2018

... would mean we have to bump the Major version of this crate...? Not sure if we want to do that.

Great question! As of today, we don't care about versions of crate in this repo. Usually they are set to 0.1.0 or they reflect latest parity version. Although it may change in future if we modularize everything better

@gnunicorn gnunicorn force-pushed the fix-5484-configure-poll-lifetime branch from ef4e79e to 5f02a23 Compare June 14, 2018 11:26
... rather than it being a hard-coded constant. fixes openethereum#5484 .
@gnunicorn gnunicorn force-pushed the fix-5484-configure-poll-lifetime branch from 5f02a23 to e8ce616 Compare June 14, 2018 16:49
@gnunicorn
Copy link
Contributor Author

@debris I guess that is okay-ish... or do we know of any other people using this/our internal crates and thus, we'd break their build (as cargo follow semver?)... I mean, there is little downside for us to bump if, especially if it effects many people ...

also. the latest tests failures weren't mine but because of an old master. gitlab passed now.

@debris
Copy link
Collaborator

debris commented Jun 15, 2018

@debris I guess that is okay-ish... or do we know of any other people using this/our internal crates and thus

I don't think these crates are used directly by anyone. Usually people use parity over rpc

@gnunicorn
Copy link
Contributor Author

gnunicorn commented Jun 18, 2018

@5chdn it doesn't grumble anymore. mind re-add the review-tag?

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. labels Jun 18, 2018
@5chdn
Copy link
Contributor

5chdn commented Jun 18, 2018

PR is already reviewed well. It just needs someone else to sign off.

Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but "Set the lifetime of the internal index filter to S seconds." is going to trigger end-user questions imo so let's add a add-docs-issue when we merge this?

@debris debris merged commit 609d83f into openethereum:master Jun 18, 2018
@Tbaut
Copy link
Contributor

Tbaut commented Jun 18, 2018

LGTM, but "Set the lifetime of the internal index filter to S seconds." is going to trigger end-user questions imo so let's add a add-docs-issue when we merge this?

+1, this is not clear to me what this means: #8917

dvdplm added a commit that referenced this pull request Jun 20, 2018
* master:
  ethstore: retry deduplication of wallet file names until success (#8910)
  Update ropsten.json (#8926)
  Include node identity in the P2P advertised client version. (#8830)
  Allow disabling local-by-default for transactions with new config entry (#8882)
  Allow Poll Lifetime to be configured via CLI (#8885)
ordian added a commit to ordian/parity that referenced this pull request Jun 20, 2018
…rp_sync_on_light_client

* 'master' of https://github.com/paritytech/parity:
  Include node identity in the P2P advertised client version. (openethereum#8830)
  Allow disabling local-by-default for transactions with new config entry (openethereum#8882)
  Allow Poll Lifetime to be configured via CLI (openethereum#8885)
  cleanup nibbleslice (openethereum#8915)
  Hardware-wallets `Clean up things I missed in the latest PR` (openethereum#8890)
  Remove debian/.deb and centos/.rpm packaging scripts (openethereum#8887)
  Remove a weird emoji in new_social docs (openethereum#8913)
  Minor fix in chain supplier and light provider (openethereum#8906)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make filter poll lifetime configurable
7 participants