tezos-checker / checker

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

Switch to FA2 for collateral, exclusively #269

Closed gkaracha closed 3 years ago

gkaracha commented 3 years ago

First part of #213: integration of the tez wrapper into checker's workflow (for details see section "Changes for Checker" in https://github.com/tezos-checker/checker/issues/213#issuecomment-919838046). In essence this PR makes checker deal with FA2 exclusively. To keep CI green, usage of the tez wrapper is hardwired; adding the switch to be able to change the collateral type should be part of a separate PR. This PR is already pretty big.

Other changes:

TezWrapper.transfer is still pretty expensive which makes Checker's entrypoints expensive too. This we can improve incrementally after merging this PR.

github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 6d0d4a29a4ba1d16fb3a97b685d5f0ebd5b526b0 Diff
checker%create_burrow 6915 22048 15133
checker%set_burrow_delegate 9836 22663 12827
checker%deactivate_burrow 11279 23142 11863
checker%withdraw_collateral 11133 22783 11650
checker%deposit_collateral 8901 19749 10848
checker%activate_burrow 8921 19565 10644
checker%touch 30471 30618 147
checker%mint_kit 6926 7005 79
checker%burn_kit 7154 7232 78
checker%remove_liquidity 12584 12662 78
checker%sell_kit 11734 11812 78
checker%buy_kit 12502 12580 78
checker%add_liquidity 12654 12732 78
checker%transfer 6131 6207 76
checker%touch_burrow 5922 5998 76
checker%update_operators 5410 5486 76
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 6d0d4a29a4ba1d16fb3a97b685d5f0ebd5b526b0 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
buy_kit 1350 1352 2
sell_kit 1346 1348 2
add_liquidity 1833 1835 2
remove_liquidity 1953 1955 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 6d0d4a29a4ba1d16fb3a97b685d5f0ebd5b526b0 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 807a180889e79f025073e37c65361ecd23a26fc6 Diff
checker%create_burrow 6915 22029 15114
checker%set_burrow_delegate 9836 22625 12789
checker%deactivate_burrow 11279 23123 11844
checker%withdraw_collateral 11133 22764 11631
checker%deposit_collateral 8901 19731 10830
checker%activate_burrow 8921 19546 10625
checker%touch 30471 30618 147
checker%mint_kit 6926 7005 79
checker%burn_kit 7154 7232 78
checker%add_liquidity 12654 12732 78
checker%buy_kit 12502 12580 78
checker%remove_liquidity 12584 12662 78
checker%sell_kit 11734 11812 78
checker%update_operators 5410 5486 76
checker%touch_burrow 5922 5998 76
checker%transfer 6131 6207 76
tezWrapper%deposit 13490 13459 -31
tezWrapper%set_delegate 12880 12849 -31
tezWrapper%withdraw 14410 14379 -31
tezWrapper%transfer 12609 12595 -14
tezWrapper%update_operators 4053 4040 -13
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 807a180889e79f025073e37c65361ecd23a26fc6 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
sell_kit 1346 1348 2
buy_kit 1350 1352 2
remove_liquidity 1953 1955 2
add_liquidity 1833 1835 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 807a180889e79f025073e37c65361ecd23a26fc6 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 81327d21873e158893522f73f995fcf72d9a00fd Diff
checker%create_burrow 6915 22029 15114
checker%set_burrow_delegate 9836 22625 12789
checker%deactivate_burrow 11279 23123 11844
checker%withdraw_collateral 11133 22764 11631
checker%deposit_collateral 8901 19731 10830
checker%activate_burrow 8921 19546 10625
checker%touch 30471 30618 147
checker%mint_kit 6926 7005 79
checker%buy_kit 12502 12580 78
checker%sell_kit 11734 11812 78
checker%burn_kit 7154 7232 78
checker%remove_liquidity 12584 12662 78
checker%add_liquidity 12654 12732 78
checker%update_operators 5410 5486 76
checker%transfer 6131 6207 76
checker%touch_burrow 5922 5998 76
tezWrapper%deposit 13490 13459 -31
tezWrapper%set_delegate 12880 12849 -31
tezWrapper%withdraw 14410 14379 -31
tezWrapper%transfer 12609 12595 -14
tezWrapper%update_operators 4053 4040 -13
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 81327d21873e158893522f73f995fcf72d9a00fd Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
remove_liquidity 1953 1955 2
add_liquidity 1833 1835 2
sell_kit 1346 1348 2
buy_kit 1350 1352 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 81327d21873e158893522f73f995fcf72d9a00fd Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 91f5b2a7d8b21a1602c4909ebcafe775a4109948 Diff
checker%create_burrow 6915 22004 15089
checker%set_burrow_delegate 9836 22575 12739
checker%deactivate_burrow 11279 23097 11818
checker%withdraw_collateral 11133 22738 11605
checker%deposit_collateral 8901 19704 10803
checker%activate_burrow 8921 19520 10599
checker%touch 30471 30618 147
tezWrapper%set_delegate 12880 12798 -82
tezWrapper%deposit 13490 13408 -82
tezWrapper%withdraw 14410 14328 -82
checker%mint_kit 6926 7005 79
checker%remove_liquidity 12584 12663 79
checker%add_liquidity 12654 12733 79
checker%sell_kit 11734 11812 78
checker%buy_kit 12502 12580 78
checker%burn_kit 7154 7232 78
checker%touch_burrow 5922 5998 76
checker%update_operators 5410 5486 76
checker%transfer 6131 6207 76
tezWrapper%update_operators 4053 4015 -38
tezWrapper%transfer 12609 12571 -38
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 91f5b2a7d8b21a1602c4909ebcafe775a4109948 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
buy_kit 1350 1352 2
add_liquidity 1833 1835 2
sell_kit 1346 1348 2
remove_liquidity 1953 1955 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 91f5b2a7d8b21a1602c4909ebcafe775a4109948 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 87664878f5c48a6eff796e76d85841d4d3c3b897 Diff
checker%create_burrow 6915 22003 15088
checker%deactivate_burrow 11279 23097 11818
checker%withdraw_collateral 11133 22738 11605
checker%deposit_collateral 8901 19704 10803
checker%activate_burrow 8921 19520 10599
checker%set_burrow_delegate 9836 18029 8193
tezWrapper%withdraw 14410 9717 -4693
tezWrapper%set_delegate 12880 8251 -4629
checker%touch 30471 30618 147
tezWrapper%deposit 13490 13406 -84
checker%mint_kit 6926 7005 79
checker%buy_kit 12502 12580 78
checker%add_liquidity 12654 12732 78
checker%burn_kit 7154 7232 78
checker%sell_kit 11734 11812 78
checker%remove_liquidity 12584 12662 78
checker%transfer 6131 6207 76
checker%touch_burrow 5922 5998 76
checker%update_operators 5410 5486 76
tezWrapper%transfer 12609 12568 -41
tezWrapper%update_operators 4053 4013 -40
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 87664878f5c48a6eff796e76d85841d4d3c3b897 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
add_liquidity 1833 1835 2
sell_kit 1346 1348 2
remove_liquidity 1953 1955 2
buy_kit 1350 1352 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 87664878f5c48a6eff796e76d85841d4d3c3b897 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 4dfd3360e9d506a6eae94239140a12e23fda39f4 Diff
checker%create_burrow 6915 21987 15072
checker%deactivate_burrow 11279 23081 11802
checker%withdraw_collateral 11133 22722 11589
checker%deposit_collateral 8901 19688 10787
checker%activate_burrow 8921 19504 10583
checker%set_burrow_delegate 9836 18013 8177
tezWrapper%withdraw 14410 9703 -4707
tezWrapper%set_delegate 12880 8237 -4643
checker%touch 30471 30618 147
tezWrapper%deposit 13490 13376 -114
checker%mint_kit 6926 7005 79
checker%sell_kit 11734 11812 78
checker%burn_kit 7154 7232 78
checker%buy_kit 12502 12580 78
checker%add_liquidity 12654 12732 78
checker%remove_liquidity 12584 12662 78
checker%touch_burrow 5922 5998 76
checker%transfer 6131 6207 76
checker%update_operators 5410 5486 76
tezWrapper%transfer 12609 12554 -55
tezWrapper%update_operators 4053 3999 -54
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 4dfd3360e9d506a6eae94239140a12e23fda39f4 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
add_liquidity 1833 1835 2
buy_kit 1350 1352 2
remove_liquidity 1953 1955 2
sell_kit 1346 1348 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 4dfd3360e9d506a6eae94239140a12e23fda39f4 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.07 0.19999999999998863
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 65840ff00aec5e98ccdc8e0a6fa871e6ea1a7cdf Diff
checker%create_burrow 6915 26646 19731
checker%deactivate_burrow 11279 27740 16461
checker%withdraw_collateral 11133 27381 16248
checker%deposit_collateral 8901 24347 15446
checker%activate_burrow 8921 24163 15242
checker%set_burrow_delegate 9836 18046 8210
tezWrapper%deposit 13490 7342 -6148
tezWrapper%withdraw 14410 9727 -4683
tezWrapper%set_delegate 12880 8262 -4618
tezWrapper%transfer 12609 17204 4595
checker%touch 30471 30618 147
checker%mint_kit 6926 7005 79
checker%burn_kit 7154 7232 78
checker%remove_liquidity 12584 12662 78
checker%buy_kit 12502 12580 78
checker%sell_kit 11734 11812 78
checker%add_liquidity 12654 12732 78
checker%update_operators 5410 5486 76
checker%touch_burrow 5922 5998 76
checker%transfer 6131 6207 76
tezWrapper%update_operators 4053 4023 -30
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 65840ff00aec5e98ccdc8e0a6fa871e6ea1a7cdf Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
remove_liquidity 1953 1955 2
add_liquidity 1833 1835 2
buy_kit 1350 1352 2
sell_kit 1346 1348 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 65840ff00aec5e98ccdc8e0a6fa871e6ea1a7cdf Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.08 0.20999999999999375
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 62318bddda58fe4125aaa42b10cc102ccaa6cfd5 Diff
checker%create_burrow 6915 22060 15145
checker%deactivate_burrow 11279 23153 11874
checker%withdraw_collateral 11133 22794 11661
checker%deposit_collateral 8901 19760 10859
checker%activate_burrow 8921 19576 10655
checker%set_burrow_delegate 9836 18085 8249
tezWrapper%deposit 13490 7373 -6117
tezWrapper%withdraw 14410 9758 -4652
tezWrapper%set_delegate 12880 8293 -4587
checker%touch 30471 30618 147
checker%mint_kit 6926 7005 79
checker%sell_kit 11734 11812 78
checker%burn_kit 7154 7232 78
checker%add_liquidity 12654 12732 78
checker%remove_liquidity 12584 12662 78
checker%buy_kit 12502 12580 78
checker%transfer 6131 6207 76
checker%update_operators 5410 5486 76
checker%touch_burrow 5922 5998 76
tezWrapper%transfer 12609 12610 1
tezWrapper%update_operators 4053 4054 1
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 62318bddda58fe4125aaa42b10cc102ccaa6cfd5 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
remove_liquidity 1953 1955 2
sell_kit 1346 1348 2
add_liquidity 1833 1835 2
buy_kit 1350 1352 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 62318bddda58fe4125aaa42b10cc102ccaa6cfd5 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.08 0.20999999999999375
github-actions[bot] commented 3 years ago
Gas costs a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 0d1e056932659dcf0f3318174d206728e35d7a04 Diff
checker%create_burrow 6915 22059 15144
checker%deactivate_burrow 11279 23153 11874
checker%withdraw_collateral 11133 22794 11661
checker%deposit_collateral 8901 19760 10859
checker%activate_burrow 8921 19575 10654
checker%set_burrow_delegate 9836 18084 8248
tezWrapper%deposit 13490 7373 -6117
tezWrapper%withdraw 14410 9758 -4652
tezWrapper%set_delegate 12880 8293 -4587
checker%touch 30471 30618 147
checker%burn_kit 7154 7232 78
checker%mint_kit 6926 7004 78
checker%add_liquidity 12654 12732 78
checker%sell_kit 11734 11812 78
checker%remove_liquidity 12584 12662 78
checker%buy_kit 12502 12579 77
checker%touch_burrow 5922 5997 75
checker%update_operators 5410 5485 75
checker%transfer 6131 6206 75
tezWrapper%transfer 12609 12610 1
tezWrapper%update_operators 4053 4054 1
Entrypoint sizes a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 0d1e056932659dcf0f3318174d206728e35d7a04 Diff
withdraw_collateral 1478 1329 -149
create_burrow 1079 1223 144
receive_slice_from_burrow 119 None -119
deactivate_burrow 1605 1496 -109
touch 56661 56559 -102
mark_for_liquidation 17093 16992 -101
touch_liquidation_slices 14465 14371 -94
liquidation_auction_claim_win 1084 1129 45
deposit_collateral 1145 1176 31
activate_burrow 1274 1303 29
remove_liquidity 1953 1955 2
buy_kit 1350 1352 2
sell_kit 1346 1348 2
add_liquidity 1833 1835 2
Test coverage a8ffcd683ef7f91af8f06ea0be5f86eb1a53bb6e 0d1e056932659dcf0f3318174d206728e35d7a04 Diff
checker.ml 90.1 91.21 1.1099999999999994
tok.ml 97.3 96.77 -0.5300000000000011
checkerMain.ml 92.86 93.02 0.1599999999999966
common.ml 97.87 97.89 0.01999999999999602
TOTAL 93.87 94.08 0.20999999999999375
gkaracha commented 3 years ago

Nice! I had a look at the latest changes, and they look good to me. We'll definitely need to add more tests once we're done with all of the surgery (as well as look at gas costs like you mentioned), but I'm happy with landing these changes.

Thanks for all of your hard work on this! slightly_smiling_face

Great, I think it's about time we merged this one; it has blocked us long enough! More tests soon sound good :+1: