-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Log UnknownBlock errors from runtime
#6288
Conversation
UnknownBlock error during runtime calls gracefullyUnknownBlock error from runtime calls gracefully
b47211f to
0caf316
Compare
0caf316 to
7b092d7
Compare
8e3a664 to
838c089
Compare
|
The CI pipeline was cancelled due to failure one of the required jobs. |
UnknownBlock error from runtime calls gracefullyUnknownBlock errors from runtime
|
What is the rationale for using
How is it possible to do that in general case? Wouldn't you have a TOCTOU problem? |
ordian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood the point of the issue was to make the error more explicit and not silence it. However, I am still not sure what would the point of warning the user about this if this error is expected to happen as we already observe in the logs.
BradleyOlson64
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks clean!
|
These logs doesn't contribute much to the understandably of the logs. I'm closing the PR. |
This PR is building upon paritytech/substrate#12707 and is related to paritytech/polkadot-sdk#793
The problem
All runtime calls first check the runtime version before issuing the actual runtime api call. If a call is made for a block which is pruned (e.g. because a better fork was finalized), the runtime api version can't be checked and
NotSupportederror is returned. This is misleading because the problem is different. The call IS supported but it can't be executed at a pruned block.How this is solved
This PR adds explicit logging for
UnknownBlockruntime errors so that it is clear why the runtime call is failing. FurthermoreUnknownBlockvariant is added toRuntimeApiErrorenum innode/subsystem-types/src/errors.rs. This allows any subsystem to handle such errors in its own way.What this PR doesn't do
The PR doesn't fix the root cause (prevent executing logic on pruned blocks).
Sample logs
E.g. for
{node=~"versi-validator-f.*"} |~ "UnknownBlock|discarded":