feat(op-node): add l1 cache size config #225
Merged
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
This PR includes two changes:
Rationale
In #104, I made modifications to the receipt cache of the L1 client, significantly improving the cache hit rate. However, there are some issues when the safe block height lags far behind the unsafe block height. Firstly, the L1 receipt cache data corresponding to the safe block height is only deleted from the cache after the safe block height is processed. If the safe block height lags too far behind the unsafe block height, the L1 receipt cache becomes full. This prevents the new unsafe block height from accessing the cache, triggering the optimization logic in #87, where the unsafe block height continues to produce blocks based on the same L1 block height instead of moving to the next L1 block height. Additionally, the maximum value of our cache is hardcoded in the code. If the transaction volume of the chain is too low and the batcher submission frequency is very low, it is easy for the safe block height to lag behind the unsafe block height. We need to allow users to configure the maximum value of the cache to ensure it is greater than or equal to the maximum height difference between the L1 blocks corresponding to the unsafe block height and the safe block height.
Example
none
Changes
Notable changes: