-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: increase tree leaf log2 size to 5 #68
Conversation
Hey @mpernambuco, let me know if I can help in any way! Current implementation has 64-bit words as the unit requested by step, and also the unit that we read from our access log. With the change in this PR, it seems there's a break: step requests words, but internally our memory model has larger blocks. My suggestion is that we make better distinctions between "words" (64-bit) and "blocks"/"leaves" (currently 256-bit), and that we extend the |
I don't understand the point you are trying to make. We are changing everything to consistently deal with 256-bit words and forget we ever dealt with 64-bit words. The machine emulator is changing, so the log will change, and the memory module will change, and the solidity step will change. |
09baaae
to
4f9ee32
Compare
It's not a point, it's a Solidity code structure suggestion and an offer for help. I didn't want to barge in. The current Solidity code is such that words are requested from step, words are read from the log, and words are the leafs of the Merkle tree. We're changing some of that. My suggestion is that there's a nicer way to structure this that makes the code clearer. As an example, there's a function called A change that perhaps is more important is understanding the meaning of This way, the function The way I'd do it is start by changing what |
Hey @GCdePaula, |
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.
This is looking great! I only have a few minor comments.
fb79fe8
to
5340fa7
Compare
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 there's an exploit. Let me know what you think.
I've opened #70 (a quick draft) of what I had in mind for reading. Let me know what you think. |
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.
LGTM! @GCdePaula is there anything else you'd like to add/change?
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.
🚀🚀🚀
This branch updates access logs handling and tests according to the emulator changes introduced in this PR:
cartesi/machine-emulator#259
In the emulator, the Merkle tree word size is increased from 8 to 32 bytes.
The access log format has changed as follows: