Skip to content
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

Panic when connecting to chain with no finalized blocks #253

Closed
skunert opened this issue Mar 2, 2023 · 1 comment · Fixed by #258
Closed

Panic when connecting to chain with no finalized blocks #253

skunert opened this issue Mar 2, 2023 · 1 comment · Fixed by #258

Comments

@skunert
Copy link
Contributor

skunert commented Mar 2, 2023

I am trying to write tests that spin up various nodes in a testnet. One of these is a parachain collator with an embedded smoldot light-client instance. I saw some failures there due to this assumption in the code:

assert_ne!(header.number, 0);

If I understand correctly, the failure happens when smoldot joins the relay chain network, and no blocks have been finalized yet. My current hacky workaround is to wait a few seconds before initializing smoldot internally, but it would be nicer if smoldot could tolerate this scenario.

Error Message

thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left != right)`
  left: `0`,
 right: `0`', ~/.cargo/git/checkouts/smoldot-2dcbf637e11a77d4/54d8889/lib/src/chain/chain_information/build.rs:184:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: SendError { kind: Disconnected }', ~/.cargo/git/checkouts/smoldot-2dcbf637e11a77d4/54d8889/light-base/src/sync_service.rs:211:14
@tomaka
Copy link
Contributor

tomaka commented Mar 2, 2023

The warp sync code indeed doesn't really expect the chain to still be at block 0.

While this issue itself is relatively easy to fix (2/3 lines of code), I'm going to read/review the warp sync code and check if everything is correct if we're still at the genesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants