Skip to content

Commit

Permalink
feat(cost-estimator): rolling block range (#249)
Browse files Browse the repository at this point in the history
* bump cost estimator rolling range

* add
  • Loading branch information
ratankaliani authored Dec 1, 2024
1 parent 7e23174 commit 62d36a0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
48 changes: 48 additions & 0 deletions configs/4801/rollup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"genesis": {
"l1": {
"number": 6278018,
"hash": "0xd220bbdf24df6d1611f4ece1d08c64feae914ce6299ab2806c864e30a5289201"
},
"l2": {
"number": 0,
"hash": "0xf1deb67ee953f94d8545d2647918687fa8ba1f30fa6103771f11b7c483984070"
},
"l2_time": 1720547424,
"system_config": {
"batcherAddr": "0x0f3ff4731d7a10b89ed79ad1fd97844d7f66b96d",
"overhead": "0xbc",
"scalar": "0xa6fe0",
"gasLimit": 100000000,
"baseFeeScalar": null,
"blobBaseFeeScalar": null,
"eip1559Denominator": null,
"eip1559Elasticity": null
}
},
"block_time": 2,
"max_sequencer_drift": 1800,
"seq_window_size": 3600,
"channel_timeout": 300,
"granite_channel_timeout": 50,
"l1_chain_id": 11155111,
"l2_chain_id": 4801,
"base_fee_params": {
"max_change_denominator": "0x32",
"elasticity_multiplier": "0xa"
},
"canyon_base_fee_params": {
"max_change_denominator": "0xfa",
"elasticity_multiplier": "0xa"
},
"regolith_time": 0,
"canyon_time": 0,
"delta_time": 0,
"ecotone_time": 0,
"fjord_time": 1721739600,
"granite_time": 1726570800,
"batch_inbox_address": "0xff00000000000000000000000000000000484752",
"deposit_contract_address": "0xff6eba109271fe6d4237eeed4bab1dd9a77dd1a4",
"l1_system_config_address": "0x166f9406e79a656f12f05247fb8f5dfa6155bcbf",
"protocol_versions_address": "0x0000000000000000000000000000000000000000"
}
12 changes: 9 additions & 3 deletions scripts/utils/bin/cost_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,17 @@ async fn main() -> Result<()> {
let data_fetcher = OPSuccinctDataFetcher::new_with_rollup_config().await?;
let l2_chain_id = data_fetcher.get_l2_chain_id().await?;

const DEFAULT_RANGE: u64 = 5;
const COST_ESTIMATOR_ROLLING_RANGE: u64 = 100;
let (l2_start_block, l2_end_block) = if args.rolling {
get_rolling_block_range(&data_fetcher, TWELVE_HOURS, DEFAULT_RANGE).await?
get_rolling_block_range(&data_fetcher, TWELVE_HOURS, COST_ESTIMATOR_ROLLING_RANGE).await?
} else {
get_validated_block_range(&data_fetcher, args.start, args.end, DEFAULT_RANGE).await?
get_validated_block_range(
&data_fetcher,
args.start,
args.end,
COST_ESTIMATOR_ROLLING_RANGE,
)
.await?
};

let split_ranges = split_range(l2_start_block, l2_end_block, l2_chain_id, args.batch_size);
Expand Down

0 comments on commit 62d36a0

Please sign in to comment.