Split the parametric protocol constants.
The parametric constants record (moved to Constants_parametric_repr
in !4798 (merged)) is huge. It'd be nice to split it into several sections like tx_rollup
or sc_rollup
. This would have several advantages:
- Smaller records would be more cohesive; functions operating on them wouldn't have to care about large numbers of fields they don't use;
- Record fields would have shorter names making them easier to use.
The following discussion from !4798 (merged) should be addressed:
-
@sventimir started a discussion: (+1 comment) This record is huge. I would definitely consider splitting it into sections, for instance:
type sc_rollup = { sc_rollup_origination_size : int; sc_rollup_challenge_window_in_blocks : int; } type tx_rollup = { tx_rollup_enable : bool; tx_rollup_origination_size : int; tx_rollup_hard_size_limit_per_inbox : int; tx_rollup_hard_size_limit_per_message : int; tx_rollup_max_withdrawals_per_batch : int; tx_rollup_commitment_bond : Tez_repr.t; tx_rollup_finality_period : int; tx_rollup_withdraw_period : int; tx_rollup_max_inboxes_count : int; tx_rollup_max_messages_per_inbox : int; tx_rollup_max_commitments_count : int; tx_rollup_cost_per_byte_ema_factor : int; tx_rollup_max_ticket_payload_size : int; tx_rollup_rejection_max_proof_size : int; } type t = { ... tx_rollup = tx_rollup; sc_rollup = sc_rollup; }
That way when you pass these things into functions, you can pass in a smaller record that is actually needed. This can also help make field names shorter. Finally, when a section does not change between the protocols, you can share the record type and perhaps even copy the whole record along without upodating.
I think it's fine to make it a follow-up too.