Skip to content

Commit

Permalink
Fix assumption that warp sync target isn't genesis (#258)
Browse files Browse the repository at this point in the history
* Fix assumption that warp sync target isn't genesis

* PR link

* Fix wrong check
  • Loading branch information
tomaka authored Mar 3, 2023
1 parent 897b6d6 commit ac3bd34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/src/sync/warp_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,11 +1303,16 @@ impl<TSrc, TRq> BuildRuntime<TSrc, TRq> {

let chain_info_builder = chain_information::build::ChainInformationBuild::new(
chain_information::build::Config {
finalized_block_header:
finalized_block_header: if header.number == 0 {
chain_information::build::ConfigFinalizedBlockHeader::Genesis {
state_trie_root_hash: header.state_root,
}
} else {
chain_information::build::ConfigFinalizedBlockHeader::NonGenesis {
header: header.clone(),
known_finality: Some(chain_information_finality.clone()),
},
}
},
runtime,
},
);
Expand Down
1 change: 1 addition & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Fixed

- Fix panic when connecting to a chain that hasn't finalized any block yet. ([#258](https://github.com/smol-dot/smoldot/pull/258))
- Fix the signatures of the `ext_default_child_storage_read_version_1` and `ext_default_child_storage_root_version_2` host functions. This would lead to a warning about these function being unresolved. ([#244](https://github.com/smol-dot/smoldot/pull/244))
- Fix panic when the input data of a Wasm function call is larger than a Wasm page. ([#218](https://github.com/smol-dot/smoldot/pull/218))
- Subscriptions to the `chain_subscribeAllHeads` JSON-RPC function now generate notifications named `chain_allHead`, like in Substrate. They were erroneously named `chain_newHead`. ([#227](https://github.com/smol-dot/smoldot/pull/227))
Expand Down

0 comments on commit ac3bd34

Please sign in to comment.