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

feat: calculate block hash #248

Merged
merged 1 commit into from
May 28, 2024
Merged

feat: calculate block hash #248

merged 1 commit into from
May 28, 2024

Conversation

yoavGrs
Copy link
Contributor

@yoavGrs yoavGrs commented May 9, 2024

This change is Reviewable

@yoavGrs yoavGrs requested a review from ShahakShama May 9, 2024 11:15
@yoavGrs yoavGrs self-assigned this May 9, 2024
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)


src/block_hash/block_hash_calculator.rs line 46 at r1 (raw file):

///     data_gas_price_wei, data_gas_price_fri, starknet_version, 0, parent_block_hash
/// ).
pub fn calculate_block_hash(block_hash_input: &BlockHashInput<'_, '_, '_, '_>) -> BlockHash {

Why not receive Block?

Copy link
Contributor Author

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama)


src/block_hash/block_hash_calculator.rs line 46 at r1 (raw file):

Previously, ShahakShama wrote…

Why not receive Block?

Because Block contains block_hash and optional commitments.
Should I define a new struct, BlockWithoutHash?

@yoavGrs yoavGrs force-pushed the yoav/block_hash_calculation branch from f1d217b to 4e88432 Compare May 15, 2024 19:47
@yoavGrs yoavGrs changed the base branch from main to yoav/block_hash/block_commitments May 15, 2024 19:48
@yoavGrs yoavGrs force-pushed the yoav/block_hash/block_commitments branch 2 times, most recently from 1030106 to 9711a6b Compare May 20, 2024 06:56
@yoavGrs yoavGrs force-pushed the yoav/block_hash_calculation branch from 4e88432 to 7760bb9 Compare May 20, 2024 06:56
@yoavGrs yoavGrs force-pushed the yoav/block_hash/block_commitments branch 7 times, most recently from 09320c0 to 4dedc9c Compare May 21, 2024 13:01
@yoavGrs yoavGrs changed the base branch from yoav/block_hash/block_commitments to main May 21, 2024 13:45
@yoavGrs yoavGrs force-pushed the yoav/block_hash_calculation branch from 7760bb9 to 4393671 Compare May 27, 2024 12:23
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama)

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)


src/block_hash/block_hash_calculator.rs line 46 at r1 (raw file):

Previously, yoavGrs wrote…

Because Block contains block_hash and optional commitments.
Should I define a new struct, BlockWithoutHash?

Yes, I'd rename the current Block to BlockWithCommitments. You can put a TODO for now

Copy link
Contributor Author

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ShahakShama)


src/block_hash/block_hash_calculator.rs line 46 at r1 (raw file):

Previously, ShahakShama wrote…

Yes, I'd rename the current Block to BlockWithCommitments. You can put a TODO for now

The structure of Block should change and contain: BlockHeader (currently BlockHeaderWithoutHash), BlockBody, BlockHeaderCommitments and BlockHash.
It's a breaking change that is bigger than a renaming TODO.

ShahakShama
ShahakShama previously approved these changes May 27, 2024
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)

@yoavGrs yoavGrs merged commit 2f1f1b0 into main May 28, 2024
6 checks passed
@yoavGrs yoavGrs deleted the yoav/block_hash_calculation branch May 28, 2024 06:50
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.

3 participants