-
Notifications
You must be signed in to change notification settings - Fork 57
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: merge account updates details #797
Conversation
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.
Thank you! Looks good. I left some comments inline. Also, I think we need to finish implementing merging of StorageMapDelta
structs.
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.
Not a full review - but I did leave a few more comments/questions inline.
621026b
to
54fbfbc
Compare
I believe I've addressed all review comments. I've added tests - though note that I used |
This enables creating mappings for related types. Some types required manual impls as Felt does not implement Hash. This feels like an oversight.
The latter is not nostd compliant.
Address review comments
dbd4a58
to
64cb18c
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.
Looks good! Thank you! I left just a couple of minor comments inline. Once these are addressed, we can merge.
This PR adds
AccountUpdateDetails::merge
which combines two update details. This is required by the node to support merging multiple transactions on the same account.I implemented the merging using hashmaps to ensure only the final update is applied. This requiredUseHash
on several structs, and unfortunatelyFelt
does not implementHash
itself so this required manually implementing it in some cases.BTreeMap
instead which doesn't requireHash
and isnostd
compliant.The structs themselves actually look like they should contain hashmaps instead of vectors as this would be more type safe imo. However, since they aren't this makes me question my approach. I'll ask more specific questions inline so that the conversation is easier to track.
I also have sometodo!()
which I don't know how to implement.As a side-note we could also use something like
Slot
type, similar toNonZeroU8
but which disallows the "illegal" slots.