Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor chain information building process (#2845)
Close #1681 Right now the code of `warp_sync` and `chain_spec` both build a `ChainInformation` struct by making runtime calls. However the code of these two modules is completely different. Because these two modules were built very early on in smoldot's history, they are getting help from the sub-modules of the `chain_information` module, that are also very old. This PR modernizes all of this: it removes all the sub-modules under `chain_information` and merges them into one that does everything. This new module is now used by `warp_sync` and `chain_spec`, and `warp_sync` and `chain_spec` are now more simple. I'm also planning to use this new module in order to refactor the SQLite database. (#1752) This PR slightly changes the behavior of the warp syncing: we now download the runtime, then build it, and then only download the call proofs to obtain the chain information. Right now all the downloads are done in parallel. This change is in principle more correct. At the moment we blindly call functions that we expect to exist. By downloading and building the runtime first, we can check the list of supported functions and then only call them. (cc #949) This is really not a problem at the moment because none of the functions that we use has ever been deprecated, but it could have become one in the future.
- Loading branch information