-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(bolt-sidecar): correctly get preconf gas limit from env #656
base: unstable
Are you sure you want to change the base?
Conversation
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.
Good catch! A couple of minor questions
@@ -229,8 +225,8 @@ impl<C: StateFetcher> ExecutionState<C> { | |||
// Load the default KZG settings | |||
kzg_settings: EnvKzgSettings::default(), | |||
// TODO: add a way to configure these values from CLI |
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.
Is this comment still relevant?
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.
yes, currently only preconf_gas_limit
is configurable
/// Other values used for validation.
#[derive(Debug)]
pub struct ValidationParams {
pub preconf_gas_limit: u64,
pub max_tx_input_bytes: usize,
pub max_init_code_byte_size: usize,
}
impl ValidationParams {
pub fn new(gas_limit: u64) -> Self {
Self {
preconf_gas_limit: gas_limit,
max_tx_input_bytes: 4 * 32 * 1024,
max_init_code_byte_size: 2 * 24576,
}
}
}
Haven't been able to review the usefulnes of the others yet, so will leave the TODO for now
bolt-sidecar/src/state/execution.rs
Outdated
@@ -286,7 +282,7 @@ impl<C: StateFetcher> ExecutionState<C> { | |||
return Err(ValidationError::TransactionSizeTooHigh); | |||
} | |||
|
|||
// Check if the gas limit is higher than the maximum block gas limit | |||
// Check if the gas limit is higher than the preconf block gas limit | |||
if req.gas_limit() > self.validation_params.block_gas_limit { |
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.
Do you think renaming the property block_gas_limit
of validation_params
to preconf_gas_limit
enhances clarity?
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.
yes, good idea
9cd5b9c
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.
Sorry about nitpicking the naming here, but can we change this to inclusion_gas_limit
? If introduce new commitment types, or execution preconfs, the naming is less ambiguous. In general let's try to use inclusion commitment or something similar instead of preconf in the codebase
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.
nitpicking is good 👑👑
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.
Last nit
Co-authored-by: Lorenzo <[email protected]>
Currently we get
BOLT_SIDECAR_GAS_LIMIT
which is the gas limit for a single tx. It defaults toDEFAULT_GAS_LIMIT
which is 30M. That means pricing input validation will not fail when trying to use more gas than what's left for preconfs in a block. Other valdiation might reject this earlier, but I'd like it to be rejected here as well.I think it's confusing to have to ENV vars that do the same, so removed
BOLT_SIDECAR_GAS_LIMIT
and replace it withBOLT_SIDECAR_MAX_COMMITTED_GAS