tezos-checker / checker

An in-development "robocoin" system for the Tezos blockchain
24 stars 16 forks source link

More accurate calculation of the price of kit in tez #280

Closed gkaracha closed 3 years ago

gkaracha commented 3 years ago

This PR addresses #239, for now sidestepping tezos-checker/ctez#30. In order for the changes to work the vendored ctez version is switched to my fork, which currently points to the currently unmerged tezos-checker/ctez#30. Once tezos-checker/ctez#30 is merged, we should change the url of the submodule to https://github.com/tezos-checker/ctez.

github-actions[bot] commented 3 years ago
Gas costs: No change. Entrypoint sizes: No change. Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f a61f9b63bf16dab2c12931dc466a7186cc0e9dfd Diff
price.ml None 100 100
github-actions[bot] commented 3 years ago
Gas costs: No change. Entrypoint sizes: No change. Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f d8c0be44b7edc29ff26299939bf18b53b7f52c44 Diff
price.ml None 100 100
github-actions[bot] commented 3 years ago
Gas costs: No change. Entrypoint sizes: No change. Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f db0d8d3fe82b7131719454f1b4d26f0e77a7ddf3 Diff
price.ml None 100 100
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f bf9884e66ec97becf2cfb1260ce7573f551d2566 Diff
checker%touch 30573 30747 174
checker%mint_kit 6983 7065 82
checker%burn_kit 7211 7292 81
checker%add_liquidity 12711 12792 81
checker%deposit_collateral 19739 19819 80
checker%buy_kit 12559 12639 80
checker%withdraw_collateral 22773 22853 80
checker%activate_burrow 19555 19635 80
checker%remove_liquidity 12641 12721 80
checker%sell_kit 11791 11871 80
checker%deactivate_burrow 23132 23212 80
checker%touch_burrow 5977 6056 79
checker%set_burrow_delegate 18064 18143 79
checker%create_burrow 22039 22118 79
checker%update_operators 5465 5544 79
checker%transfer 6190 6268 78
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f bf9884e66ec97becf2cfb1260ce7573f551d2566 Diff
receive_price 122 124 2
touch 56530 56532 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f bf9884e66ec97becf2cfb1260ce7573f551d2566 Diff
price.ml None 100 100
checker.ml 95.46 94.61 -0.8499999999999943
TOTAL 93.32 93.16 -0.1599999999999966
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 3a55569a0f4fa4396aa28388a8a125a4b1057795 Diff
checker%touch 30573 30821 248
checker%burn_kit 7211 7339 128
checker%mint_kit 6983 7111 128
checker%add_liquidity 12711 12817 106
checker%sell_kit 11791 11895 104
checker%withdraw_collateral 22773 22877 104
checker%activate_burrow 19555 19659 104
checker%remove_liquidity 12641 12745 104
checker%buy_kit 12559 12663 104
checker%deactivate_burrow 23132 23236 104
checker%deposit_collateral 19739 19843 104
checker%create_burrow 22039 22142 103
checker%touch_burrow 5977 6078 101
checker%update_operators 5465 5565 100
checker%set_burrow_delegate 18064 18164 100
checker%transfer 6190 6287 97
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 3a55569a0f4fa4396aa28388a8a125a4b1057795 Diff
burn_kit 1494 1514 20
mint_kit 1517 1537 20
touch 56530 56550 20
touch_liquidation_slices 14338 14350 12
cancel_liquidation_slice 12124 12130 6
mark_for_liquidation 16959 16965 6
withdraw_collateral 1296 1298 2
deactivate_burrow 1463 1465 2
create_burrow 1190 1192 2
touch_burrow 609 611 2
deposit_collateral 1143 1145 2
receive_price 122 120 -2
activate_burrow 1270 1272 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 3a55569a0f4fa4396aa28388a8a125a4b1057795 Diff
price.ml None 100 100
checker.ml 95.46 94.61 -0.8499999999999943
TOTAL 93.32 93.16 -0.1599999999999966
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 5b334dd181d6586dc837c764dbc3ed4be737fc71 Diff
checker%touch 30573 30874 301
checker%mint_kit 6983 7111 128
checker%burn_kit 7211 7339 128
checker%add_liquidity 12711 12817 106
checker%sell_kit 11791 11895 104
checker%withdraw_collateral 22773 22877 104
checker%buy_kit 12559 12663 104
checker%deactivate_burrow 23132 23236 104
checker%deposit_collateral 19739 19843 104
checker%remove_liquidity 12641 12745 104
checker%activate_burrow 19555 19659 104
checker%create_burrow 22039 22142 103
checker%touch_burrow 5977 6078 101
checker%set_burrow_delegate 18064 18164 100
checker%update_operators 5465 5565 100
checker%transfer 6190 6287 97
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 5b334dd181d6586dc837c764dbc3ed4be737fc71 Diff
touch 56530 56618 88
burn_kit 1494 1514 20
mint_kit 1517 1537 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
activate_burrow 1270 1272 2
deposit_collateral 1143 1145 2
withdraw_collateral 1296 1298 2
create_burrow 1190 1192 2
deactivate_burrow 1463 1465 2
receive_price 122 120 -2
touch_burrow 609 611 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 5b334dd181d6586dc837c764dbc3ed4be737fc71 Diff
price.ml None 55.56 55.56
checker.ml 95.46 94.61 -0.8499999999999943
TOTAL 93.32 93.01 -0.30999999999998806
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 63f004d3fd514d6622f214089a7420d5d23b4c06 Diff
checker%touch 30573 30903 330
checker%burn_kit 7211 7351 140
checker%mint_kit 6983 7122 139
checker%add_liquidity 12711 12828 117
checker%remove_liquidity 12641 12757 116
checker%deactivate_burrow 23132 23248 116
checker%deposit_collateral 19739 19855 116
checker%buy_kit 12559 12675 116
checker%activate_burrow 19555 19671 116
checker%withdraw_collateral 22773 22889 116
checker%sell_kit 11791 11907 116
checker%create_burrow 22039 22153 114
checker%touch_burrow 5977 6090 113
checker%update_operators 5465 5577 112
checker%set_burrow_delegate 18064 18175 111
checker%transfer 6190 6299 109
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 63f004d3fd514d6622f214089a7420d5d23b4c06 Diff
receive_ctez_marginal_price None 128 128
touch 56530 56618 88
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
cancel_liquidation_slice 12124 12130 6
mark_for_liquidation 16959 16965 6
withdraw_collateral 1296 1298 2
deactivate_burrow 1463 1465 2
touch_burrow 609 611 2
deposit_collateral 1143 1145 2
activate_burrow 1270 1272 2
create_burrow 1190 1192 2
receive_price 122 120 -2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 63f004d3fd514d6622f214089a7420d5d23b4c06 Diff
price.ml None 55.56 55.56
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 93.97 -1.4899999999999949
TOTAL 93.32 92.77 -0.5499999999999972
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f e820043dd4fcda6e9956fc86014792f298cb718a Diff
checker%touch 30573 30909 336
checker%burn_kit 7211 7353 142
checker%mint_kit 6983 7124 141
checker%add_liquidity 12711 12830 119
checker%withdraw_collateral 22773 22891 118
checker%sell_kit 11791 11909 118
checker%remove_liquidity 12641 12759 118
checker%activate_burrow 19555 19673 118
checker%deposit_collateral 19739 19857 118
checker%buy_kit 12559 12677 118
checker%deactivate_burrow 23132 23250 118
checker%create_burrow 22039 22155 116
checker%touch_burrow 5977 6092 115
checker%update_operators 5465 5579 114
checker%set_burrow_delegate 18064 18177 113
checker%transfer 6190 6301 111
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f e820043dd4fcda6e9956fc86014792f298cb718a Diff
receive_ctez_marginal_price None 136 136
touch 56530 56608 78
burn_kit 1494 1514 20
mint_kit 1517 1537 20
touch_liquidation_slices 14338 14350 12
cancel_liquidation_slice 12124 12130 6
mark_for_liquidation 16959 16965 6
touch_burrow 609 611 2
deposit_collateral 1143 1145 2
create_burrow 1190 1192 2
deactivate_burrow 1463 1465 2
withdraw_collateral 1296 1298 2
receive_price 122 120 -2
activate_burrow 1270 1272 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f e820043dd4fcda6e9956fc86014792f298cb718a Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 93.97 -1.4899999999999949
TOTAL 93.32 92.89 -0.4299999999999926
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 477b1d20b1648b3176d5fd49f8fc39a110bb9b02 Diff
checker%touch 30573 30909 336
checker%burn_kit 7211 7353 142
checker%mint_kit 6983 7124 141
checker%add_liquidity 12711 12830 119
checker%deactivate_burrow 23132 23250 118
checker%remove_liquidity 12641 12759 118
checker%buy_kit 12559 12677 118
checker%activate_burrow 19555 19673 118
checker%withdraw_collateral 22773 22891 118
checker%deposit_collateral 19739 19857 118
checker%sell_kit 11791 11909 118
checker%create_burrow 22039 22155 116
checker%touch_burrow 5977 6092 115
checker%update_operators 5465 5579 114
checker%set_burrow_delegate 18064 18177 113
checker%transfer 6190 6301 111
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 477b1d20b1648b3176d5fd49f8fc39a110bb9b02 Diff
receive_ctez_marginal_price None 136 136
touch 56530 56608 78
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
receive_price 122 120 -2
deactivate_burrow 1463 1465 2
withdraw_collateral 1296 1298 2
create_burrow 1190 1192 2
deposit_collateral 1143 1145 2
touch_burrow 609 611 2
activate_burrow 1270 1272 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 477b1d20b1648b3176d5fd49f8fc39a110bb9b02 Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 93.97 -1.4899999999999949
TOTAL 93.32 92.89 -0.4299999999999926
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 5dac183a5309bef56bee3a7bf51746efd64802a1 Diff
checker%touch 30573 30909 336
checker%burn_kit 7211 7353 142
checker%mint_kit 6983 7124 141
checker%add_liquidity 12711 12830 119
checker%activate_burrow 19555 19673 118
checker%remove_liquidity 12641 12759 118
checker%withdraw_collateral 22773 22891 118
checker%buy_kit 12559 12677 118
checker%deactivate_burrow 23132 23250 118
checker%deposit_collateral 19739 19857 118
checker%sell_kit 11791 11909 118
checker%create_burrow 22039 22155 116
checker%touch_burrow 5977 6092 115
checker%update_operators 5465 5579 114
checker%set_burrow_delegate 18064 18177 113
checker%transfer 6190 6301 111
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 5dac183a5309bef56bee3a7bf51746efd64802a1 Diff
receive_ctez_marginal_price None 136 136
touch 56530 56608 78
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
deposit_collateral 1143 1145 2
receive_price 122 120 -2
activate_burrow 1270 1272 2
touch_burrow 609 611 2
create_burrow 1190 1192 2
deactivate_burrow 1463 1465 2
withdraw_collateral 1296 1298 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 5dac183a5309bef56bee3a7bf51746efd64802a1 Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 93.97 -1.4899999999999949
TOTAL 93.32 92.89 -0.4299999999999926
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 6aff53e3d7fbc1c2c2152bba110e7e8052d491a5 Diff
checker%touch 30573 30929 356
checker%mint_kit 6983 7132 149
checker%burn_kit 7211 7360 149
checker%add_liquidity 12711 12837 126
checker%withdraw_collateral 22773 22898 125
checker%deactivate_burrow 23132 23257 125
checker%buy_kit 12559 12684 125
checker%sell_kit 11791 11916 125
checker%remove_liquidity 12641 12766 125
checker%deposit_collateral 19739 19864 125
checker%activate_burrow 19555 19680 125
checker%create_burrow 22039 22163 124
checker%touch_burrow 5977 6099 122
checker%update_operators 5465 5586 121
checker%set_burrow_delegate 18064 18185 121
checker%transfer 6190 6308 118
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 6aff53e3d7fbc1c2c2152bba110e7e8052d491a5 Diff
receive_ctez_marginal_price None 136 136
touch 56530 56608 78
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
touch_burrow 609 611 2
deactivate_burrow 1463 1465 2
deposit_collateral 1143 1145 2
withdraw_collateral 1296 1298 2
receive_price 122 120 -2
activate_burrow 1270 1272 2
create_burrow 1190 1192 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 6aff53e3d7fbc1c2c2152bba110e7e8052d491a5 Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 94.64 -0.8199999999999932
checkerMain.ml 93.18 93.33 0.14999999999999147
TOTAL 93.32 93.03 -0.28999999999999204
github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 3edd1b077118e089a1a748b238fcecab2f0d0600 Diff
checker%touch 30573 42369 11796
checker%burn_kit 7211 7360 149
checker%mint_kit 6983 7132 149
checker%add_liquidity 12711 12839 128
checker%sell_kit 11791 11917 126
checker%buy_kit 12559 12685 126
checker%remove_liquidity 12641 12767 126
checker%activate_burrow 19555 19680 125
checker%deposit_collateral 19739 19864 125
checker%deactivate_burrow 23132 23257 125
checker%withdraw_collateral 22773 22898 125
checker%create_burrow 22039 22163 124
checker%touch_burrow 5977 6100 123
checker%update_operators 5465 5587 122
checker%set_burrow_delegate 18064 18185 121
checker%transfer 6190 6309 119
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 3edd1b077118e089a1a748b238fcecab2f0d0600 Diff
touch 56530 56749 219
receive_ctez_marginal_price None 136 136
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
receive_price 122 120 -2
create_burrow 1190 1192 2
deactivate_burrow 1463 1465 2
touch_burrow 609 611 2
activate_burrow 1270 1272 2
deposit_collateral 1143 1145 2
withdraw_collateral 1296 1298 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 3edd1b077118e089a1a748b238fcecab2f0d0600 Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 94.29 -1.1699999999999875
checkerMain.ml 93.18 93.33 0.14999999999999147
TOTAL 93.32 92.96 -0.35999999999999943
gkaracha commented 3 years ago

Wow, 3edd1b0 shows that the operation to ctez's cfmm to update the price in our storage costs over 11K gas :confused:

github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 7d9f98569298eb93143a39aecc82186c70b37acd Diff
checker%touch 30573 42370 11797
checker%mint_kit 6983 7132 149
checker%burn_kit 7211 7360 149
checker%add_liquidity 12711 12839 128
checker%sell_kit 11791 11917 126
checker%remove_liquidity 12641 12767 126
checker%buy_kit 12559 12685 126
checker%deposit_collateral 19739 19864 125
checker%activate_burrow 19555 19680 125
checker%withdraw_collateral 22773 22898 125
checker%deactivate_burrow 23132 23257 125
checker%create_burrow 22039 22163 124
checker%touch_burrow 5977 6100 123
checker%update_operators 5465 5587 122
checker%set_burrow_delegate 18064 18185 121
checker%transfer 6190 6309 119
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 7d9f98569298eb93143a39aecc82186c70b37acd Diff
touch 56530 56749 219
receive_ctez_marginal_price None 136 136
burn_kit 1494 1514 20
mint_kit 1517 1537 20
touch_liquidation_slices 14338 14350 12
mark_for_liquidation 16959 16965 6
cancel_liquidation_slice 12124 12130 6
receive_price 122 120 -2
withdraw_collateral 1296 1298 2
activate_burrow 1270 1272 2
touch_burrow 609 611 2
deposit_collateral 1143 1145 2
create_burrow 1190 1192 2
deactivate_burrow 1463 1465 2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 7d9f98569298eb93143a39aecc82186c70b37acd Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 94.29 -1.1699999999999875
checkerMain.ml 93.18 93.33 0.14999999999999147
TOTAL 93.32 92.96 -0.35999999999999943
dorranh commented 3 years ago

