Implement runtime version checks in set_code (#4548)

* Implement runtime version checks in `set_code`

Check that the new runtime code given to `set_code` fullfills some
requirements:

- `spec_name` matches
- `spec_version` does not decreases
- `impl_version` does not decreases
- Either `spec_version` and `impl_version` increase

* Make tests almost work

* Some fixes after master merge

* Fix tests

* Add missed file

* Make depedency check happy?

* Remove leftover `sc-executor`

* AHHHHH

* Reset debug stuff

* Remove some 'static

* More 'static

* Some docs

* Update `Cargo.lock`
This commit is contained in:
Bastian Köcher
2020-01-16 13:58:37 +01:00
committed by Gavin Wood
parent 437772be9e
commit afc3318f21
38 changed files with 584 additions and 279 deletions
@@ -412,7 +412,7 @@ for Environment<B, E, Block, N, RA, SC, VR>
where
Block: 'static,
B: Backend<Block> + 'static,
E: CallExecutor<Block> + Send + Sync + 'static,
E: CallExecutor<Block> + Send + Sync,
N: NetworkT<Block> + 'static + Send,
SC: SelectChain<Block> + 'static,
VR: VotingRule<Block, Client<B, E, Block, RA>>,
+2 -2
View File
@@ -372,7 +372,7 @@ pub trait GenesisAuthoritySetProvider<Block: BlockT> {
impl<B, E, Block: BlockT, RA> GenesisAuthoritySetProvider<Block> for Client<B, E, Block, RA>
where
B: Backend<Block> + Send + Sync + 'static,
E: CallExecutor<Block> + 'static + Clone + Send + Sync,
E: CallExecutor<Block> + Send + Sync,
RA: Send + Sync,
{
fn get(&self) -> Result<AuthorityList, ClientError> {
@@ -408,7 +408,7 @@ pub fn block_import<B, E, Block: BlockT, RA, SC>(
), ClientError>
where
B: Backend<Block> + 'static,
E: CallExecutor<Block> + 'static + Clone + Send + Sync,
E: CallExecutor<Block> + Send + Sync,
RA: Send + Sync,
SC: SelectChain<Block>,
Client<B, E, Block, RA>: AuxStore,
@@ -67,7 +67,7 @@ fn grandpa_observer<B, E, Block: BlockT, RA, S, F>(
) -> impl Future<Item=(), Error=CommandOrError<Block::Hash, NumberFor<Block>>> where
NumberFor<Block>: BlockNumberOps,
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
E: CallExecutor<Block> + Send + Sync + 'static,
RA: Send + Sync,
S: Stream<
Item = CommunicationIn<Block>,