-
Notifications
You must be signed in to change notification settings - Fork 250
Closed
Labels
Description
The gas price and gas multiplier are stored in two different places, and both are currently in use by the submitter.
-
It is stored in the manager as two fields: https://github.com/rollkit/rollkit/blob/main/block/manager.go#L147
-
It is stored in the DA in two methods: https://github.com/rollkit/rollkit/blob/main/core/da/da.go#L40
Both are used:
- To submit headers the manager field is used:
func (m *Manager) submitHeadersToDA(ctx context.Context) error {
...
gasPrice := m.gasPrice
initialGasPrice := gasPrice
...
if m.gasMultiplier > 0 && gasPrice != -1 {
gasPrice = gasPrice / m.gasMultiplier
gasPrice = max(gasPrice, initialGasPrice)
}- To submit batches, both the manager field and the DA method are used:
func (m *Manager) submitBatchToDA(ctx context.Context, batch coresequencer.Batch) error {
...
initialGasPrice := m.gasPrice
gasPrice := initialGasPrice
...
gasMultiplier, multErr := m.da.GasMultiplier(ctx)
if multErr != nil {
m.logger.Error("failed to get gas multiplier", "error", multErr)
gasMultiplier = 0
}
...
if gasMultiplier > 0 && gasPrice != 0 {
gasPrice = gasPrice / gasMultiplier
if gasPrice < initialGasPrice {
gasPrice = initialGasPrice
}
}Reactions are currently unavailable