Tx rollup: update gas model for `Tx_rollup_commitment_repr.Full.compact`
Context
We add a snoop benchmark for Tx_rollup_commitment_repr.Full.compact. We add a logarithmic cost model for this benchmark. The results of running the bench on the reference machine and inferring the parameters of the cost model are attached:
Using this model, we update the earlier conservative upper-bound used
in consume_compact_commitment_cost.
Discussion
The cost model inferred from the benches is, in milligas:
cost(compact(messages)) = 811 * |messages|
(where 811 is conservatively rounded up from the inferred 810.46).
The previous, conservative over-approximation was:
cost(add_message(messages, message)) = cost(hashing(32 bytes)) + 2 * |messages| * cost(hashing(64 bytes))
In other words, the previous over-approximation would charge ~ 50000 + 100000 * n
milligas for each message whereas inferred cost model would charge between 1000n
milligas.
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Arvid Jakobsson
