flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[Malleability Immutable] Enforce immutability for Block (cluster)

Open UlyanaAndrukhiv opened this issue 5 months ago • 1 comments

Please do not review this PR. It is in progress.

Closes: #7277

Changes

  • Added UntrustedBlock model.
  • Added cluster.Block validations for constructor.
  • Added unit tests for constructor.
  • Updated constructor for cluster.Payload to use Untrusted model to be consistent with other constructors.
  • Added unit tests for cluster.Payload constructor.
  • Removed unused SyncedBlock and SyncedClusterBlock types.
  • Removed unused UntrustedBlock type from model/messages/consensus.go.

UlyanaAndrukhiv avatar Jun 27 '25 14:06 UlyanaAndrukhiv

Codecov Report

Attention: Patch coverage is 44.54545% with 122 lines in your changes missing coverage. Please review.

Project coverage is 41.34%. Comparing base (fbd8690) to head (f29a207).

Files with missing lines Patch % Lines
utils/unittest/cluster_block.go 0.00% 46 Missing :warning:
module/buffer/pending_cluster_blocks.go 0.00% 26 Missing :warning:
utils/unittest/fixtures.go 0.00% 11 Missing :warning:
module/builder/collection/builder.go 66.66% 5 Missing and 2 partials :warning:
storage/badger/procedure/cluster.go 66.66% 5 Missing and 2 partials :warning:
model/messages/collection.go 60.00% 4 Missing and 2 partials :warning:
model/cluster/block.go 85.18% 4 Missing :warning:
engine/collection/compliance/core.go 50.00% 2 Missing and 1 partial :warning:
engine/collection/message_hub/message_hub.go 70.00% 2 Missing and 1 partial :warning:
model/messages/synchronization.go 57.14% 2 Missing and 1 partial :warning:
... and 2 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/malleability    #7553      +/-   ##
========================================================
+ Coverage                 40.30%   41.34%   +1.04%     
========================================================
  Files                      2121     2187      +66     
  Lines                    186907   193795    +6888     
========================================================
+ Hits                      75325    80123    +4798     
- Misses                   105272   106988    +1716     
- Partials                   6310     6684     +374     
Flag Coverage Δ
unittests 41.34% <44.54%> (+1.04%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar Jun 27 '25 14:06 codecov-commenter