-
Notifications
You must be signed in to change notification settings - Fork 183
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
[Malleability] Event #7068
base: yurii/malleability-check-test
Are you sure you want to change the base?
[Malleability] Event #7068
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.
Looks good but I think we can simplify the implementation more by removing the Fingerprint
.
model/flow/event.go
Outdated
TxID: e.TransactionID[:], | ||
Index: e.EventIndex, | ||
} | ||
return fingerprint.Fingerprint(struct { |
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 believe it's redundant, we don't need to implement the Fingerprint
for this type, it essentially has the same fields as the original type. I would propose to get rid of it and in place where we need to fingerprint we use: fingerprint.Fingerprint(event)
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.
@durkmurder, thank you for this note.The Fingerprint
method defines a specific field order that differs from the Event
struct, so we can't easily remove it.
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.
There was a discussion about this, and the conclusion is that we can change the field order for generating the RLP
-encoded representation of the Event
type. This simplifies the code and improves readability. However, this change will affect the Rosetta
side. Since all these changes will be introduced in a new spork, we can do this, but we must also update the field order on the Rosetta
side. Changing this order in Rosetta is crucial.
Based on @durkmurder ’s comment, I removed the Fingerprint
implementation for the Event
type and updated the tests accordingly (see commit).
@franklywatson , I want to bring this to your attention — we will need to create an issue in flow/rosetta to track this update. I’ve also described the previous and current field order for Event
in the issue for this task (#6651).
@jordanschalm can we get your review? |
Co-authored-by: Jordan Schalm <[email protected]>
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.
⭐
Close: #6651
Context
This pull request addresses an issue related to the malleability of the
ID()
method inEvent
.MakeID
. These changes have no impact on tests.eventWrapper
because it is essentially equivalent toEvent
.eventIDWrapper
because it is unused after these changes.Encode
method.getEvents
test helper function.Event
is not malleable (replacing the existing test, which only partially verified non-malleability).