-
Notifications
You must be signed in to change notification settings - Fork 74
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
Revisit story around unknown digest log items #2481
Conversation
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.
Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.
Ok I'm a bit stupid. I've just realized that this breaks everything, since Beefy/Polkadot parachains are now considered as unknown consensus engines and thus blocks validation will fail. I think that failing all block verifications on unknown consensus engine is overly restrictive. |
twiggy diff reportDifference in .wasm size before and after this pull request.
|
Fixed my previous comment by adding an |
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.
Awesome! |
Fix #2475
While Substrate supports Aura and Babe, other teams are free to extend Substrate to support other consensus algorithms (such as Nimbus). This PR revisits our strategy regarding these other consensus algorithms.
Before this PR, block headers that contain items that aren't supported by smoldot would simply fail to parse, with some whitelisted exceptions such as Polkadot parachains, Beefy, and Frontier. These exceptions were added for consensus algorithms that don't have any influence on whether a block is valid or not.
After this PR, we now successfully parse block headers even if they contain unrecognized consensus engines. However, the blocks verification code will fail if it is asked to verify a block header with an unrecognized consensus engine.
In order to understand this change, one must note that the parachain code of smoldot doesn't actually verify blocks. It simply follows the blocks that the relay chain considers as the best block for that parachain. If the relay chain says a block is valid, then the parachain code will consider that block as valid as well. It never actually verifies them itself.
This means that the change in this PR now enables parachains with unrecognized consensus engines.
Relay/standalone chains with unrecognized consensus engines, however, still aren't supported. After this PR, they will simply fail to verify blocks rather than fail to parse blocks.
A slightly related change that I've sneaked in this PR is how we handle chains that don't use any consensus engine.
Before this PR, chains that don't use any consensus engine are marked as
AllAuthorized
and will have see all incoming headers accepted. This can potentially lead to a DoS vector, as anyone can just create millions of fake blocks that are all considered as valid.After this PR, chains that don't use any consensus engine are marked as
Unknown
and will now fail all block verifications. Again, this doesn't have any influence on parachains as the parachains code doesn't verify blocks anyway.