-
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
How to query the genesis state root hash? #110
Comments
What's the use case of having the genesis state root hash?
That's not accurate no. There's absolutely no relationship between the genesis block and the head of the chain, except for the fact that the genesis hash (not the state root hash, the hash of the entire header) is sent over the peer-to-peer network when you connect to someone in order to make sure that they're on the same chain. |
My use case is to programatically convert a chain-spec with With smoldot, there are currently two ways -that I can think of- to retrieve this value:
The latter is clearly an implementation-based hack, and the former is not ideal if we're looking towards deprecating the legacy JSON-RPC API. Given that the new JSON-RPC API in smoldot doesn't allow access to the genesis header's properties, like the legacy one does, I wondered if there might be an oversight or something lacking in the new API. |
An appropriate way to query this would be a function in the However, I (soon) want to add a JSON-RPC function that lets you query an optimized version of the chain spec. The primary objective is that it would contain a checkpoint, but we can also make it so that the chain spec being returned is minimal. |
We would also want to fetch demo chain specs and optimize them to ensure smoldot could boot as soon as possible (ie changing genesis.raw to stateRootHash paritytech/subxt#1263). Having a similar method in the Looking at transforming I'm not sure at the moment if the |
To me the path forward is to retrieve "optimized" chain specs as a whole. This way, you also obtain the current checkpoint through the same mechanism, which also speeds up the warp syncing.
The genesis state root hash can be found in the genesis block header. |
I believe there are scenarios where users of the
chainHead
group of functions might benefit from querying the header of the genesis block or, at least, its state root hash. As per my understanding of the current specification, this doesn't seem possible.@tomaka, would it be accurate to say that if a "server" supports the
chainHead
suite of functions, it should inherently be capable of providing the genesis state root hash?The text was updated successfully, but these errors were encountered: