Skip to content
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

refactor: Make SignedBlock immutable #4620

Merged
merged 1 commit into from
May 21, 2024

Conversation

dima74
Copy link
Contributor

@dima74 dima74 commented May 20, 2024

Description

As I understand, the problem is that payload of SignedBlock can be modified, which will result in invalid SignedBlock (inconsistent payload and signatures). Currently payload is modified only in tests. I made payload private and changed such tests to create new block instead of modifying existing one.

Linked issue

Closes #4224

Benefits

Checklist

  • I've read CONTRIBUTING.md
  • I've used the standard signed-off commit format (or will squash just before merging)
  • All applicable CI checks pass (or I promised to make them pass later)
  • (optional) I've written unit tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

data_model/src/block.rs Outdated Show resolved Hide resolved
@dima74 dima74 force-pushed the diralik/immutable-signed-block branch from 43c0ed3 to 3d11289 Compare May 20, 2024 10:16
Erigara
Erigara previously approved these changes May 20, 2024
mversic
mversic previously approved these changes May 20, 2024
@mversic mversic force-pushed the diralik/immutable-signed-block branch from 3d11289 to 2920cd4 Compare May 20, 2024 13:33
@mversic
Copy link
Contributor

mversic commented May 20, 2024

your commit is not signed

@dima74 dima74 dismissed stale reviews from mversic and Erigara via 08b509e May 20, 2024 13:46
@dima74 dima74 force-pushed the diralik/immutable-signed-block branch from 2920cd4 to 08b509e Compare May 20, 2024 13:46
@dima74
Copy link
Contributor Author

dima74 commented May 20, 2024

your commit is not signed

Fixed

@mversic mversic requested a review from Erigara May 20, 2024 13:53
Signed-off-by: Dmitry Murzin <diralik@yandex.ru>
@mversic mversic force-pushed the diralik/immutable-signed-block branch from 08b509e to ce186cc Compare May 21, 2024 07:03
@mversic mversic merged commit 0bc23c7 into hyperledger:main May 21, 2024
12 of 13 checks passed
@dima74 dima74 deleted the diralik/immutable-signed-block branch May 21, 2024 08:02
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.

SignedBlock is immutable
4 participants