Skip to content

duplication of gasprice and gasmultiplier #2316

@pthmas

Description

@pthmas

The gas price and gas multiplier are stored in two different places, and both are currently in use by the submitter.

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
				}
			}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions