-
Notifications
You must be signed in to change notification settings - Fork 808
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
Silent dynamic changes in metadata constants #934
Comments
This code should be static per compilation. How did the values change? |
This will solve the gilt problem. |
I would actually like to have test for this, that ensures that the metadata isn't changing. However, this would be required to be some longer running test. So, we should probably start to have some sort of "pre-release" tests. @s3krit @chevdor any any how we can create these kind of pre-release tests? I just need a way it will be executed, writing a test for this should not be that hard. Maybe some custom gh action that we manually run before creating a release? |
Old hex-encoded metadata for Polkadot I had on September 15: Today: |
The links to pastebin are not working. And do you have a non-hex encoded one? |
Sorry for links. Try this, decoded. They diverge at symbol 178352 https://gist.github.com/Slesarew/0689113c83f9da248e454d316f0e0d43 |
@Slesarew do you have the blocks you fetched this metadata from? |
No, but one is from today and another is from September 15 (and it did not change like that until today, I'm checking almost daily) |
Are you checking against a public rpc node? |
Yes, the one at wss://rpc.polkadot.io |
Between |
I did a test and I do not reproduce the issue when fetching the metadata directly from the chain: code:
result:
As a reference, if we test another chain with
|
Also checked using different endpoints:
The results remain consistent:
|
I also get the same for the block hash mentione by @bkchr:
|
This is indeed interesting! I keep Signer metadata database that is updated as I work on it using, among others, these operations: So I get old versions saved and, mostly, kept in github (at least until things get stable enough to transfer db to some safe place and gitignore it here). It was never my intention to monitor changes in metadata, I've noticed this just because of cheap "good practices" checks shown above, so don't expect those archives to be exahustive or comfortable to use. Anyway, all this hints to me that it's some subtle change in metadata generation, not the chain itself.
@chevdor this test is supposed to reproduce more prominen kusama error that was already addressed. The subtle polkadot change could not be reproduced on purpose, we have only logs do tackle it. |
Metadata silently changed in polkadot between the beginning of this week and now (most probably around today). Affected variable is:
Gist (filenames self-descriptive): https://gist.github.com/Slesarew/24cab4e28a4589a573a5732bb7deeebc As a side-effect, now the demo "polkadot9110 upgrade" Signer QR message that Martin might nave generated a week ago will result in non-matching metadata hash and show as error. Thus this is a blocker for public Signer release. Meanwhile, Kusama still changes every block, the fix didn't get in release yet, right? |
This should come this evening. |
@Slesarew I please need the exact block hashes to check this. |
I'm sorry, I'm not storing these (yet?), I was just updating a database that was designed with assumption that metadata hash corresponds to spec_name+spec_version so I'm not storing blocks. All I know is that metadata output changed at these times and did not change (at least often) before, as I occasionally do this fetch for testing my code. Unfortunately, I haven't even generated any transactions with the "old" version of metadata, so I have no idea which blocks correspond to that "old" state. On previous encounter of this silent change, you've already determined that fetching metadata does not reproduce the error - old blocks return "new" metadata. It should be in metadata generation - either the algorithm changed, or it queries some non-constant values somewhere. Really, I can't realistically think of any way to reproduce this error, unless there are snapshots of network state and runtime artefact from a week ago. |
Ahh wait! I got some idea! |
Closing in favor of: #1139 |
Metadata in kusama changes once every block; similar "silent" change was observed in polkadot once today (2021-10-05). There is no associated spec_version bump, thus we end up with different metadata with colliding IDs.
How to reproduce:
This is caused by this line:
https://github.com/paritytech/polkadot/blob/d26815243a2af9547568f13eadd226de3df07479/runtime/kusama/src/lib.rs#L1386
Metadata generation should not be accessing storage!
Another variable that silently changed today was
batched_calls_limit: u32
in palletutility
in both kusama 9090 and polkadot 9090, there is obviously no way to reproduce this now.This blocks Signer's development as it diverges from assumptions used for designing security logic.
The text was updated successfully, but these errors were encountered: