mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-01-06 23:23:08 +00:00
scale_block_size is a float now
This commit is contained in:
parent
4c014275de
commit
e64c573ec2
@ -60,7 +60,7 @@ def run_simulation(params: SimulationParameters) -> Tuple[pd.DataFrame, pd.DataF
|
||||
stop_below_gas_limit:bool = _generate_random_bool(params.probability_stop_below_gas_limit)
|
||||
|
||||
scale_block_size = np.random.uniform(
|
||||
params.scale_block_size_limits[0], params.scale_block_size_limits[1]
|
||||
0., params.scale_block_size
|
||||
)
|
||||
|
||||
for chain, pool, tfm, stats in zip(
|
||||
|
||||
@ -11,19 +11,17 @@ class SimulationParameters:
|
||||
demand_probabilities: List[float] = [0.05, 0.9, 0.05],
|
||||
fee_cap_range:Tuple[float]=(-0.1, 0.1),
|
||||
max_tip_pct:float=0.1,
|
||||
scale_block_size_limits: Tuple[float] = (0.0, 0.2),
|
||||
scale_block_size: float = 0.2,
|
||||
probability_stop_below_gas_limit: float = 0.5,
|
||||
purge_after: int = 4,
|
||||
variable_gas_limits: bool = True
|
||||
):
|
||||
assert len(demand_sizes) == len(demand_probabilities), "demand_sizes and demand_probabilities must have the same length"
|
||||
assert abs(sum(demand_probabilities) - 1.0) < 1.e-12, "demand_probabilities must sum to 1.0"
|
||||
assert 0.0 <= probability_stop_below_gas_limit <= 1.0, "probability_stop_below_gas_limit must be between 0 and 1"
|
||||
assert len(scale_block_size_limits) == 2, "scale_block_size_limits must be a tuple of length 2"
|
||||
assert scale_block_size_limits[0] <= scale_block_size_limits[1], "scale_block_size_limits must be in increasing order"
|
||||
assert all([0.0 <= p <= 1.0 for p in demand_probabilities]), "demand_probabilities must be between 0 and 1"
|
||||
assert scale_block_size_limits[0] >= 0.0, "scale_block_size_limits must be positive"
|
||||
assert scale_block_size_limits[1] <= 1.0, "scale_block_size_limits must be less than or equal to 1.0"
|
||||
assert 0.0 <= probability_stop_below_gas_limit <= 1.0, "probability_stop_below_gas_limit must be between 0 and 1"
|
||||
assert 0 < scale_block_size, "scale_block_size must be strictly positive"
|
||||
assert scale_block_size <= 1.0, "scale_block_size must be less than or equal to 1.0"
|
||||
assert len(fee_cap_range) == 2, "fee_cap_range must be a tuple of length 2"
|
||||
assert fee_cap_range[0] <= fee_cap_range[1], "fee_cap_range must be in increasing order"
|
||||
assert max_tip_pct >= 0.0, "max_tip_pct must be positive"
|
||||
@ -34,7 +32,7 @@ class SimulationParameters:
|
||||
self.demand_probabilities = demand_probabilities
|
||||
self.fee_cap_range = fee_cap_range
|
||||
self.max_tip_pct = max_tip_pct
|
||||
self.scale_block_size_limits = scale_block_size_limits
|
||||
self.scale_block_size = scale_block_size
|
||||
self.probability_stop_below_gas_limit = probability_stop_below_gas_limit
|
||||
self.purge_after = purge_after
|
||||
self.variable_gas_limits = variable_gas_limits
|
||||
Loading…
x
Reference in New Issue
Block a user