-
Notifications
You must be signed in to change notification settings - Fork 146
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
♻️ 🧹 Removed Stop
from GetBlockHashesMsg
#3942
♻️ 🧹 Removed Stop
from GetBlockHashesMsg
#3942
Conversation
Stop
from GetBlockHashesMsg
; refactor overall encoding for GetBlockHashesMsg
using Libplanet.Blockchain; | ||
using Libplanet.Types.Blocks; | ||
|
||
namespace Libplanet.Net.Messages | ||
{ | ||
internal class GetBlockHashesMsg : MessageContent | ||
{ | ||
public GetBlockHashesMsg(BlockLocator locator, BlockHash? stop) |
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.
Is it backward compatible?
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.
The backward compatibility has been broken since #3913, albeit on a different level. This further(?) breaks the compatibility since it has been already broken. 🙄
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.
The result is the same, that is, any node running with a different Libplanet version would not be able to sync to a node running the newest version.
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.
So is there any way to test a new version of Libplanet on a network where the live version is running?
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.
It is possible to apply only the business logic and force partial compatibility as I have with #3913, but I don't think that is necessary (or worth the time). If you are still worried, we can further divide this PR into multiple releases where
- We keep partial compatibility.
- Message level compatibility is left intact.
- Ignore
BlockLocator
s with multipleBlockHash
es and/or non-null
Stop
. - This results in a newer node being able to sync to an old node, but not the other way around.
- This only breaks the business logic layer.
- We break compatibility completely by cleaning up/updating the
GetBlockHashesMsg
encoding.- This would result in a newer node and an old node not being able to sync to each other.
- This breaks the network layer as well.
As the newer node is about getting rid of "unnecessary" block sync logic and dependencies, the compatibility has to be broken at some point.
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 don't think backward compatibility is necessary on this. But, at least, we need to test this feature on our dev cluster.
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.
Arg, might as well separate the encoding part into a separate PR for easier testing. 😕
Stop
from GetBlockHashesMsg
; refactor overall encoding for GetBlockHashesMsg
Stop
from GetBlockHashesMsg
~~refactor overall encoding for GetBlockHashesMsg
~~
Stop
from GetBlockHashesMsg
~~refactor overall encoding for GetBlockHashesMsg
~~Stop
from GetBlockHashesMsg
@riemannulus @limebell |
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.
Overall logic looks good to me, are you plan to change MessageType
in other PR?
If we leave as it is without changing the encoding/decoding process, this should be compatible with the old
I will update it when we change the encoding. |
Stop
fromGetBlockHashesMsg
. I suspect this was implemented to imitate the Bitcoin's implementation. I don't really see a rationale for this to exist.BlockLocator
andGetBlockHashesMsg
accordingly.Addendum
GetBlockHashesMsg
encoding to be backward compatible as a network protocol.