-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove chainHead_unstable_genesisHash
#61
Conversation
Probably a silly question, but what is the point of having both |
The point is that the JSON-RPC client doesn't know which API is available. Nodes might have |
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.
Sounds fair to me!
Side question: can we not keep eg chainHead_genesisHash
unstable even if we stabilise the rest of the interface?
More generally, if we would stabilise the individual calls that we were happy about on a case by case basis, then the path to complete stabilisation may be quicker, and it would allow us to "experiment" with unstable methods that we weren't sure about in the meantime (or add unstable methods later etc that may or may not be stabilised).
Well, the design is that the JSON-RPC client calls This avoids the client having to check whether every single function it needs are supported, which is both tedious and error prone. Instead, a client developer just needs to keep track of which namespaces it needs. Therefore if we stabilize a function later, we would also bump everything to |
Ok, thanks for the clarification, that makes sense! So if we want to add new methods, they can take this sort of path I guess?:
|
Yes! I'm making the bet that this shouldn't happen too often, because missing a function indicates either a big fuck up (which normally shouldn't happen) or that some design aspect of Substrate/Polkadot has changed (which shouldn't happen very often). |
Thanks, that makes sense! @josepot FYI I'm happy for this to merge when you are! (also FYI, the |
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.
Thanks!
Sorry, I thought that I had already approve this 😬 |
Since the objective is to stabilize the
chainHead
namespace in the nearby future, this pull request proposes to remove thechainHead_unstable_genesisHash
JSON-RPC function out of caution.The reason is that a client that simply follows the head of the chain might not necessarily be aware of what the genesis hash is. See polkadot-fellows/RFCs#8 for an example.
The genesis hash can be found in the chain at
System::BlockHash[0]
, but since this is a runtime-specific thing it should be implemented by the JSON-RPC client on top ofchainHead_storage
, rather than by the server.Note that
archive_genesisHash
andchainSpec_genesisHash
still exist, as a node that implementsarchive
is clearly supposed to know what the genesis hash is, and that a node that implementschainSpec
can read the genesis hash from its chain spec.