diff --git a/aztec_gddt/functional_parameterization_logic.py b/aztec_gddt/functional_parameterization_logic.py new file mode 100644 index 0000000..de85ecd --- /dev/null +++ b/aztec_gddt/functional_parameterization_logic.py @@ -0,0 +1,56 @@ +from aztec_gddt.helper import bernoulli_trial, trial_probability + + +def commit_bond_reveal_behavior(state, params): + if params["fp_commit_bond_reveal"] == "Bernoulli": + return bernoulli_trial( + probability=trial_probability( + params["phase_duration_commit_bond_max_blocks"], + params["final_probability"], + ) + ) + else: + assert False, "Not implemented" + + +def proving_market_is_used_behavior(state, params): + if params["fp_proving_market_used"] == "Bernoulli": + return bernoulli_trial(params["proving_marketplace_usage_probability"]) + else: + assert False, "Not implemented" + + +def potential_proposer_behavior(state, params): + if params["fp_potential_proposer"] == "Bernoulli": + return bernoulli_trial( + trial_probability( + params["phase_duration_proposal_max_blocks"], + params["final_probability"], + ) + ) + else: + assert False, "Not implemented" + + +def reveal_block_content_behavior(state, params): + if params["fp_reveal_block_content"] == "Bernoulli": + return bernoulli_trial( + probability=trial_probability( + params["phase_duration_reveal_max_blocks"], + params["final_probability"], + ) + ) + else: + assert False, "Not implemented" + + +def reveal_rollup_proof_behavior(state, params): + if params["fp_reveal_rollup_proof"] == "Bernoulli": + return bernoulli_trial( + probability=trial_probability( + params["phase_duration_rollup_max_blocks"], + params["final_probability"], + ) + ) + else: + assert False, "Not implemented" diff --git a/aztec_gddt/logic.py b/aztec_gddt/logic.py index a798007..937c1f2 100644 --- a/aztec_gddt/logic.py +++ b/aztec_gddt/logic.py @@ -11,6 +11,13 @@ import pickle from aztec_gddt.types import Agent +from .functional_parameterization_logic import ( + commit_bond_reveal_behavior, + proving_market_is_used_behavior, + potential_proposer_behavior, + reveal_block_content_behavior, + reveal_rollup_proof_behavior, +) def generic_policy(_1, _2, _3, _4) -> dict: @@ -165,8 +172,7 @@ def s_current_process_time(_1, _2, _3, state: AztecModelState, signal: SignalTim updated_process: Process | None = copy(state["current_process"]) if updated_process is not None: # type: ignore - updated_process.duration_in_current_phase += signal.get( - "delta_blocks", 0) + updated_process.duration_in_current_phase += signal.get("delta_blocks", 0) else: pass @@ -206,19 +212,27 @@ def value_from_param_timeseries_suf( return value -def s_gas_fee_l1(p: AztecModelParams, _2, _3, s, _5): +def s_gas_fee_l1(p: AztecModelParams, _2, _3, s, _5): key = "gas_fee_l1" - random_value = value_from_param_timeseries_suf(p, s, "gas_fee_l1_time_series", key) + random_value = value_from_param_timeseries_suf(p, s, "gas_fee_l1_time_series", key) past_value = s[key] - value = round(p['past_gas_weight_fraction'] * past_value + (1 - p['past_gas_weight_fraction']) * random_value) + value = round( + p["past_gas_weight_fraction"] * past_value + + (1 - p["past_gas_weight_fraction"]) * random_value + ) return (key, value) -def s_gas_fee_blob(p: AztecModelParams, _2, _3, s, _5): +def s_gas_fee_blob(p: AztecModelParams, _2, _3, s, _5): key = "gas_fee_blob" - random_value = value_from_param_timeseries_suf(p, s, "gas_fee_blob_time_series", key) + random_value = value_from_param_timeseries_suf( + p, s, "gas_fee_blob_time_series", key + ) past_value = s[key] - value = round(p['past_gas_weight_fraction'] * past_value + (1 - p['past_gas_weight_fraction']) * random_value) + value = round( + p["past_gas_weight_fraction"] * past_value + + (1 - p["past_gas_weight_fraction"]) * random_value + ) return (key, value) @@ -315,12 +329,14 @@ def p_select_proposal( state["transactions"] ) - proposals = {k: p for k, p in raw_proposals.items() - if p.when >= process.current_phase_init_time} + proposals = { + k: p + for k, p in raw_proposals.items() + if p.when >= process.current_phase_init_time + } if len(proposals) > 0: - number_uncles: int = min( - len(proposals) - 1, params["uncle_count"]) + number_uncles: int = min(len(proposals) - 1, params["uncle_count"]) ranked_proposals: list[Proposal] = sorted( proposals.values(), key=lambda p: p.score, reverse=True @@ -329,7 +345,7 @@ def p_select_proposal( winner_proposal: Proposal = ranked_proposals[0] if len(ranked_proposals) > 1: uncle_proposals: list[Proposal] = ranked_proposals[ - 1: number_uncles + 1 + 1 : number_uncles + 1 ] else: uncle_proposals = [] @@ -343,8 +359,7 @@ def p_select_proposal( updated_process.phase = SelectionPhase.pending_commit_bond updated_process.duration_in_current_phase = 0 updated_process.leading_sequencer = winner_proposal.who - updated_process.uncle_sequencers = [ - p.who for p in uncle_proposals] + updated_process.uncle_sequencers = [p.who for p in uncle_proposals] updated_process.tx_winning_proposal = winner_proposal.uuid else: updated_process = copy(process) @@ -400,38 +415,38 @@ def p_commit_bond( gas: Gas = params["gas_estimators"].commitment_bond(state) fee = gas * state["gas_fee_l1"] # Assumption: Agents have extra costs / profit considerations and need a safety buffer - SAFETY_BUFFER = params['safety_factor_commit_bond'] * fee + SAFETY_BUFFER = params["safety_factor_commit_bond"] * fee - expected_l2_blocks_per_day = params['l1_blocks_per_day'] / \ - max_phase_duration(params) + expected_l2_blocks_per_day = params[ + "l1_blocks_per_day" + ] / max_phase_duration(params) - expected_rewards = params['daily_block_reward'] + expected_rewards = params["daily_block_reward"] expected_rewards *= rewards_to_sequencer(params) expected_rewards /= expected_l2_blocks_per_day expected_costs: float = params["op_cost_sequencer"] expected_costs += fee expected_costs += SAFETY_BUFFER - expected_costs *= params['gwei_to_tokens'] + expected_costs *= params["gwei_to_tokens"] payoff_reveal = expected_rewards - expected_costs if payoff_reveal >= 0: # If duration is not expired, do a trial to see if bond is commited - agent_decides_to_reveal_commit_bond = bernoulli_trial( - probability=trial_probability(params['phase_duration_commit_bond_max_blocks'], - params['final_probability']) + agent_decides_to_reveal_commit_bond = commit_bond_reveal_behavior( + state, params ) gas_fee_l1_acceptable = ( state["gas_fee_l1"] <= params["gas_threshold_for_tx"] ) if agent_decides_to_reveal_commit_bond and gas_fee_l1_acceptable: updated_process = copy(process) - lead_seq: Agent = state['agents'][process.leading_sequencer] + lead_seq: Agent = state["agents"][process.leading_sequencer] proposal_uuid = process.tx_winning_proposal - proving_market_is_used = bernoulli_trial( - params["proving_marketplace_usage_probability"] + proving_market_is_used = proving_market_is_used_behavior( + state, params ) if proving_market_is_used: provers: list[AgentUUID] = [ @@ -443,12 +458,12 @@ def p_commit_bond( if len(provers) > 0: prover: AgentUUID = choice(provers) else: - if (lead_seq.balance >= bond_amount): + if lead_seq.balance >= bond_amount: prover = updated_process.leading_sequencer else: prover = None else: - if (lead_seq.balance >= bond_amount): + if lead_seq.balance >= bond_amount: prover = updated_process.leading_sequencer else: prover = None @@ -536,25 +551,25 @@ def p_reveal_content( gas: Gas = params["gas_estimators"].content_reveal(state) fee = gas * state["gas_fee_l1"] # Assumption: Agents have extra costs / profit considerations and need a safety buffer - SAFETY_BUFFER = params['safety_factor_reveal_content'] * fee - expected_l2_blocks_per_day = params['l1_blocks_per_day'] / \ - max_phase_duration(params) + SAFETY_BUFFER = params["safety_factor_reveal_content"] * fee + expected_l2_blocks_per_day = params[ + "l1_blocks_per_day" + ] / max_phase_duration(params) - expected_rewards = params['daily_block_reward'] + expected_rewards = params["daily_block_reward"] expected_rewards *= rewards_to_sequencer(params) expected_rewards /= expected_l2_blocks_per_day expected_costs: float = params["op_cost_sequencer"] expected_costs += fee expected_costs += SAFETY_BUFFER - expected_costs *= params['gwei_to_tokens'] + expected_costs *= params["gwei_to_tokens"] payoff_reveal = expected_rewards - expected_costs agent_expects_profit = payoff_reveal >= 0 - agent_decides_to_reveal_block_content = bernoulli_trial( - probability=trial_probability(params['phase_duration_reveal_max_blocks'], - params['final_probability']) + agent_decides_to_reveal_block_content = reveal_block_content_behavior( + state, params ) gas_fee_blob_acceptable = ( state["gas_fee_blob"] <= params["blob_gas_threshold_for_tx"] @@ -574,7 +589,7 @@ def p_reveal_content( updated_process.phase = SelectionPhase.pending_rollup_proof updated_process.duration_in_current_phase = 0 - who = updated_process.leading_sequencer + who = updated_process.leading_sequencer blob_gas: BlobGas = params["gas_estimators"].content_reveal_blob( state ) @@ -582,7 +597,9 @@ def p_reveal_content( tx_count = params["tx_estimators"].transaction_count(state) tx_avg_size = int( - state["transactions"][process.tx_winning_proposal].size / tx_count) # type: ignore + state["transactions"][process.tx_winning_proposal].size + / tx_count + ) # type: ignore tx_avg_fee_per_size = params[ "tx_estimators" ].transaction_average_fee_per_size(state) @@ -643,7 +660,8 @@ def p_submit_proof( transactions = state["transactions"] commit_bond_id = updated_process.tx_commitment_bond commit_bond: CommitmentBond = transactions.get( - commit_bond_id, None) # type: ignore + commit_bond_id, None + ) # type: ignore who_to_slash = commit_bond.prover_uuid how_much_to_slash = commit_bond.bond_amount @@ -661,31 +679,35 @@ def p_submit_proof( gas: Gas = params["gas_estimators"].content_reveal(state) fee = gas * state["gas_fee_l1"] # Assumption: Agents have extra costs / profit considerations and need a safety buffer - SAFETY_BUFFER = params['safety_factor_rollup_proof'] * fee - expected_l2_blocks_per_day = params['l1_blocks_per_day'] / \ - max_phase_duration(params) + SAFETY_BUFFER = params["safety_factor_rollup_proof"] * fee + expected_l2_blocks_per_day = params[ + "l1_blocks_per_day" + ] / max_phase_duration(params) - expected_rewards = params['daily_block_reward'] - expected_rewards *= params['rewards_to_provers'] + expected_rewards = params["daily_block_reward"] + expected_rewards *= params["rewards_to_provers"] expected_rewards /= expected_l2_blocks_per_day expected_costs: float = params["op_cost_prover"] expected_costs += fee expected_costs += SAFETY_BUFFER - expected_costs *= params['gwei_to_tokens'] + expected_costs *= params["gwei_to_tokens"] payoff_reveal = expected_rewards - expected_costs agent_expects_profit = payoff_reveal >= 0 - agent_decides_to_reveal_rollup_proof = bernoulli_trial( - probability=trial_probability(params['phase_duration_rollup_max_blocks'], - params['final_probability']) + agent_decides_to_reveal_rollup_proof = reveal_rollup_proof_behavior( + state, params ) gas_fee_l1_acceptable = ( state["gas_fee_l1"] <= params["gas_threshold_for_tx"] ) - if agent_decides_to_reveal_rollup_proof and gas_fee_l1_acceptable and agent_expects_profit: + if ( + agent_decides_to_reveal_rollup_proof + and gas_fee_l1_acceptable + and agent_expects_profit + ): updated_process = copy(process) advance_blocks = remaining_time updated_process.phase = SelectionPhase.finalized @@ -693,11 +715,13 @@ def p_submit_proof( transactions = state["transactions"] commit_bond_id = updated_process.tx_commitment_bond commit_bond: CommitmentBond = transactions.get( - commit_bond_id, None) # type: ignore + commit_bond_id, None + ) # type: ignore who = commit_bond.prover_uuid - gas: Gas = params['gas_estimators'].rollup_proof( - state) # TODO: Check? - fee: Gwei = gas * state['gas_fee_l1'] + gas: Gas = params["gas_estimators"].rollup_proof( + state + ) # TODO: Check? + fee: Gwei = gas * state["gas_fee_l1"] tx = RollupProof( who=who, when=state["time_l1"], uuid=uuid4(), gas=gas, fee=fee @@ -746,13 +770,13 @@ def p_race_mode( who = "l1-builder" gas: Gas = params["gas_estimators"].content_reveal(state) fee: Gwei = gas * state["gas_fee_l1"] - blob_gas: BlobGas = params["gas_estimators"].content_reveal_blob( - state) + blob_gas: BlobGas = params["gas_estimators"].content_reveal_blob(state) blob_fee: Gwei = blob_gas * state["gas_fee_blob"] tx_count = params["tx_estimators"].transaction_count(state) tx_avg_size = int( - state["transactions"][process.tx_winning_proposal].size / tx_count) # type: ignore + state["transactions"][process.tx_winning_proposal].size / tx_count + ) # type: ignore tx_avg_fee_per_size = params[ "tx_estimators" ].transaction_average_fee_per_size(state) @@ -817,27 +841,28 @@ def s_transactions_new_proposals( new_proposals: dict[TxUUID, Proposal] = dict() if current_process is not None: if current_process.phase == SelectionPhase.pending_proposals: - current_proposers: set[AgentUUID] = {p.who - for p in new_transactions.values() - if p.when >= current_process.current_phase_init_time} + current_proposers: set[AgentUUID] = { + p.who + for p in new_transactions.values() + if p.when >= current_process.current_phase_init_time + } potential_proposers: set[AgentUUID] = { u.uuid for u in state["agents"].values() if u.uuid not in current_proposers and u.is_sequencer - and u.staked_amount >= params['minimum_stake'] + and u.staked_amount >= params["minimum_stake"] } for potential_proposer in potential_proposers: - if bernoulli_trial(trial_probability(params['phase_duration_proposal_max_blocks'], - params['final_probability'])): + if potential_proposer_behavior(state, params): tx_uuid = uuid4() gas: Gas = params["gas_estimators"].proposal(state) fee: Gwei = gas * state["gas_fee_l1"] score = uniform.rvs() # Assumption: score is always uniform size = params["tx_estimators"].proposal_average_size(state) - public_share = 0.5 # Assumption: Share of public function calls + public_share = 0.5 # Assumption: Share of public function calls if state["gas_fee_l1"] <= params["gas_threshold_for_tx"]: new_proposal = Proposal( @@ -884,8 +909,7 @@ def s_transactions( "new_transactions", list() ) # type: ignore - new_tx_dict: dict[TxUUID, TransactionL1] = { - tx.uuid: tx for tx in new_tx_list} + new_tx_dict: dict[TxUUID, TransactionL1] = {tx.uuid: tx for tx in new_tx_list} new_transactions = {**state["transactions"].copy(), **new_tx_dict} @@ -910,7 +934,8 @@ def s_slashes_to_prover( [ transfer for transfer in transfers - if (transfer.kind == TransferKind.slash_prover) and (transfer.to_prover == True) + if (transfer.kind == TransferKind.slash_prover) + and (transfer.to_prover == True) ] ) @@ -970,7 +995,7 @@ def s_agent_transfer( updated_agents[transfer.source].balance -= transfer.amount updated_agents[transfer.destination].balance += transfer.amount else: - raise Exception(f'Transfer logic is undefined for {transfer.kind}') + raise Exception(f"Transfer logic is undefined for {transfer.kind}") return ("agents", updated_agents) @@ -983,9 +1008,10 @@ def p_block_reward( # Assumption: this assumes that the average L2 block duration # will be the max L2 block duration - expected_l2_blocks_per_day = params['l1_blocks_per_day'] / \ - max_phase_duration(params) - reward = params['daily_block_reward'] / expected_l2_blocks_per_day + expected_l2_blocks_per_day = params["l1_blocks_per_day"] / max_phase_duration( + params + ) + reward = params["daily_block_reward"] / expected_l2_blocks_per_day else: reward = 0 return SignalPayout(block_reward=reward) @@ -1046,8 +1072,7 @@ def s_total_rewards_provers( if not p.entered_race_mode: prover_uuid = txs[p.tx_commitment_bond].prover_uuid # type: ignore - relays = [a_id for (a_id, a) - in state["agents"].items() if a.is_relay] + relays = [a_id for (a_id, a) in state["agents"].items() if a.is_relay] relay_uuid: AgentUUID = choice(relays) else: prover_uuid = sequencer_uuid @@ -1081,8 +1106,7 @@ def s_total_rewards_sequencers( if not p.entered_race_mode: prover_uuid = txs[p.tx_commitment_bond].prover_uuid # type: ignore - relays = [a_id for (a_id, a) - in state["agents"].items() if a.is_relay] + relays = [a_id for (a_id, a) in state["agents"].items() if a.is_relay] relay_uuid: AgentUUID = choice(relays) else: prover_uuid = sequencer_uuid @@ -1118,8 +1142,7 @@ def s_total_rewards_relays( if not p.entered_race_mode: prover_uuid = txs[p.tx_commitment_bond].prover_uuid # type: ignore - relays = [a_id for (a_id, a) - in state["agents"].items() if a.is_relay] + relays = [a_id for (a_id, a) in state["agents"].items() if a.is_relay] relay_uuid: AgentUUID = choice(relays) else: prover_uuid = sequencer_uuid @@ -1150,8 +1173,7 @@ def s_agents_rewards( if not p.entered_race_mode: prover_uuid = txs[p.tx_commitment_bond].prover_uuid # type: ignore - relays = [a_id for (a_id, a) - in state["agents"].items() if a.is_relay] + relays = [a_id for (a_id, a) in state["agents"].items() if a.is_relay] relay_uuid: AgentUUID = choice(relays) else: prover_uuid = sequencer_uuid @@ -1210,16 +1232,15 @@ def s_agent_restake( state: AztecModelState, signal: SignalEvolveProcess, ): - new_agents = state['agents'].copy() + new_agents = state["agents"].copy() sequencers = {k: v for k, v in new_agents.items() if v.is_sequencer} for k, v in sequencers.items(): - if v.staked_amount < params['minimum_stake']: + if v.staked_amount < params["minimum_stake"]: # Assumption: Sequencers top-up from balance with 2 more ETH than necessary - max_amount_to_stake = ( - params['minimum_stake'] - v.staked_amount + 2.0) + max_amount_to_stake = params["minimum_stake"] - v.staked_amount + 2.0 amount_to_stake = min(max_amount_to_stake, v.balance) v.balance -= amount_to_stake v.staked_amount += amount_to_stake - return ('agents', new_agents) + return ("agents", new_agents) diff --git a/aztec_gddt/params.py b/aztec_gddt/params.py index aa7a1e6..7f87eeb 100644 --- a/aztec_gddt/params.py +++ b/aztec_gddt/params.py @@ -36,7 +36,7 @@ is_prover=False, is_relay=False, staked_amount=0.0, # type: Tokens - ) + ), ] @@ -56,8 +56,7 @@ for i in range(N_INITIAL_AGENTS) ] -INITIAL_AGENTS_DICT: dict[AgentUUID, Agent] = { - a.uuid: a for a in INITIAL_AGENTS} +INITIAL_AGENTS_DICT: dict[AgentUUID, Agent] = {a.uuid: a for a in INITIAL_AGENTS} AGENTS_DICT = {**BASE_AGENTS_DICT, **INITIAL_AGENTS_DICT} @@ -102,7 +101,7 @@ token_supply=INITIAL_SUPPLY, ) -INITIAL_STATE['token_supply'] = TokenSupply.from_state(INITIAL_STATE) +INITIAL_STATE["token_supply"] = TokenSupply.from_state(INITIAL_STATE) ############################################################# ## Begin: Steady state gas estimators defined ## @@ -170,8 +169,8 @@ def steady_state_blob_gas_estimate(state: AztecModelState): single_shock_gas_fee_l1_time_series[-final_time:] = steady_gas_fee_l1_time_series[ -final_time: ].copy() -single_shock_gas_fee_l1_time_series[initial_time: TIMESTEPS - final_time] = ( - steady_gas_fee_l1_time_series[initial_time: TIMESTEPS - final_time].copy() +single_shock_gas_fee_l1_time_series[initial_time : TIMESTEPS - final_time] = ( + steady_gas_fee_l1_time_series[initial_time : TIMESTEPS - final_time].copy() + L1_SHOCK_AMOUNT ) @@ -181,9 +180,8 @@ def steady_state_blob_gas_estimate(state: AztecModelState): single_shock_gas_fee_blob_time_series[-final_time:] = steady_gas_fee_blob_time_series[ -final_time: ].copy() -single_shock_gas_fee_blob_time_series[initial_time: TIMESTEPS - final_time] = ( - steady_gas_fee_blob_time_series[initial_time: TIMESTEPS - - final_time].copy() +single_shock_gas_fee_blob_time_series[initial_time : TIMESTEPS - final_time] = ( + steady_gas_fee_blob_time_series[initial_time : TIMESTEPS - final_time].copy() + L1_SHOCK_AMOUNT ) @@ -216,8 +214,8 @@ def steady_state_blob_gas_estimate(state: AztecModelState): intermit_shock_gas_fee_l1_time_series[-final_time:] = steady_gas_fee_l1_time_series[ -final_time: ].copy() -intermit_shock_gas_fee_l1_time_series[initial_time: TIMESTEPS - final_time] = ( - steady_gas_fee_l1_time_series[initial_time: TIMESTEPS - final_time].copy() +intermit_shock_gas_fee_l1_time_series[initial_time : TIMESTEPS - final_time] = ( + steady_gas_fee_l1_time_series[initial_time : TIMESTEPS - final_time].copy() + L1_INTER_SHOCK_SIGNAL ) @@ -251,7 +249,7 @@ def steady_state_blob_gas_estimate(state: AztecModelState): commitment_bond=lambda _: 100_000, # type: ignore content_reveal=lambda _: 81_000, # type: ignore content_reveal_blob=lambda _: 500_000, # type: ignore - rollup_proof=lambda _: 700_000 # type: ignore + rollup_proof=lambda _: 700_000, # type: ignore ) @@ -276,7 +274,6 @@ def steady_state_blob_gas_estimate(state: AztecModelState): phase_duration_rollup_max_blocks=30, # Assumption phase_duration_race_min_blocks=0, # Assumption phase_duration_race_max_blocks=30, # Assumption - stake_activation_period=40, # Assumption: Currently not impactful unstake_cooldown_period=40, # Assumption: Currently not impactful # Behavioral Parameters @@ -284,10 +281,8 @@ def steady_state_blob_gas_estimate(state: AztecModelState): gas_threshold_for_tx=250, # Assumption: We want to set a censorship level for gas prices (which we could create a timeseries with too) blob_gas_threshold_for_tx=250, # Assumption: We want to set a censorship level for blob gas prices (which we could create a timeseries with too) proving_marketplace_usage_probability=0.7, # Assumption: Global Probability, could instantiate agents with [0, 1] - rewards_to_provers=0.3, # Assumption: Reward Share rewards_to_relay=0.01, # Assumption: Reward Share - gwei_to_tokens=1e-9, gas_estimators=DEFAULT_DETERMINISTIC_GAS_ESTIMATOR, tx_estimators=DEFAULT_DETERMINISTIC_TX_ESTIMATOR, @@ -296,9 +291,14 @@ def steady_state_blob_gas_estimate(state: AztecModelState): gas_fee_blob_time_series=GAS_FEE_BLOB_TIME_SERIES_LIST[-1], commit_bond_amount=16.0, # type: Tokens op_cost_sequencer=0, # Assumption: Currently all Sequencers have one op_cost constant to evaluate against - op_cost_prover=0, # Assumption: Currently all Provers have one op_cost constant to evaluate against - safety_factor_commit_bond = 0.0, - safety_factor_reveal_content = 0.0, - safety_factor_rollup_proof = 0.0, - past_gas_weight_fraction = 0.9 + op_cost_prover=0, # Assumption: Currently all Provers have one op_cost constant to evaluate against + safety_factor_commit_bond=0.0, + safety_factor_reveal_content=0.0, + safety_factor_rollup_proof=0.0, + past_gas_weight_fraction=0.9, + fp_commit_bond_reveal="Bernoulli", # Functional parameterizations + fp_proving_market_used="Bernoulli", + fp_potential_proposer="Bernoulli", + fp_reveal_block_content="Bernoulli", + fp_reveal_rollup_proof="Bernoulli", ) diff --git a/notebooks/custom_run.ipynb b/notebooks/custom_run.ipynb index 70447c1..787103e 100644 --- a/notebooks/custom_run.ipynb +++ b/notebooks/custom_run.ipynb @@ -104,15 +104,19 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Initializing configurations: 100%|███████████████| 6/6 [00:00<00:00, 168.62it/s]\n", - "Flattening results: 100%|████████████████████████| 6/6 [00:00<00:00, 201.83it/s]\n" + "/Users/seanmcowen/opt/anaconda3/envs/Aztec/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning:\n", + "\n", + "IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", + "\n", + "Initializing configurations: 100%|███████████████| 1/1 [00:00<00:00, 103.35it/s]\n", + "Flattening results: 0%| | 1/1008 [00:00<00:06, 158.16it/s]\n" ] } ], @@ -123,13 +127,13 @@ "\n", "# Params_to_modify consists of a dictionary with certain parameter choices. They can be changed for each run through the following argument. \n", "params_to_modify = {'gas_threshold_for_tx': [200], 'blob_gas_threshold_for_tx': [210], 'daily_block_reward': [\n", - " 32], 'final_probability': [0.95], 'commit_bond_amount': [3], \"phase_duration_proposal_max_blocks\": [1, 10, 5]}\n", + " 32], 'final_probability': [0.95], 'commit_bond_amount': [3]}\n", "\n", "# N_timesteps lets us vary the simulation timesteps we want to run\n", "N_timesteps = 1000\n", "\n", "# N_samples defines the number of simulation runs we want\n", - "N_samples = 2\n", + "N_samples = 1\n", "\n", "#sim_df saves the run to a dataframe, from which we can plot any state measurements or metrics\n", "sim_df = custom_run(N_timesteps=N_timesteps,\n", @@ -145,9 +149,7 @@ "data": { "text/plain": [ "phase_duration_proposal_max_blocks\n", - "1 2002\n", - "10 2002\n", - "5 2002\n", + "10 1001\n", "Name: count, dtype: int64" ] },