polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.75k stars 1.54k forks source link

Parachains page showing wrong block times? #10182

Open mrcnski opened 8 months ago

mrcnski commented 8 months ago

As far as I can tell, it seems that the "Parachains" page is erroneously tracking the relay chain.

I was testing a chain (asset-hub-rococo) that has 12s block times on a a relay chain (rococo) with 6s block times.

I confirmed with logs and the Collator dashboard that block times are 12s, but in the screenshot below it shows 6s:

Screenshot 2024-01-08 at 19 41 47

I also confirmed with a stopwatch that the block number is updated every 6s -- but I believe this is not the parachain block number.

Fixing a bug.

Screenshot 2024-01-15 at 14 49 45

mrcnski commented 8 months ago

Zombienet command (run in polkadot-sdk/polkadot/):

zombienet --provider=native spawn zombienet_tests/smoke/0001-parachains-smoke-test.toml

with the following local edits to that file:

[settings]
timeout = 1000

[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
chain = "rococo-local"
command = "polkadot"

  [[relaychain.nodes]]
  name = "alice"
  args = [ "--alice", "-lruntime=debug,parachain=trace" ]

  [[relaychain.nodes]]
  name = "bob"
  args = [ "--bob", "-lruntime=debug,parachain=trace" ]

[[parachains]]
id = 100
chain = "asset-hub-rococo-local"

[parachains.collator]
name = "asset-hub-collator"
image = "{{COL_IMAGE}}"
command = "polkadot-parachain"
args = [ "-lruntime=debug,parachain=trace" ]

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
JelliedOwl commented 7 months ago

I'm pretty sure it's showing the time (in terms of relay chain blocks) since the parachain was last included - so nothing when the last included block number is the same as the relay chain block, 6s when it is one relay chain block ago, 12s when two ago, etc.

That seems right to me?