[SON-HIVE Voting] Refactor sidechain plugin to use sidechain lists of active sons for deposit/withdrawal/primary wallet processing and approvals #311

Closed
opened 2022-03-03 19:55:27 +00:00 by serkixenos · 6 comments
serkixenos commented 2022-03-03 19:55:27 +00:00 (Migrated from gitlab.com)

The goal is to separate voting for Bitcoin and Hive SONs, so that they can act independently of each others. All code affected by this change should be refactored, in a way that enables that Bitcoin SON and Hive SON are considered separate entities.

This is mostly related to properly populating list of expected SONs to confirm/sign a subject of SON processing.

eg:

   class son_wallet_object : public abstract_object<son_wallet_object>
   {
      public:
         static const uint8_t space_id = protocol_ids;
         static const uint8_t type_id  = son_wallet_object_type;

         time_point_sec valid_from;
         time_point_sec expires;

         flat_map<sidechain_type, string> addresses; <<=== This one
         vector<son_info> sons;
   };
   class son_wallet_deposit_object : public abstract_object<son_wallet_deposit_object>
   {
      public:
         static const uint8_t space_id = protocol_ids;
         static const uint8_t type_id  = son_wallet_deposit_object_type;

         time_point_sec timestamp;
         uint32_t block_num;
         sidechain_type sidechain = sidechain_type::unknown;
         std::string sidechain_uid;
         std::string sidechain_transaction_id;
         std::string sidechain_from;
         std::string sidechain_to;
         std::string sidechain_currency;
         safe<int64_t> sidechain_amount;
         chain::account_id_type peerplays_from;
         chain::account_id_type peerplays_to;
         chain::asset peerplays_asset;

         std::map<son_id_type, weight_type> expected_reports; <<=== This one
         std::set<son_id_type> received_reports;              <<=== This one

         bool confirmed = false;

         bool processed = false;
   };
   class son_wallet_withdraw_object : public abstract_object<son_wallet_withdraw_object>
   {
      public:
         static const uint8_t space_id = protocol_ids;
         static const uint8_t type_id  = son_wallet_withdraw_object_type;

         time_point_sec timestamp;
         uint32_t block_num;
         sidechain_type sidechain = sidechain_type::unknown;
         std::string peerplays_uid;
         std::string peerplays_transaction_id;
         chain::account_id_type peerplays_from;
         chain::asset peerplays_asset;
         sidechain_type withdraw_sidechain;
         std::string withdraw_address;
         std::string withdraw_currency;
         safe<int64_t> withdraw_amount;

         std::map<son_id_type, weight_type> expected_reports; <<=== This one
         std::set<son_id_type> received_reports;              <<=== This one

         bool confirmed = false;

         bool processed = false;
   };
The goal is to separate voting for Bitcoin and Hive SONs, so that they can act independently of each others. All code affected by this change should be refactored, in a way that enables that Bitcoin SON and Hive SON are considered separate entities. This is mostly related to properly populating list of expected SONs to confirm/sign a subject of SON processing. eg: ``` class son_wallet_object : public abstract_object<son_wallet_object> { public: static const uint8_t space_id = protocol_ids; static const uint8_t type_id = son_wallet_object_type; time_point_sec valid_from; time_point_sec expires; flat_map<sidechain_type, string> addresses; <<=== This one vector<son_info> sons; }; ``` ``` class son_wallet_deposit_object : public abstract_object<son_wallet_deposit_object> { public: static const uint8_t space_id = protocol_ids; static const uint8_t type_id = son_wallet_deposit_object_type; time_point_sec timestamp; uint32_t block_num; sidechain_type sidechain = sidechain_type::unknown; std::string sidechain_uid; std::string sidechain_transaction_id; std::string sidechain_from; std::string sidechain_to; std::string sidechain_currency; safe<int64_t> sidechain_amount; chain::account_id_type peerplays_from; chain::account_id_type peerplays_to; chain::asset peerplays_asset; std::map<son_id_type, weight_type> expected_reports; <<=== This one std::set<son_id_type> received_reports; <<=== This one bool confirmed = false; bool processed = false; }; ``` ``` class son_wallet_withdraw_object : public abstract_object<son_wallet_withdraw_object> { public: static const uint8_t space_id = protocol_ids; static const uint8_t type_id = son_wallet_withdraw_object_type; time_point_sec timestamp; uint32_t block_num; sidechain_type sidechain = sidechain_type::unknown; std::string peerplays_uid; std::string peerplays_transaction_id; chain::account_id_type peerplays_from; chain::asset peerplays_asset; sidechain_type withdraw_sidechain; std::string withdraw_address; std::string withdraw_currency; safe<int64_t> withdraw_amount; std::map<son_id_type, weight_type> expected_reports; <<=== This one std::set<son_id_type> received_reports; <<=== This one bool confirmed = false; bool processed = false; }; ```
serkixenos commented 2022-03-28 14:10:58 +00:00 (Migrated from gitlab.com)

changed title from Refactor sidechain plugin to use sidechain lists of active sons for deposit/withdrawal/primary wallet processing and approvals to {+[SON-HIVE Voting] +}Refactor sidechain plugin to use sidechain lists of active sons for deposit/withdrawal/primary wallet processing and approvals

changed title from **Refactor sidechain plugin to use sidechain lists of active sons for deposit/withdrawal/primary wallet processing and approvals** to **{+[SON-HIVE Voting] +}Refactor sidechain plugin to use sidechain lists of active sons for deposit/withdrawal/primary wallet processing and approvals**
serkixenos commented 2022-03-28 14:12:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #155

mentioned in issue #155
hbelakon commented 2022-04-08 14:38:21 +00:00 (Migrated from gitlab.com)

added to epic &295

added to epic &295
vampik commented 2022-04-12 05:47:03 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
vampik commented 2022-04-13 12:23:30 +00:00 (Migrated from gitlab.com)

Waiting for schedule to be finished, then start this ticket

Waiting for schedule to be finished, then start this ticket
serkixenos (Migrated from gitlab.com) closed this issue 2022-05-04 17:01:12 +00:00
hbelakon commented 2022-05-04 18:02:14 +00:00 (Migrated from gitlab.com)

changed epic to &530

changed epic to &530
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#311
No description provided.