Ouch (regarding the extra gas costs). Though I guess we are still significantly under where we were during protocol Florence...

gkaracha commented 3 years ago

Ouch (regarding the extra gas costs). Though I guess we are still significantly under where we were during protocol Florence...

Right?! The sad thing is that most of the cost is probably from deserializing ctez_cfmm and the operation itself; there's not much we can do. I don't remember what the gas limit per operation is for Granada, but at least we are still under it :shrug:

gkaracha commented 3 years ago

@dorranh this should finally be ready for review :slightly_smiling_face: I updated the description of the PR to match the current contents.

github-actions[bot] commented 3 years ago
Gas costs 47e71a7710865da73c7fcbe8c46e7c17df65173f 1db364f0f303da931de5fec25ac6af2716129a6d Diff
checker%touch 30573 42370 11797
checker%burn_kit 7211 7360 149
checker%mint_kit 6983 7132 149
checker%add_liquidity 12711 12839 128
checker%remove_liquidity 12641 12767 126
checker%sell_kit 11791 11917 126
checker%buy_kit 12559 12685 126
checker%withdraw_collateral 22773 22898 125
checker%activate_burrow 19555 19680 125
checker%deposit_collateral 19739 19864 125
checker%deactivate_burrow 23132 23257 125
checker%create_burrow 22039 22163 124
checker%touch_burrow 5977 6100 123
checker%update_operators 5465 5587 122
checker%set_burrow_delegate 18064 18185 121
checker%transfer 6190 6309 119
Entrypoint sizes 47e71a7710865da73c7fcbe8c46e7c17df65173f 1db364f0f303da931de5fec25ac6af2716129a6d Diff
touch 56530 56749 219
receive_ctez_marginal_price None 136 136
mint_kit 1517 1537 20
burn_kit 1494 1514 20
touch_liquidation_slices 14338 14350 12
cancel_liquidation_slice 12124 12130 6
mark_for_liquidation 16959 16965 6
withdraw_collateral 1296 1298 2
deposit_collateral 1143 1145 2
touch_burrow 609 611 2
deactivate_burrow 1463 1465 2
create_burrow 1190 1192 2
activate_burrow 1270 1272 2
receive_price 122 120 -2
Test coverage 47e71a7710865da73c7fcbe8c46e7c17df65173f 1db364f0f303da931de5fec25ac6af2716129a6d Diff
price.ml None 83.33 83.33
checkerEntrypoints.ml 100 97.73 -2.269999999999996
checker.ml 95.46 94.29 -1.1699999999999875
checkerMain.ml 93.18 93.33 0.14999999999999147
TOTAL 93.32 92.96 -0.35999999999999943