Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add decision for selecting provers or self proving #64

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions aztec_gddt/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from typing import Callable
from uuid import uuid4

from random import choice

from cadCAD_tools.types import VariableUpdate # type: ignore

from aztec_gddt.helper import *
Expand Down Expand Up @@ -275,8 +277,15 @@ def p_commit_bond(params: AztecModelParams,
gas: Gas = params['gas_estimators'].commitment_bond(state)
fee = gas * state['gas_fee_l1']
proposal_uuid = updated_process.tx_winning_proposal
prover = None # TODO: maybe assume any at random from interacting users?
bond_amount = 0.0 # TODO: open question

if bernoulli_trial(params['proving_marketplace_usage_probability']) is True:
provers: list[AgentUUID] = [a_id for (a_id, a) in state['agents'].items() if a.is_prover]
# TODO: what about relays?
prover: AgentUUID = choice(provers)
bond_amount = 0.0 # TODO: open question
else:
prover = updated_process.leading_sequencer
bond_amount = 0.0 # TODO: open question

tx = CommitmentBond(who=updated_process.leading_sequencer,
when=state['time_l1'],
Expand Down
1 change: 1 addition & 0 deletions aztec_gddt/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
tx_proof_reveal_probability=0.15, # tx_proofs do not have to be revealed in v1
rollup_proof_reveal_probability=0.1,
commit_bond_reveal_probability=0.4,
proving_marketplace_usage_probability=0.5,



Expand Down
2 changes: 2 additions & 0 deletions aztec_gddt/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ class AztecModelParams(TypedDict):
# XXX If noone commits to put up a bond for Proving, sequencer loses their privilege and we enter race mode
commit_bond_reveal_probability: Probability

proving_marketplace_usage_probability: Probability


rewards_to_provers: Percentage
rewards_to_relay: Percentage
Expand Down