-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add StateRoot message #2079
Add StateRoot message #2079
Conversation
this.DeserializeUnsigned(reader); | ||
Witness[] arr = reader.ReadSerializableArray<Witness>(); | ||
if (arr.Length < 1) | ||
Witness = null; |
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.
Does we need states without witness?
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.
Yes. The state root calculated locally has no witness.
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.
Maybe we should have two payloads, signed and unsigned, in order to prevent send of unsigned state roots.
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 add witness null check. But how can extra payload prevent sending unsigned roots?
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 will send and receive only signed roots, the unsigned payload will be used locally, without p2p message.
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 want to store StateRoot
with null
witness first. After validated StateRoot
received, I can replace the null
witness with signed witness.
We will have the message in the core and the logic in modules? |
I have thought of put all into plugin. But in that case message will only relay between node with specific plugin. It will not work, nodes with specific plugin are minority. |
As #2101 , this pr need to be moved to neo-modules. |
Will move to plugin. |
Add
StateRoot
message support in core.StateRoot
when there is noMPTPlugin
.