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

Remove the delegate from the burrow representation #238

Merged
merged 2 commits into from
Aug 16, 2021

Conversation

gkaracha
Copy link
Contributor

Since set_burrow_delegate merely propagates requests to change the delegate to the burrow contract. On top of reducing byte counts and gas costs, I expect this change to reduce storage representation differences between FA2/tez collateral (that is, w.r.t. #213).

@gkaracha gkaracha requested review from utdemir and dorranh August 16, 2021 12:56
@gkaracha
Copy link
Contributor Author

The bot is acting up again so we cannot see the differences in byte counts and gas costs but I'm pretty sure they both drop.

Copy link
Contributor

@dorranh dorranh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It's nice to be able to remove some extra state which we weren't using anymore.

@gkaracha
Copy link
Contributor Author

Pasting here the stat difference myself, just for completeness.

$ diff stats-master/entrypoint-sizes.json stats-238/entrypoint-sizes.json
<   "activate_burrow": 1292,
>   "activate_burrow": 1274,
<   "burn_kit": 1561,
>   "burn_kit": 1527,
<   "cancel_liquidation_slice": 12177,
>   "cancel_liquidation_slice": 12157,
<   "create_burrow": 1097,
>   "create_burrow": 1079,
<   "deactivate_burrow": 1603,
>   "deactivate_burrow": 1581,
<   "deposit_collateral": 1163,
>   "deposit_collateral": 1145,
<   "mark_for_liquidation": 17093,
>   "mark_for_liquidation": 17061,
<   "mint_kit": 1588,
>   "mint_kit": 1550,
<   "set_burrow_delegate": 1059,
>   "set_burrow_delegate": 490,
<   "touch": 56614,
>   "touch": 56574, 
<   "touch_burrow": 660,
>   "touch_burrow": 642,
<   "touch_liquidation_slices": 14508,
>   "touch_liquidation_slices": 14474,
<   "withdraw_collateral": 1488
>   "withdraw_collateral": 1468
$ diff stats-master/gas-costs.json stats-238/gas-costs.json
<     "touch": 538767,
>     "touch": 537238,
<     "remove_liquidity": 73903,
>     "remove_liquidity": 73590,
<     "add_liquidity": 73651,
>     "add_liquidity": 73337,
<     "buy_kit": 69637,
>     "buy_kit": 69323,
<     "sell_kit": 68764,
>     "sell_kit": 68450,
<     "deactivate_burrow": 59288,
>     "deactivate_burrow": 58783,
<     "withdraw_collateral": 58284,
>     "withdraw_collateral": 57802,
<     "set_burrow_delegate": 54691,
>     "set_burrow_delegate": 49911,
<     "activate_burrow": 54542,
>     "activate_burrow": 54073,
<     "deposit_collateral": 53735,
>     "deposit_collateral": 53270,
<     "mint_kit": 51869,
>     "mint_kit": 51241,
<     "burn_kit": 51613,
>     "burn_kit": 51014,
<     "create_burrow": 48918,
>     "create_burrow": 48469,
<     "touch_burrow": 44409,
>     "touch_burrow": 43897,
<     "update_operators": 41672,
>     "update_operators": 41363,
<     "transfer": 39928
>     "transfer": 39622
$ diff stats-master/test-coverage.json stats-238/test-coverage.json
<   "TOTAL": 93.96,
>   "TOTAL": 93.94,
<   "burrow.ml": 96.26,
>   "burrow.ml": 96.21,
<   "checker.ml": 90.08,
>   "checker.ml": 90.04,

@gkaracha
Copy link
Contributor Author

LGTM! It's nice to be able to remove some extra state which we weren't using anymore.

Yeah, the less code the better! 😄

@gkaracha gkaracha merged commit f8604c1 into master Aug 16, 2021
@gkaracha gkaracha deleted the gkaracha/remove-delegate branch August 16, 2021 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants