Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CandidateDescriptor: disable collator signature and collator id usage #4665
CandidateDescriptor: disable collator signature and collator id usage #4665
Changes from all commits
3ba4d96
3f529d2
4fe3a35
5a71f42
3d3d850
b35ab11
d507439
056bb8f
bb5f7d0
e911c44
644b235
eab5ce9
f1dde99
78fee3b
927ad33
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Correlated with this this:
polkadot-sdk/polkadot/node/core/candidate-validation/src/lib.rs
Line 1218 in ac98bc3
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.
With this change, the runtime will no longer care about what is being put in collator signature.
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.
Right, but wouldn't that mean that the block author will accept blocks with invalid signature, that will then fail the
candidate-validation
because we are still checking the signature there ?Anyways, I thought a bit more about this and it is a
non-issue
because, that will just trigger a dispute which will punish the malicious backers, so this change does not introduce any attack-vector.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.
This is actually a good point. It is a bit subtle but yes, validators strictly need to still check the signatures even if the runtime doesn't. The problem I see with this is that malicious collators can put garbage in the signature, candidates get backed by validators upgraded to not check the signature in the future. During approval checking, these candidates will be disputed by older validators that check the signature.
Then who gets punished depends on which kind of super majority we have. This sounds like a new attack vector to me.
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.
We'll likely need another node feature 🤦🏼 just to give people more time to upgrade, but at least 2/3, then we need to communicate the deadline when it becomes dangerous (due to prev comment) to not have upgraded yet.
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.
One way to solve this is to still keep the signature checks only for node but only check them if we don't have a core index (signaled by Ump commitment and zero padding in descriptor).
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 had a similar idea, but I don't see how this fixes anything. You still have the problem of different validators arriving at different validity.
The node feature is actually the way to go. We still need to wait for enough validators to upgrade, but then we have perfect consensus on what strategy to use in an instant. Any too old validators might get slashed, but we actually have requirements on validators to keep their node current, so that is fine.
So basic plan is to implement everything at once:
Collators will not be affected. Collators can still provide a signature, it will simply be ignored. If they set it to 0, we re-interpret fields.
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.
Agreed. I'll add the node feature in this PR. It will signal the nodes to not check the signature if there is a core_index.
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.
Once the feature is enabled no signature needs to be checked at all anymore. But we should also directly start re-interpreting fields in case the signature is 0. Otherwise we would need two node features: One to disable checking and then another one to check the core index.