Skip to content

Resolve discrepancy between on-chain and off-chain elasticity_multiplier values. #11149

Description

@geoknee

Off chain

op-geth uses a static elasticity multiplier set in the chain config. See here and here.

This value is currently hardcoded to 6.

On chain

We also store an elasticityMultiplier inside the ResourceConfig struct:

/// value.
struct ResourceConfig {
uint32 maxResourceLimit;
uint8 elasticityMultiplier;
uint8 baseFeeMaxChangeDenominator;

in the SytemConfig contract:

/// @notice The configuration for the deposit fee market.
/// Used by the OptimismPortal to meter the cost of buying L2 gas on L1.
/// Set as internal with a getter so that the struct is returned instead of a tuple.
ResourceMetering.ResourceConfig internal _resourceConfig;

On OP Mainnet, the parameter is actually set to 10. See this etherscan link.. I believe this is a historical / out-of-date value.

Moreover, we are actually reading and validating this parameter in the superchain registry (see here), since we have specified that 10 is the standard value.

From what I can tell this parameter is not being read by the off-chain software. Here's a hint that this was once the plan:

/// @notice An internal setter for the resource config.
/// Ensures that the config is sane before storing it by checking for invariants.
/// In the future, this method may emit an event that the `op-node` picks up
/// for when the resource config is changed.
/// @param _config The new resource config.
function _setResourceConfig(ResourceMetering.ResourceConfig memory _config) internal {

I propose that we should either:

  1. Complete that plan so that the elasticity parameter can be changed on chain and picked up off chain
  2. Remove the on chain parameter in the next contracts release to prevent confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions