-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat(papyrus_protobuf): impl Default for BlockInfo #3907
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this 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.
There was a problem hiding this 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.)
d982d57
to
ee02002
Compare
4792985
to
d5289ea
Compare
d5289ea
to
b8738c4
Compare
ee02002
to
309289d
Compare
There was a problem hiding this 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 👍
No description provided.