AIP-208: Reflecting on AIP161 Feedback and Revising Proposed Reward

Proposal Name: Reward request for staking contract gas optimizations contribution

Proposal Category: Aip, Voting, Treasury

Abstract

  • The gas optimization contribution that has taken place continues to serve and save users a significant amount of funds for gas fees on a daily basis, so far as of 4th February, it has saved 80+ETH (which is 5.5% of the 3 years staking period) and expected to save a total of 1450ETH+ in the total 3 years staking period, please refer to the Dune dashboard.
  • This proposal aims to review the proposed reward for AIP 161 , the feedback from the community was eye opening and insightful to shape the current proposal.
  • In summary, back when the staking contract was being audited through AIP34, I found multiple gas optimizations findings, which were shared with Immunefi and classified as out of scope, since they are only concerned about security findings. thereafter, due to the time scarcity to form an AIP and wait for it to pass to implement the gas optimizations and the mainnet launch was in the following 2-3 weeks. I decided to get it implemented by reaching out to Horizen Labs. which they were happy about the findings and implemented the findings at the last moments.
  • This proposal will set an example and a motivation for open source contributors to contribute to the DAO and obey by one of the main DAO’s guiding values:
    “Collective Responsibility: We leave everything better than we found it.”

Author Description

  • Codeislight is a smart contract developer and a warden at Code4Arena. I joined the web3 space in 2021 and have always been intrigued by complex decentralized systems and eager to learn, grow, and contribute in the field.
  • Lately, I have started to make open-source contributions and had the opportunity to come across the ApeCoin staking contract and contributed to make it much more optimized.

Motivation

  • The contribution that has been done has the best interest of the community at heart, and it is significantly saving on the cost to use the staking contract.
  • Rewarding open source contribution that benefits the DAO community, attracts and incentivize others to add value to ApeCoin and result in a net positive for the DAO.
  • Gas optimizations is an overall underestimated part of smart contracts, since it doesn’t impact the functionality or the security. The end user is the one that pays the price in extra unnecessary fees.

Rationale

  • A recap from last proposal, I had profiled the gas saving difference percentage between the unoptimized and optimized staking contract, it resulted in the following metrics:
    gas-profiling
  • The percentages were used in a dune dashboard to calculate:
    • the saved amount of fees so far.
    • the expected to be saved in 3 years based on the saved amount so far.
  • Based on the dune dashboard as of 4th February 2023:
    • it has already saved 80+ ETH in gas fees.
    • expected to save 1,450+ ETH in the total staking period of 3 years.
  • Reflecting on AIP 161 feedbacks, the community overall feels that:
    • The requested reward is excessive, that’s where this proposal will reduce the reward and explicitly specify the amount in the DAO’s native token $APE.
    • Others feels that it’s Horizen Labs responsibility to compensate and not the DAO, I have reached out to Dean - Horizen Labs CEO for comment. He responded with the following “You asked me to fwd your code along to our engineers. I did that. I have made no commitment beyond that.”, so they are considering that they were just a platform to aggregate the open source contribution and not willing to offer any compensation. Instead, I should propose it to the DAO.
  • The contribution goals have proved a full alignment with the DAO’s guiding values:
    • Boldness: We don’t shy away from the weird, the hard, or the new.
    • Equality: One APE equals one APE.
    • Transparency: Processes and decisions are shared openly with the community.
    • Collective Responsibility: We leave everything better than we found it.
    • Persistence: Success is an ouroboros, not a straight line.
  • So far the impact that it has made on saving users funds was great to observe, either way this proposal go, i am grateful for the opportunity to experience how is like to contribute to a DAO and very glad to meet many awesome and kind-hearted members that were very supportive from the early phase, when I had a hard time to reach out to Horizen Labs to share my findings.

Specifications

  • In gas profiling, hardhat-gas-reporter was used along with Hardhat unit testing setup to offer the right environment to profile the gas differences and reduction percentages on every function that the end users can use to deposit, claim and withdraw on all the 4 pools.
  • Dune platform was used to quantify the gas saved based on the percentages from the gas profiling table. It made it easy to determine based on the LIVE data on-chain the saved gas fees on each function separately and calculate the expected funds to be saved in 3 years.

