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

Loosened restrictions on parameters to newHead subscription#7732

Closed
tjade273 wants to merge 1 commit into
openethereum:masterfrom
tjade273:newhead_geth
Closed

Loosened restrictions on parameters to newHead subscription#7732
tjade273 wants to merge 1 commit into
openethereum:masterfrom
tjade273:newhead_geth

Conversation

@tjade273
Copy link
Copy Markdown

Addresses #7731

Currently the patch simply allows any parameter that is parseable as a log, then ignores it.

We could instead restrict it to only the empty log, but this is more general.

@parity-cla-bot
Copy link
Copy Markdown

It looks like @tjade273 hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, plesae reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

@tjade273
Copy link
Copy Markdown
Author

[clabot:check].

@parity-cla-bot
Copy link
Copy Markdown

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

Many thanks,

Parity Technologies CLA Bot

@5chdn 5chdn added A0-pleasereview 🤓 Pull request needs code review. P5-sometimesoon 🌲 Issue is worth doing soon. M6-rpcapi 📣 RPC API. labels Jan 30, 2018
@5chdn 5chdn added this to the 1.10 milestone Jan 30, 2018

let error = match (kind, params.into()) {
(pubsub::Kind::NewHeads, None) => {
(pubsub::Kind::NewHeads, _) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't like loosening it completely. I think the RPC and the spec should be as specific as possible, we'll run into plenty of issues if we allow leniency of parameters (like developers wondering why a parameter doesn't work if they make a typo or the parameter is not supported).

IMHO The spec just not got properly updated after newBlocks has been renamed to newHeads, includeTransactions paramteter in examples doesn't make much sense in case of headers-only subscription.

Having said that, I'm ok with allowing:
eth_subscribe('newHeads') and eth_subscribe('newHeads', {}) call (optional options argument that we might add in the future), but not eth_subscribe('newHeads', {'anything': true}).

@tjade273 what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Makes sense, I'll tweak it

@tomusdrw tomusdrw added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 30, 2018
@tomusdrw
Copy link
Copy Markdown
Collaborator

BTW: would be good to add tests for both behaviours.

@5chdn 5chdn removed the P5-sometimesoon 🌲 Issue is worth doing soon. label Jan 31, 2018
@5chdn
Copy link
Copy Markdown
Contributor

5chdn commented Feb 22, 2018

Let me know when you are ready, @tjade273 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. M6-rpcapi 📣 RPC API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants