-
Notifications
You must be signed in to change notification settings - Fork 190
[Malleability Immutable] Removed non-constructor mutations for Attestation, ResultApprovalBody and ResultApproval structs #7417
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7417 +/- ##
==========================================
- Coverage 41.15% 41.13% -0.02%
==========================================
Files 2210 2210
Lines 193935 193953 +18
==========================================
- Hits 79808 79781 -27
- Misses 107520 107566 +46
+ Partials 6607 6606 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ltApproval-immutability
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.
One main comment related to data structures originating from the network, where I think the structure should be considered "finished construction" (for purposes of immutability and ID caching) after deserialization:
flow-go/network/codec/cbor/codec.go
Lines 102 to 109 in 0075514
msgInterface, what, err := codec.InterfaceFromMessageCode(msgCode) | |
if err != nil { | |
return nil, err | |
} | |
// unmarshal the payload | |
//bs2 := binstat.EnterTimeVal(fmt.Sprintf("%s%s%s:%d", binstat.BinNet, ":wire>4(cbor)", what, code), int64(len(data))) // e.g. ~3net:wire>4(cbor)CodeEntityRequest:23 | |
err = cborcodec.DefaultDecMode.Unmarshal(data[1:], msgInterface) // all but first byte |
…ltApproval-immutability
…ltApproval-immutability
closes: #7298 #7299 #7300
Context
In this PR were added constructor for
Attestation
,ResultApprovalBody
andResultApproval
structs and removed non-constructor mutations for those structs.