Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Links

...

https://github.com/fioprotocol/fips/blob/master/fip-0021.md

...

Table of Contents

Links

...

  • Epic – FIO staking

    • Stories

      • Produce design spec, and revise FIP-21. (1 week Complete)

        • review internal, and community.

      • FIO Staking Development (3 weeks In progress 85% complete)

        • implement the solution as per FIP-21 and detailed development spec.

          • Started work March 29

          • constants implemented

          • staking global state implemented

          • account staking implementation implemented

          • port existing work to new contract fio.staking, completed

            • make shell of the new contract and integrate into the build.

            • integrate all table implementations for staking into fio.staking contract.

            • integrate stake and unstake shell into fio.staking contract.

          • Develop new logic to permit new contracts and system accounts to be added to the FIO protocol without mandatory core upgrades (completed, in QA for Bahamas)

          • implement and test actions to update global state for staking. In progress (100% completed)

            • implement stakefio (completed)

            • implement unstakefio (completed)

            • implement modified locking mechanism to support unstakefio (completed)

            • impelement and test incgrewards

            • implement and test clrdrewards

            • implement and test recorddaily

          • adapt usable balance logic

          • adapt voting power logic

          • transfer

          • transfer using pub key

          • modify fee collection logic

            • process_rewards

            • processbucketrewards

            • processrewardsnotpic

          • bpclaim

            • bpclaim

          • implement the removal of expired periods during lock adaptation on unstaking.

          • implement the use of an existing period if there is a period in this same day during unstaking

          Dev test. (
          • Implement new model for general locks, place SUF amount instead of percent.

            • retire old lock tokens and replace with locktokensv2 table.

            • integrate new table throughout contracts and chain_plugin.

        • Dev test. (30% completed)

          • Regression testing (runs of fio.test) completed

          • dev test cases

            • pre existing main net locks (test all unlocking periods using transfer and vote producer) (manual testing completed)

            • pre existing main net locks (test staking and transfer before and after first unlock period) (javascript fio.test integrated testing completed)

            • no pre-existing locks

            • pre existing general locks

            • use existing main net locked account to create general lock

            • pre existing main net AND general locks

        • develop tests matching test plan in design spec.

        • internal code review

        • internal testing review.

        • perform QA and resolve all issues (comprehensive QA analysis)

        • Acceptance testing review by product owner.

      • FIO staking – Security/Performance testing (dev net) (1 week)

        • develop tests to load system and drive volume of requests (we desire a max stakes test, and also a volume of staking unstaking requests once loaded maximally) performance test plan is still TBD.

      • Rollout testing (dev net) (2 days)

        • load previous version of contracts, perform contract MSIGs, repeat load testing.

      • Test net testing – (1 week)

        • roll out msigs, perform subset of functional tests on test net (tests to be performed are TBD)

      • Main net rollout (2 days)

        • roll out MSIGs, perform minimal success testing to verify deployment (tests to be performed are TBD).

  • security of the new locking actions will require relatively complete QA testing (a test plan will be published).

...

  • Update all SDKs to include new endpoints for staking.

  • FIOSdk_typescript

    • integrate stakefio into SDK (6 hours) (completed)

    • expand tests to cover stakefio in SDK (4 hours)

    • Integrate unstakefio into SDK (6 hours)

    • expand tests to cover unstakefio (4 hours)

    • integrate changes to get_balance (4 hours)

    • integrate get_staked_info into SDK (6 hours)

    • expand tests to cover get_staked_info (4 hours)

  • FIOSdk_Kotlin

    • integrate stakefio into SDK (6 hours)

    • expand tests to cover stakefio in SDK (4 hours)

    • Integrate unstakefio into SDK (6 hours)

    • expand tests to cover unstakefio (4 hours)

    • integrate changes to get_balance (4 hours)

    • integrate get_staked_info into SDK (6 hours)

    • expand tests to cover get_staked_info (4 hours)

  • FIOSdk_IOS

    • integrate stakefio into SDK (6 hours)

    • expand tests to cover stakefio in SDK (4 hours)

    • Integrate unstakefio into SDK (6 hours)

    • expand tests to cover unstakefio (4 hours)

    • integrate changes to get_balance (4 hours)

    • integrate get_staked_info into SDK (6 hours)

    • expand tests to cover get_staked_info (4 hours)

...

  • 3/30 Made strategic decision to place staking into its own distinct contract and account fio.staking.

    • during implementation it became obvious that the implementation of staking by adding actions and tables into the fio.system contract would considerably contribute to the contract bloat of that contract.

    • it was also deemed somewhat more organized to place all of the structures and actions pertaining to the staking within a central contract named for this purpose, this helps to clarify the location of the key structures and actions involved in staking going forward, and also provides a clean compartmentalization of the staking data and functionality.

    • it will add a day or two to the project, but the gains we get by way of comprehensibility, and maintainability will be significant, and so this is seen as an easy decision.

  • 4/1 The team met to discuss the necessity for core upgrades that are presently required to deliver new contracts and system accounts within the Fio Protocol. It was proposed that we can use the actions table to make a list of distinct system accounts and use this, and so in the future we can avoid any mandatary upgrades being required whenever new contracts and system accounts are added to the Fio Protocol.

    • This underwent a quick feasibility prototype which proved the concept should work acceptably.

    • NOTE – testing must be performed before we go forward in delivering this approach.

      • full playback testing

      • test with 400 actions in the actions table

      • test with 400 actions in the actions table and also perform set code on system contract.

      • test with 400 actions in the actions table and also perform set code on system contract after bloating the system contract to increase its size.

      • test that a new contract can be added using operational msig and set contracts.

    • After submitting the PR for these changes, work will resume on the staking project. These changes may deliver with Bahamas and so should position the protocol well for staking, marketplace, and wrapping.

  • 4/8/2021 implementation completed and functional testing completed on changes to permit adding contracts without core changes.

  • 4/15/2021 release testing discovered an issue with playback, a fix was strategized and implemented. This Took a few days.

  • 4/22/2021 dev net testing uncovered some issues with support for the dev net environment a fix was implemented, this took a few days.

  • 4/25/2021 rollout to test net with Bahamas, and work re-focuses on the staking contract development.

  • 4/28/2021 4 system calls implemented and dev tested.

  • 4/292021 system calls refactored into in line logic in stakefio and unstakefio (stakefio is completed and dev tested, unstakefio is 75%, need to focus next on the lock modifications to support the rest of the unstakefio implementation).

  • 5/8/2021 completed initial testing of spendable balance for transfer, and voting weight with genesis locks and after unstaking (and so having general locks as well).

  • 5/9/2021 completed implementation and dev test of collection of fees and staking rewards, and minting of bp rewards when BP claim is called.

  • 5/13/2021 regression tests completed, modifications to fio.test to integrate staking specific tests begins.

  • 5/17/2021 genesis locks dev testing is completed (test first 3 locking periods and also unlocking after all locking periods have passed).

  • 5/17/2021 beginning to integrate the dev test plan into a set of javascript tests in the fio.test repo.

  • 5/17/2021 Added fio.staking abi to the fiosdk_typescript repo.

  • 5/26/2021 during the beginning of the regression tests development, it was discovered 2 important requirements are yet to be addressed.

    • first, when locks are adapted, old (or expired) locking periods should be removed.

    • second, when adapting locking periods, if there is a pre-existing period that exists on the same day as the period to be added, this period should be adapted instead of adding a new period.

    • both of these requirements will be addressed immediately..

  • 5/27/2021 discover issue with the locking period precision, initial discussions with pawel, document the possible paths forward.

    • the limitations of 3 decimal places prohibits unstaking of small amounts (internal calculations go t zero)

    • recommend the use of a SUF amount for locking periods and retirement of the existing lock tokens table for general locks.

    • meeting is scheduled to discuss the options and decide the path forward.

  • 6/2/2021 Decision was made to go with the use of SUF amount within locking periods.

    • implemented all necessary changes throughout the protocols contracts and chain plugin to integrate the vs table (locktokensv2).

    • modify existing staking dev tests and get clean run of these.

    • continue modifying all pre-existing tests for general locks.