les, core: introduce les4#20227
Conversation
zsfelfoldi
left a comment
There was a problem hiding this comment.
Most of it looks fine, see comments.
There was a problem hiding this comment.
This looks a bit weird. Maybe it is justified but I don't yet understand the reasoning behind this change. What difference does it make for the server if the client has selected it as trusted? If this is a problem for security reasons (I'm not sure if it is indeed) then we can also just always request signed headers, it is not a big overhead. I'm still sceptical though because trusted servers are operated by well-known entities and their operators know anyways that their server is usually trusted by clients. Especially if it is an "announce only" server which cannot be used for anything else.
There was a problem hiding this comment.
The reason for the change is for security. Since now the server "can know" that he is selected as a trusted server since we won't request signed header for "untrusted" server right now. For the security perspective, it's may not a good thing.
So the change will select a few random "untrusted" server for signed header too. So it's hard to judge whether they are selected.
But you are right, maybe (1) we can choose to request signed header always (2) If the trusted server is basically based on the off-chain reputation so that it's totally another thing.
But I think we definitely can find some random server as the trusted instead of following "well-known" nodes. Is it safer?
les, core: introduce forkid for les4 les: update peer unit test les: check peer version in handler les: fix linter les: address comments
|
This PR should be introduced in the same release as #20517 |
|
It's replaced by #21974. Close it now |
This PR introduces forkID into les protocol.
A few notable changes are listed:
can easily know I am chosen as trusted server.
Regarding the version bumping, we actually can add a new handshake field into the current version.
If forkID is available, then check it. Otherwise only genesis hash is checked. The reason I choose to bump the version is: in the les4 we can forcibly check the forkID.