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(papyrus_protobuf): impl Default for BlockInfo #3907

Conversation

asmaastarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

asmaastarkware commented Feb 3, 2025

Copy link
Contributor

@guy-starkware guy-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 all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @asmaastarkware and @matan-starkware)


crates/papyrus_protobuf/src/consensus.rs line 79 at r1 (raw file):

            sequencer_address: Default::default(),
            l1_da_mode: Default::default(),
            l2_gas_price_fri: 1,

I don't have any objections to this specifically. The thing I'm worried about (as with any default) is what happens when people leave it with the default value. Is there a danger that we release very cheap blocks because it got left on the default. I can't really make a judgement call on the implications of having this default.

And also, why not just set some of these to zero? Would it be just as good as 1 in the case of gas price? I would guess it is quite negligible if it is 0 or 1, so I don't know if it matters. Probably the exchange rate set to 1 is better than 0.

Maybe @matan-starkware would have a stronger opinion on the actual values. I'm going to lgtm this in any case.

Copy link
Contributor

@matan-starkware matan-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 r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @guy-starkware)


crates/papyrus_protobuf/src/consensus.rs line 79 at r1 (raw file):

Previously, guy-starkware wrote…

I don't have any objections to this specifically. The thing I'm worried about (as with any default) is what happens when people leave it with the default value. Is there a danger that we release very cheap blocks because it got left on the default. I can't really make a judgement call on the implications of having this default.

And also, why not just set some of these to zero? Would it be just as good as 1 in the case of gas price? I would guess it is quite negligible if it is 0 or 1, so I don't know if it matters. Probably the exchange rate set to 1 is better than 0.

Maybe @matan-starkware would have a stronger opinion on the actual values. I'm going to lgtm this in any case.

Good questions Guy.

In terms of gas prices 0 is considered an invalid value (the type the Batcher receives is NonzeroGasPrice).

Asmaa, why do we need to implement Default for BlockInfo?

  • If this is for tests that really don't care other than basic validations (non zero gas) then I can understand this, but I'd probably prefer the test just define a const.
  • If this is for prod I am confused, since we expect prod to actually set all of these fields and validate them.
  • If this if for the intermediate step where we don't have the real values for all the fields I prefer you define consts in the sequencer context and then we can remove them when ready (e.g. Guy has the actual L1 gas prices, Ayelet the l2 price, etc.)

@asmaastarkware asmaastarkware force-pushed the asmaa/block_info/add_to_proposalpart branch from d982d57 to ee02002 Compare February 4, 2025 08:49
@asmaastarkware asmaastarkware force-pushed the asmaa/block_info/impl_default_for_blockinfo branch from 4792985 to d5289ea Compare February 4, 2025 08:49
@asmaastarkware asmaastarkware force-pushed the asmaa/block_info/impl_default_for_blockinfo branch from d5289ea to b8738c4 Compare February 4, 2025 09:09
@asmaastarkware asmaastarkware force-pushed the asmaa/block_info/add_to_proposalpart branch from ee02002 to 309289d Compare February 4, 2025 09:09
Copy link
Contributor Author

@asmaastarkware asmaastarkware 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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @guy-starkware and @matan-starkware)


crates/papyrus_protobuf/src/consensus.rs line 79 at r1 (raw file):

Previously, matan-starkware wrote…

Good questions Guy.

In terms of gas prices 0 is considered an invalid value (the type the Batcher receives is NonzeroGasPrice).

Asmaa, why do we need to implement Default for BlockInfo?

  • If this is for tests that really don't care other than basic validations (non zero gas) then I can understand this, but I'd probably prefer the test just define a const.
  • If this is for prod I am confused, since we expect prod to actually set all of these fields and validate them.
  • If this if for the intermediate step where we don't have the real values for all the fields I prefer you define consts in the sequencer context and then we can remove them when ready (e.g. Guy has the actual L1 gas prices, Ayelet the l2 price, etc.)

no need for it,
closed 👍

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
@asmaastarkware asmaastarkware deleted the asmaa/block_info/impl_default_for_blockinfo branch February 13, 2025 11:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants