[ETCM-76] network messages for checkpointing#729
Conversation
fbd1980 to
b59b3af
Compare
70672f2 to
f0416e0
Compare
898f733 to
fb78ba5
Compare
fb78ba5 to
a2ad1a7
Compare
| // log.warn( | ||
| // s""" | ||
| // | | ||
| // | KAPIBARA |
| protocolVersion, | ||
| networkId, | ||
| totalDifficulty, | ||
| latestCheckpointNumber, |
There was a problem hiding this comment.
would it be better to have latestCheckpointNumber as the last field on list, as it's something which might not exist?
There was a problem hiding this comment.
Not sure, does it matter?
There was a problem hiding this comment.
not now, but IMHO as encoding to the RLP means encode to the list of things it should be easier to decode it having optional fields on the end than having them somewhere in the middle
There was a problem hiding this comment.
Well, it's not a case of optionality here. These are different messages with different codes, ie. once the code is determined a completely different structure may follow.
It's not a big deal the order doesn't really matter but these fields are closely related, in fact, after ETCM-263 they will correspond to a single type - ChainWeight, perhaps then it should even be encoded as a nested RLPList? 🤔
| assert(obtainEncoded2 == expectedEncoded2) | ||
| } | ||
|
|
||
| ignore("Tests for NewBlock64?? - or are the ones in MessagesSerializationSpec sufficient") {} |
There was a problem hiding this comment.
IMHO modifying newBlockGen to generate also code64 messages should be enough
ntallar
left a comment
There was a problem hiding this comment.
I have other things to analyse but I'll do that tomorrow and add further comments!
|
I don't like much that whether we send a 63 or 64 version message depends on our block number... on eth when they added eth64 capability (here for example) they made several changes (as far as I understood at least):
WDYT? The main drawback I see of the current approach is that you'd never be leaving away the old messages, with what I'm proposing eventually a good chunck of the network will have moved to etc64 and you can deprecate eth63 and even mark those peers as bad ones |
I like the idea, but it sounds like a big refactor. For one, where we currently construct the message we don't even who the recipient is. Separate task? Also do we need this separate notion of capability? Couldn't we just take advantage of |
Tbh I'm not sure what's the purpose of that protocolVersion... but from what I have seen, ETH/ETC updates of this sort are introduced as new capabilities, so we probably have no escape from that
Why would it be that big? For now I'm seeing the expected changes to be:
What would the benefit be of having this PR merged as is? |
Do you know of an example in ETC?
Well, at least medium. We'll also need to change how blocks are broadcast. Currently
It will unblock ETCM-263 |
a2ad1a7 to
34a5958
Compare
There were no changes like this to ETC post-ETH fork, there are some examples before that, as eth62 and so forth (but I haven't taken a look at them)
Couldn't we start building the message on BlockBroadcast? There we have the peer information (and I actually prefer it being built there, to decouple this network message from the syncing)
But I'm not sure about this 🤔 I don't see this PR as close to the ready version as it was the case with the syncing one, and you are doing both so there won't be much parallelization if merged... but yeah, if you think that there will be a lot of overlapping between this and that then we can leave that refactoring for a future task |
cde4e85 to
94985ec
Compare
@pslaski regarding ☝️ we discussed it with @rtkaczyk and decided to merge this PR as is and complete the protocol changes implementation both with: https://jira.iohk.io/browse/ETCM-280 and https://jira.iohk.io/browse/ETCM-263 |
94985ec to
024513c
Compare
024513c to
0423f35
Compare
0423f35 to
f0befc1
Compare
Description
Network messages including latest checkpoint number for best peer selection. Depends on #728