Steps to Implement

  • Once this proposal pass, a 6000 APE$ can be rewarded to codeislight.eth

Timeline

  • NONE

Overall Cost

  • 6000 APE$
6 Likes

I’m sorry your first vote didn’t pass, it’s very discouraging but I am glad to see you come back with a revised proposal. :heart:

6 Likes

I second @Amplify here, it’s regrettable that people didn’t appreciate your prior ask. I’ll be supporting you once again this time around, hopefully your revised proposal will be met with a warmer reception than the last.

5 Likes

Thank you for the kind support :heart:, unfortunately, didn’t get the chance to hear those feedbacks early on in the forum. I could have made the changes back then. but it was a great experience after all :white_heart:

3 Likes

Thank you Chris, I couldn’t have done it without you, you were the one who brought Horizen Labs attention to the gas optimizations back then. I extremely appreciate the kind-hearted support :heart:

2 Likes

I will always support the audits and implementation. tell me more about what is the staking for, tell me exactly for what the contacts will use this staked money if it will.

2 Likes

The proposal is a review of the reward proposed on AIP161 for the gas optimizations contribution to the ApeCoin staking contract which made it more efficient and saved users on extra gas fees. For live data, you may refer to the Dune dashboard.

2 Likes

Hello @codeislight

Just a gentle reminder here that the seven-day window of community discussion is soon closing. Are you satisfied with the amount of discussion? If so, we will move forward to Draft Preparation. If not, would you like to extend the discussion period by another seven days?

Will be awaiting your response.

Best,
-mallard

4 Likes

This topic was automatically closed after 7 days. New replies are no longer allowed.

Thank you @codeislight for your ideas and the ApeCoin DAO community for the thoughtful discussions]. A moderator will get in touch with the author to draft the AIP in the appropriate template. Once the AIP is drafted and meets all the DAO-approved guidelines, the proposal will be posted on Snapshot for live official voting at: Snapshot

Follow this Topic as further updates will be posted here in the comments. @codeislight please see your messages for the next steps.

-Pearson

2 Likes

Hi ApeCoin DAO Community,

Our team has reviewed and discussed @codeislight’s AIP Draft and have sent a list of initial questions. We await answers.

Follow this Topic as further updates will be posted here in the comments.

Kind Regards,

-Pearson

1 Like

Hi ApeCoin DAO Community,

@codeislight has responded to our questions and they are in our review once again.

Follow this Topic as further updates will be posted here in the comments.

Kind Regards,

-Pearson

4 Likes

Hi ApeCoin DAO Community,

We have no further questions for @codeislight. This AIP is now under Administrative Review.

Follow this Topic as further updates will be posted here in the comments.

Kind Regards,

-Vulkan

2 Likes

Fully supportive of optimizing the staking contract. Also @codeislight you seem to be exactly the type of community member we need & want in the community. I hope your successful this time around!

2 Likes

Thank you @Hangout , it’s great how much ETH it has saved since then, i am grateful for the opportunity however it goes. Nonetheless, it made a big impact, that’s what matters the most :heart:

3 Likes

Hi ApeCoin DAO Community,

After review, this Topic submitted by @codeislight is ready for vote under AIP-208. The proposal will be posted on Snapshot at the next weekly release date and time, which is every Thursday at 9PM EST.

Kind Regards,

Vulkan

1 Like

This proposal is live for Snapshot vote here. The voting period closes next Wednesday at 9PM EST.

The AIP implementation is administered by the Ape Foundation. Implementation may be immaterially or materially altered to optimize for security, usability, to protect APE holders, and otherwise to effect the intent of the AIP. Any material deviations from an AIP, as initially approved, will be disclosed to the APE holder community.

1 Like

Hi ApeCoin DAO Community,

The voting period has closed for this proposal and it has been accepted with a 65.87% pass rate. The proposal will be passed on for implementation.

@Lost.Admin

1 Like

Hello everyone,

This proposal has been fully implemented.

Thank you @codeislight for the idea, and to the community for voicing their thoughts and voting!

Follow this proposal under the AIP Transparency and Execution Category. A new post has been created here, Implementation Update | AIP-208: Reflecting on AIP161 Feedback and Revising Proposed Reward, and further updates will be posted.

-Vulkan

4 Likes