op-batcher: Add threshold for L1 blob base fee #11212
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add the new flag to op-batcher to cancel tx sending if the L1 blob base fee exceeds the threshold. The threshold value can be set using the cli argument
--max-l1-blob-base-fee=n
or the environment variableOP_BATCHER_MAX_L1_BLOB_BASE_FEE=n
. If the threshold is set to 0 (default), no action will be taken.This will be useful for the test L2 networks rolling up to the Sepolia network, which tends to have high blob fee rates.
Since no JSON-RPC method was found to get the L1 blob base fee, this implementation get the fee from the L2 GasPriceOracle contract:
optimism/packages/contracts-bedrock/src/L2/GasPriceOracle.sol
Lines 136 to 138 in 0db615d
Tests
ak-akiyama@da79ba0#diff-6524d10e489e31223b0801a83152fb420341719ae1fb7deab8b74597b5c437e9R129-R156