Skip to content

[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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

AndriiDiachuk
Copy link
Contributor

@AndriiDiachuk AndriiDiachuk commented May 20, 2025

closes: #7298 #7299 #7300

Context

In this PR were added constructor for Attestation, ResultApprovalBody and ResultApproval structs and removed non-constructor mutations for those structs.

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2025

Codecov Report

Attention: Patch coverage is 48.71795% with 20 lines in your changes missing coverage. Please review.

Project coverage is 41.13%. Comparing base (e41c00c) to head (ce3785d).

Files with missing lines Patch % Lines
model/flow/resultApproval.go 0.00% 18 Missing ⚠️
network/codec/codes.go 0.00% 2 Missing ⚠️
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     
Flag Coverage Δ
unittests 41.13% <48.71%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndriiDiachuk AndriiDiachuk marked this pull request as ready for review May 22, 2025 08:22
@AndriiDiachuk AndriiDiachuk requested a review from a team as a code owner May 22, 2025 08:22
@AndriiDiachuk AndriiDiachuk self-assigned this May 26, 2025
Copy link
Contributor

@tim-barry tim-barry left a 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:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Malleability Immutable] Enforce immutability for Attestation
3 participants