-
Notifications
You must be signed in to change notification settings - Fork 100
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
Merkle Patricia Tries (2x) #97
Conversation
Very good Rodolfo! Let's advance with this plugin. The target is still neo-project:master, could you change it for neo-project:master-2.x ? |
Great job, @rodoufu. |
Is this the same as neo-project/neo#528? |
Right now it's the same Erik, but it will change... this one here will be more experimental, so that we validate it and then port it to neo project. |
@igormcoelho , it looks like there's no mater-2x branch on the neo-plugins project: Only on the core neo project: Am I missing something? |
Now I have changed the target. |
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 on master-2.x
, this feature will be for neo 3
I think this plugin is for 2.x, because 2.x has no built-in MPT. |
public byte[] Key | ||
{ | ||
get => _hashes[_hashes.Length - 2]; | ||
set => _hashes[_hashes.Length - 2] = value; |
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.
Throw an exception on empty tree
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 think node types are verified before usage.. IsNull for example, has no Key.
public override void Serialize(BinaryWriter writer) | ||
{ | ||
base.Serialize(writer); | ||
writer.Write((byte) _hashes.Length); |
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 not possible to be bigger than 256?
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's possible, just an effect of using SHA256. In fact, we should use Hash256, to avoid length attacks.
@shargon , I think the idea is to have the MPT on Neo version 3.0 but start it as a plugin in the version 2.x so we can use it and improve before going to the Neo 3.0 |
@shargon
@rodoufu |
@rodoufu, this has been a great effort. Thanks for all your motivation, studies and prototype on this. However, I would like to state my real appreciation for the work you conducted. |
An experimental plugin for persisting neo blockchain states into Merkle Patricia Tries.