Suspicion: Default construction of num_son extension parameter is breaking protocol compatibility. #513

Closed
opened 2023-02-17 23:42:57 +00:00 by christophersanborn · 11 comments
christophersanborn commented 2023-02-17 23:42:57 +00:00 (Migrated from gitlab.com)

In RC 1.5.21-alpha, the account_options structure was extended to include a new parameter, num_son. This parameter was added to the extensions field, and defined in nested structure ext:

account.hpp - Lines 39..52:

   struct account_options
   {
      struct ext
      {
         /// The number of active son members this account votes the blockchain should appoint
         /// Must not exceed the actual number of son members voted for in @ref votes
         optional< flat_map<sidechain_type, uint16_t> > num_son = []{
            flat_map<sidechain_type, uint16_t> num_son;
            for(const auto& active_sidechain_type : all_sidechain_types){
               num_son[active_sidechain_type] = 0;
            }
            return num_son;
         }();
      };

The definition includes a default constructor that makes an array of num_son values for side-chains known at compile-time. This is useful when, for example, getting a prototype transaction from cli_wallet, to see how this parameter can look.

However, I suspect that this is what is breaking compatibility with naive clients that predate 1.5.21-alpha, and is, essentially, breaking backwards compatibility between the extended protocol and previous protocol.

What I suspect is happening is that witness_node, when receiving an account_options object as part of a create_account operation, starts with a default constructed account_options object and updates it from the object received over-the-wire. What this means is that omitted fields are filled in with their defaults. However, if an old client submits an empty extensions structure, this means that witness_node fills in the missing num_son with its own idea of a default value. This then adds a missing field to the transaction, with the result that binary message packing of the transaction differs between client and server, and the witness_node then cannot recover the correct public key from the signature, and throws a "Missing Authority" error.

This suspicion is supported by an exchange between python-bitshares (via Uptick) and a witness_node running 1.5.21-alpha. (Transcript below.)

The solution, imho, is to simply remove the default constructor from the num_son field in the the definition of account_options. I.e., the following code is proposed:

   struct account_options
   {
      struct ext
      {
         /// The number of active son members this account votes the blockchain should appoint
         /// Must not exceed the actual number of son members voted for in @ref votes
         optional< flat_map<sidechain_type, uint16_t> > num_son;
      };

In this case, the default value of optional<> should be null, which should binary-pack to an empty extension set, and match the packing of naive clients.

Evidence:

Using a version of Uptick and python-bitshares modified to talk the Peerplays Alphanet chain, the following command was issued to create an account:

uptick -v15 $node_alphanet newaccount --account nathan --password BadPass hash-kat-432

And an excerpt of the communications are as follows:

2023-02-17 18:01:00,939 - grapheneapi.websocket - DEBUG - {"method": "call", "params": ["network_broadcast", "broadcast_transaction", [{"expiration": "2023-02-17T23:01:30", "ref_block_num": 36309, "ref_block_prefix": 3837224092, "operations": [[5, {"fee": {"amount": 658, "asset_id": "1.3.0"}, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 5000, "name": "hash-kat-432", "owner": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TEST6kswrSucyPc88kCR2gJ7Ex2WYYDTR1Ztd57QTkPso2BR2FQZAz", "1"]], "extensions": []}, "active": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TEST5wecU8D7j2KbVSThVFZZorUFeH22yL8j4vNFjFfgeHzcw8SjoG", "1"]], "extensions": []}, "options": {"memo_key": "TEST54pv3czQUg5X1uKWnc7cj88tYcTS6JFGXU62xHZhnpbGTwvXXd", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [], "extensions": []}, "extensions": {}}]], "extensions": [], "signatures": ["2007eac9c581e8f2a05efa47b3e8966290febb99e2d7e90248e471e54f873812a900a987245df6396c6750007bc70a2e06dd756d6f595ba3cf41dcd2386fdd33ee"]}]], "jsonrpc": "2.0", "id": 16}
2023-02-17 18:01:01,024 - grapheneapi.rpc - DEBUG - "{\"id\":16,\"jsonrpc\":\"2.0\",\"error\":{\"code\":1,\"message\":\"missing required active authority: Missing Active Authority 1.2.18\",\"data\":{\"code\":3030001,\"name\":\"tx_missing_active_auth\",\"message\":\"missing required active authority\",\"stack\":[{\"context\":{\"level\":\"error\",\"file\":\"transaction.cpp\",\"line\":310,\"method\":\"verify_authority\",\"hostname\":\"\",\"thread_name\":\"th_a\",\"timestamp\":\"2023-02-17T23:01:00\"},\"format\":\"Missing Active Authority ${id}\",\"data\":{\"id\":\"1.2.18\",\"auth\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",1]],\"address_auths\":[]},\"owner\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",1]],\"address_auths\":[]}}},{\"context\":{\"level\":\"warn\",\"file\":\"transaction.cpp\",\"line\":327,\"method\":\"verify_authority\",\"hostname\":\"\",\"thread_name\":\"th_a\",\"timestamp\":\"2023-02-17T23:01:00\"},\"format\":\"\",\"data\":{\"ops\":[[5,{\"fee\":{\"amount\":658,\"asset_id\":\"1.3.0\"},\"registrar\":\"1.2.18\",\"referrer\":\"1.2.18\",\"referrer_percent\":5000,\"name\":\"hash-kat-432\",\"owner\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6kswrSucyPc88kCR2gJ7Ex2WYYDTR1Ztd57QTkPso2BR2FQZAz\",1]],\"address_auths\":[]},\"active\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST5wecU8D7j2KbVSThVFZZorUFeH22yL8j4vNFjFfgeHzcw8SjoG\",1]],\"address_auths\":[]},\"options\":{\"memo_key\":\"TEST54pv3czQUg5X1uKWnc7cj88tYcTS6JFGXU62xHZhnpbGTwvXXd\",\"voting_account\":\"1.2.5\",\"num_witness\":0,\"num_committee\":0,\"votes\":[],\"extensions\":{\"num_son\":[[\"bitcoin\",0],[\"ethereum\",0],[\"hive\",0]]}},\"extensions\":{}}]],\"sigs\":[\"TEST5NT8G6nh64q9QpaNH9ohycXKe8E8nYy1TMoeFZCHshwFLDYdwS\"]}}

Of note, is that the transaction reported in the error message contains the num_son parameter, whereas the actual transaction submitted to the witness_node did not.

In RC [1.5.21-alpha](https://gitlab.com/PBSA/peerplays/-/tree/1.5.21-alpha), the `account_options` structure was extended to include a new parameter, `num_son`. This parameter was added to the `extensions` field, and defined in nested structure `ext`: [account.hpp - Lines 39..52:](https://gitlab.com/PBSA/peerplays/-/blob/1.5.21-alpha/libraries/chain/include/graphene/chain/protocol/account.hpp#L39) ```cpp struct account_options { struct ext { /// The number of active son members this account votes the blockchain should appoint /// Must not exceed the actual number of son members voted for in @ref votes optional< flat_map<sidechain_type, uint16_t> > num_son = []{ flat_map<sidechain_type, uint16_t> num_son; for(const auto& active_sidechain_type : all_sidechain_types){ num_son[active_sidechain_type] = 0; } return num_son; }(); }; ``` The definition includes a default constructor that makes an array of `num_son` values for side-chains known at compile-time. This is useful when, for example, getting a prototype transaction from cli_wallet, to see how this parameter _can_ look. However, I suspect that _this_ is what is breaking compatibility with naive clients that predate 1.5.21-alpha, and is, essentially, breaking backwards compatibility between the extended protocol and previous protocol. What I suspect is happening is that witness_node, when receiving an `account_options` object as part of a `create_account` operation, starts with a default constructed `account_options` object and updates it from the object received over-the-wire. What this means is that omitted fields are filled in with their defaults. However, if an old client submits an empty `extensions` structure, this means that witness_node fills in the missing `num_son` with its own idea of a default value. This then adds a missing field to the transaction, with the result that binary message packing of the transaction differs between client and server, and the witness_node then cannot recover the correct public key from the signature, and throws a "Missing Authority" error. This suspicion is supported by an exchange between `python-bitshares` (via Uptick) and a witness_node running 1.5.21-alpha. (Transcript below.) The solution, imho, is to simply remove the default constructor from the `num_son` field in the the definition of `account_options`. I.e., the following code is proposed: ```cpp struct account_options { struct ext { /// The number of active son members this account votes the blockchain should appoint /// Must not exceed the actual number of son members voted for in @ref votes optional< flat_map<sidechain_type, uint16_t> > num_son; }; ``` In this case, the default value of `optional<>` should be null, which should binary-pack to an empty extension set, and match the packing of naive clients. ### Evidence: Using a version of Uptick and python-bitshares modified to talk the Peerplays Alphanet chain, the following command was issued to create an account: ``` uptick -v15 $node_alphanet newaccount --account nathan --password BadPass hash-kat-432 ``` And an excerpt of the communications are as follows: ``` 2023-02-17 18:01:00,939 - grapheneapi.websocket - DEBUG - {"method": "call", "params": ["network_broadcast", "broadcast_transaction", [{"expiration": "2023-02-17T23:01:30", "ref_block_num": 36309, "ref_block_prefix": 3837224092, "operations": [[5, {"fee": {"amount": 658, "asset_id": "1.3.0"}, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 5000, "name": "hash-kat-432", "owner": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TEST6kswrSucyPc88kCR2gJ7Ex2WYYDTR1Ztd57QTkPso2BR2FQZAz", "1"]], "extensions": []}, "active": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TEST5wecU8D7j2KbVSThVFZZorUFeH22yL8j4vNFjFfgeHzcw8SjoG", "1"]], "extensions": []}, "options": {"memo_key": "TEST54pv3czQUg5X1uKWnc7cj88tYcTS6JFGXU62xHZhnpbGTwvXXd", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [], "extensions": []}, "extensions": {}}]], "extensions": [], "signatures": ["2007eac9c581e8f2a05efa47b3e8966290febb99e2d7e90248e471e54f873812a900a987245df6396c6750007bc70a2e06dd756d6f595ba3cf41dcd2386fdd33ee"]}]], "jsonrpc": "2.0", "id": 16} 2023-02-17 18:01:01,024 - grapheneapi.rpc - DEBUG - "{\"id\":16,\"jsonrpc\":\"2.0\",\"error\":{\"code\":1,\"message\":\"missing required active authority: Missing Active Authority 1.2.18\",\"data\":{\"code\":3030001,\"name\":\"tx_missing_active_auth\",\"message\":\"missing required active authority\",\"stack\":[{\"context\":{\"level\":\"error\",\"file\":\"transaction.cpp\",\"line\":310,\"method\":\"verify_authority\",\"hostname\":\"\",\"thread_name\":\"th_a\",\"timestamp\":\"2023-02-17T23:01:00\"},\"format\":\"Missing Active Authority ${id}\",\"data\":{\"id\":\"1.2.18\",\"auth\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",1]],\"address_auths\":[]},\"owner\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\",1]],\"address_auths\":[]}}},{\"context\":{\"level\":\"warn\",\"file\":\"transaction.cpp\",\"line\":327,\"method\":\"verify_authority\",\"hostname\":\"\",\"thread_name\":\"th_a\",\"timestamp\":\"2023-02-17T23:01:00\"},\"format\":\"\",\"data\":{\"ops\":[[5,{\"fee\":{\"amount\":658,\"asset_id\":\"1.3.0\"},\"registrar\":\"1.2.18\",\"referrer\":\"1.2.18\",\"referrer_percent\":5000,\"name\":\"hash-kat-432\",\"owner\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST6kswrSucyPc88kCR2gJ7Ex2WYYDTR1Ztd57QTkPso2BR2FQZAz\",1]],\"address_auths\":[]},\"active\":{\"weight_threshold\":1,\"account_auths\":[],\"key_auths\":[[\"TEST5wecU8D7j2KbVSThVFZZorUFeH22yL8j4vNFjFfgeHzcw8SjoG\",1]],\"address_auths\":[]},\"options\":{\"memo_key\":\"TEST54pv3czQUg5X1uKWnc7cj88tYcTS6JFGXU62xHZhnpbGTwvXXd\",\"voting_account\":\"1.2.5\",\"num_witness\":0,\"num_committee\":0,\"votes\":[],\"extensions\":{\"num_son\":[[\"bitcoin\",0],[\"ethereum\",0],[\"hive\",0]]}},\"extensions\":{}}]],\"sigs\":[\"TEST5NT8G6nh64q9QpaNH9ohycXKe8E8nYy1TMoeFZCHshwFLDYdwS\"]}} ``` Of note, is that the transaction reported in the error message contains the `num_son` parameter, whereas the actual transaction submitted to the witness_node did not.
christophersanborn commented 2023-02-17 23:43:14 +00:00 (Migrated from gitlab.com)

changed title from Suspicion: Default construction of num_son extension paramter is breaking protocol compatibility. to Suspicion: Default construction of num_son extension param{+e+}ter is breaking protocol compatibility.

changed title from **Suspicion: Default construction of num_son extension paramter is breaking protocol compatibility.** to **Suspicion: Default construction of num_son extension param{+e+}ter is breaking protocol compatibility.**
serkixenos commented 2023-02-21 05:03:48 +00:00 (Migrated from gitlab.com)

assigned to @wsalloum, @prandnum, and @milo_peerplays

assigned to @wsalloum, @prandnum, and @milo_peerplays
serkixenos commented 2023-02-21 05:05:58 +00:00 (Migrated from gitlab.com)

@wsalloum @prandnum Please verify that mainnet replay is possible with this change

MR
https://gitlab.com/PBSA/peerplays/-/merge_requests/209

Binaries, get from build-mainnet, ignore failed tests for now
https://gitlab.com/PBSA/peerplays/-/pipelines/782476870

@wsalloum @prandnum Please verify that mainnet replay is possible with this change MR https://gitlab.com/PBSA/peerplays/-/merge_requests/209 Binaries, get from build-mainnet, ignore failed tests for now https://gitlab.com/PBSA/peerplays/-/pipelines/782476870
elynch1 commented 2023-02-23 13:38:22 +00:00 (Migrated from gitlab.com)

marked this issue as blocking PBSA/tools-libs/faucet#31

marked this issue as blocking PBSA/tools-libs/faucet#31
prandnum commented 2023-02-24 17:46:35 +00:00 (Migrated from gitlab.com)

Able to replay the mainnet blockchain with the mentioned witness_node binary.

Able to replay the mainnet blockchain with the mentioned witness_node binary.
prandnum (Migrated from gitlab.com) closed this issue 2023-02-24 17:46:36 +00:00
serkixenos (Migrated from gitlab.com) reopened this issue 2023-02-25 11:54:12 +00:00
serkixenos commented 2023-02-25 11:55:54 +00:00 (Migrated from gitlab.com)

@prandnum There are other changes to related MR ticket, another branch should be tested now...

I believe this is the one that should be tested now

https://gitlab.com/PBSA/peerplays/-/pipelines/788809209

@milo_peerplays @christophersanborn

@prandnum There are other changes to related MR ticket, another branch should be tested now... I believe this is the one that should be tested now https://gitlab.com/PBSA/peerplays/-/pipelines/788809209 @milo_peerplays @christophersanborn
prandnum commented 2023-02-28 13:33:03 +00:00 (Migrated from gitlab.com)

Able to sync with mainnet and also do a replay. Can we close this bug, @serkixenos ?

Able to sync with mainnet and also do a replay. Can we close this bug, @serkixenos ?
milo_peerplays commented 2023-03-05 17:50:15 +00:00 (Migrated from gitlab.com)

@prandnum Could you please try again with https://gitlab.com/PBSA/peerplays/-/merge_requests/213? The previous MR had a flaw and had to be discarded.

@prandnum Could you please try again with https://gitlab.com/PBSA/peerplays/-/merge_requests/213? The previous MR had a flaw and had to be discarded.
milo_peerplays commented 2023-03-05 18:00:38 +00:00 (Migrated from gitlab.com)

Verification steps:

  • confirm that replay is possible
  • confirm that update account operation which has number of votes < than num_of_SONs will be rejected (use initialized QA environment):
update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05] [] bitcoin 5 true
update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05, sonaccount06] [] ethereum 6 true
update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05, sonaccount06, sonaccount07] [] hive 7 true
get_account account01

begin_builder_transaction
add_operation_to_builder_transaction 0 [ 6,{ "fee": { "amount": 3000000, "asset_id": "1.3.0" }, "account": "1.2.52", "new_options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [ "1:0", "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57" ], "extensions": { "num_son": ["bitcoin":7, "hive":8]} } "extensions": { "update_last_voting_time": true } } ]
sign_builder_transaction 0 true

get_account account01
  • confirm that create account operation which has number of voutes < than num_of_SONs will be rejected (use initialized QA enviroment):
begin_builder_transaction
add_operation_to_builder_transaction 0 [ 5,{ "fee": { "amount": 200014550, "asset_id": "1.3.0" }, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 0, "name": "newaccount", "owner":add_operation_to_builder_transaction 0 [ 5,{ "fee": { "amount": 300000000, "asset_id": "1.3.0" }, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 0, "name": "newaccount02", "owner": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST5PE6ioBSWxNdZBAULjfW9a4HUXNeVrDnqz48BNzVwzxShj1SeD", 1 ] ], "address_auths": [] }, "active": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST8W3bR3F2tvysgzRpftNbp2j5KG8fpU7gHGUfUx6b4fQ5iJDBh8", 1 ] ], "address_auths": [] }, "options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": ["1:0", "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57"], "extensions": { "num_son": ["bitcoin":8]} }, "extensions": {} } ]
sign_builder_transaction 0 true
  • verify that both create and update account operations with valid number of votes and number of SON will be accepted
Verification steps: * confirm that replay is possible * confirm that update account operation which has number of votes < than num_of_SONs will be rejected (use initialized QA environment): ``` update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05] [] bitcoin 5 true update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05, sonaccount06] [] ethereum 6 true update_son_votes account01 [sonaccount01, sonaccount02, sonaccount03, sonaccount04, sonaccount05, sonaccount06, sonaccount07] [] hive 7 true get_account account01 begin_builder_transaction add_operation_to_builder_transaction 0 [ 6,{ "fee": { "amount": 3000000, "asset_id": "1.3.0" }, "account": "1.2.52", "new_options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [ "1:0", "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57" ], "extensions": { "num_son": ["bitcoin":7, "hive":8]} } "extensions": { "update_last_voting_time": true } } ] sign_builder_transaction 0 true get_account account01 ``` * confirm that create account operation which has number of voutes < than num_of_SONs will be rejected (use initialized QA enviroment): ``` begin_builder_transaction add_operation_to_builder_transaction 0 [ 5,{ "fee": { "amount": 200014550, "asset_id": "1.3.0" }, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 0, "name": "newaccount", "owner":add_operation_to_builder_transaction 0 [ 5,{ "fee": { "amount": 300000000, "asset_id": "1.3.0" }, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 0, "name": "newaccount02", "owner": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST5PE6ioBSWxNdZBAULjfW9a4HUXNeVrDnqz48BNzVwzxShj1SeD", 1 ] ], "address_auths": [] }, "active": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST8W3bR3F2tvysgzRpftNbp2j5KG8fpU7gHGUfUx6b4fQ5iJDBh8", 1 ] ], "address_auths": [] }, "options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": ["1:0", "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57"], "extensions": { "num_son": ["bitcoin":8]} }, "extensions": {} } ] sign_builder_transaction 0 true ``` * verify that both create and update account operations with valid number of votes and number of SON will be accepted
vampik commented 2023-03-06 15:52:02 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
prandnum commented 2023-03-12 19:52:07 +00:00 (Migrated from gitlab.com)

Replay, create and update operations works as mentioned.

Update

unlocked >>> add_operation_to_builder_transaction 0 [6,{"fee":{"amount":3000000,"asset_id":"1.3.0"},"account":"1.2.52","new_options":{"memo_key":"TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5],["hive",7]]}},"extensions":{"update_last_voting_time":true}}]
add_operation_to_builder_transaction 0 [6,{"fee":{"amount":3000000,"asset_id":"1.3.0"},"account":"1.2.52","new_options":{"memo_key":"TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5],["hive",7]]}},"extensions":{"update_last_voting_time":true}}]
null
unlocked >>> sign_builder_transaction 0 true
sign_builder_transaction 0 true
{
  "ref_block_num": 14788,
  "ref_block_prefix": 2518630438,
  "expiration": "2023-03-12T19:02:09",
  "operations": [[
      6,{
        "fee": {
          "amount": 3000000,
          "asset_id": "1.3.0"
        },
        "account": "1.2.52",
        "new_options": {
          "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a",
          "voting_account": "1.2.5",
          "num_witness": 0,
          "num_committee": 0,
          "votes": [
            "3:38",
            "4:39",
            "5:40",
            "3:41",
            "4:42",
            "5:43",
            "3:44",
            "4:45",
            "5:46",
            "3:47",
            "4:48",
            "5:49",
            "3:50",
            "4:51",
            "5:52",
            "4:54",
            "5:55",
            "4:57"
          ],
          "extensions": {
            "num_son": [[
                "bitcoin",
                5
              ],[
                "hive",
                7
              ]
            ]
          }
        },
        "extensions": {
          "update_last_voting_time": true
        }
      }
    ]
  ],
  "extensions": [],
  "signatures": [
    "2056008876fe9267557c79e6dd939cea83c66985077ff37db0ae611aa8cfb50907445d235567bf2cac77ba065655de3b5a6aa7abc9ad07a7ef1a53665750db4bb5"
  ]
}
unlocked >>> 

unlocked >>> preview_builder_transaction 0
preview_builder_transaction 0
{
  "ref_block_num": 14788,
  "ref_block_prefix": 2518630438,
  "expiration": "2023-03-12T19:02:09",
  "operations": [[
      6,{
        "fee": {
          "amount": 3000000,
          "asset_id": "1.3.0"
        },
        "account": "1.2.52",
        "new_options": {
          "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a",
          "voting_account": "1.2.5",
          "num_witness": 0,
          "num_committee": 0,
          "votes": [
            "3:38",
            "4:39",
            "5:40",
            "3:41",
            "4:42",
            "5:43",
            "3:44",
            "4:45",
            "5:46",
            "3:47",
            "4:48",
            "5:49",
            "3:50",
            "4:51",
            "5:52",
            "4:54",
            "5:55",
            "4:57"
          ],
          "extensions": {
            "num_son": [[
                "bitcoin",
                5
              ],[
                "hive",
                7
              ]
            ]
          }
        },
        "extensions": {
          "update_last_voting_time": true
        }
      }
    ]
  ],
  "extensions": []
}
unlocked >>> 


Create

unlocked >>> begin_builder_transaction
begin_builder_transaction
0
unlocked >>> add_operation_to_builder_transaction 0 [5,{"fee":{"amount":3000000000,"asset_id":"1.3.0"},"registrar":"1.2.18","referrer":"1.2.18","referrer_percent":0,"name":"newaccount","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R",1]],"address_auths":[]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT",1]],"address_auths":[]},"options":{"memo_key":"TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5]]}},"extensions":{}}]
add_operation_to_builder_transaction 0 [5,{"fee":{"amount":3000000000,"asset_id":"1.3.0"},"registrar":"1.2.18","referrer":"1.2.18","referrer_percent":0,"name":"newaccount","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R",1]],"address_auths":[]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT",1]],"address_auths":[]},"options":{"memo_key":"TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5]]}},"extensions":{}}]
null
unlocked >>> sign_builder_transaction 0 true
sign_builder_transaction 0 true
{
  "ref_block_num": 15574,
  "ref_block_prefix": 2061226971,
  "expiration": "2023-03-12T19:42:03",
  "operations": [[
      5,{
        "fee": {
          "amount": "3000000000",
          "asset_id": "1.3.0"
        },
        "registrar": "1.2.18",
        "referrer": "1.2.18",
        "referrer_percent": 0,
        "name": "newaccount",
        "owner": {
          "weight_threshold": 1,
          "account_auths": [],
          "key_auths": [[
              "TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R",
              1
            ]
          ],
          "address_auths": []
        },
        "active": {
          "weight_threshold": 1,
          "account_auths": [],
          "key_auths": [[
              "TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT",
              1
            ]
          ],
          "address_auths": []
        },
        "options": {
          "memo_key": "TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up",
          "voting_account": "1.2.5",
          "num_witness": 0,
          "num_committee": 0,
          "votes": [
            "3:38",
            "4:39",
            "5:40",
            "3:41",
            "4:42",
            "5:43",
            "3:44",
            "4:45",
            "5:46",
            "3:47",
            "4:48",
            "5:49",
            "3:50",
            "4:51",
            "5:52",
            "4:54",
            "5:55",
            "4:57"
          ],
          "extensions": {
            "num_son": [[
                "bitcoin",
                5
              ]
            ]
          }
        },
        "extensions": {}
      }
    ]
  ],
  "extensions": [],
  "signatures": [
    "2034c1e0c77e99a21a26cf84948d87d9dce574b906f7eac4d8376907388d24bd483eb6f5219d4bcbe5d1ebb7440bd4013bdca05d1b213b9e25b877fa7a15cc77e9"
  ]
}
unlocked >>> 
Replay, create and update operations works as mentioned. ``` Update unlocked >>> add_operation_to_builder_transaction 0 [6,{"fee":{"amount":3000000,"asset_id":"1.3.0"},"account":"1.2.52","new_options":{"memo_key":"TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5],["hive",7]]}},"extensions":{"update_last_voting_time":true}}] add_operation_to_builder_transaction 0 [6,{"fee":{"amount":3000000,"asset_id":"1.3.0"},"account":"1.2.52","new_options":{"memo_key":"TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5],["hive",7]]}},"extensions":{"update_last_voting_time":true}}] null unlocked >>> sign_builder_transaction 0 true sign_builder_transaction 0 true { "ref_block_num": 14788, "ref_block_prefix": 2518630438, "expiration": "2023-03-12T19:02:09", "operations": [[ 6,{ "fee": { "amount": 3000000, "asset_id": "1.3.0" }, "account": "1.2.52", "new_options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [ "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57" ], "extensions": { "num_son": [[ "bitcoin", 5 ],[ "hive", 7 ] ] } }, "extensions": { "update_last_voting_time": true } } ] ], "extensions": [], "signatures": [ "2056008876fe9267557c79e6dd939cea83c66985077ff37db0ae611aa8cfb50907445d235567bf2cac77ba065655de3b5a6aa7abc9ad07a7ef1a53665750db4bb5" ] } unlocked >>> unlocked >>> preview_builder_transaction 0 preview_builder_transaction 0 { "ref_block_num": 14788, "ref_block_prefix": 2518630438, "expiration": "2023-03-12T19:02:09", "operations": [[ 6,{ "fee": { "amount": 3000000, "asset_id": "1.3.0" }, "account": "1.2.52", "new_options": { "memo_key": "TEST73rCkGNinnNSqJprEf6vXb6fiH9opF2DHVjbq2kutF8BH2n12a", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [ "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57" ], "extensions": { "num_son": [[ "bitcoin", 5 ],[ "hive", 7 ] ] } }, "extensions": { "update_last_voting_time": true } } ] ], "extensions": [] } unlocked >>> Create unlocked >>> begin_builder_transaction begin_builder_transaction 0 unlocked >>> add_operation_to_builder_transaction 0 [5,{"fee":{"amount":3000000000,"asset_id":"1.3.0"},"registrar":"1.2.18","referrer":"1.2.18","referrer_percent":0,"name":"newaccount","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R",1]],"address_auths":[]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT",1]],"address_auths":[]},"options":{"memo_key":"TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5]]}},"extensions":{}}] add_operation_to_builder_transaction 0 [5,{"fee":{"amount":3000000000,"asset_id":"1.3.0"},"registrar":"1.2.18","referrer":"1.2.18","referrer_percent":0,"name":"newaccount","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R",1]],"address_auths":[]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT",1]],"address_auths":[]},"options":{"memo_key":"TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up","voting_account":"1.2.5","num_witness":0,"num_committee":0,"votes":["3:38","4:39","5:40","3:41","4:42","5:43","3:44","4:45","5:46","3:47","4:48","5:49","3:50","4:51","5:52","4:54","5:55","4:57"],"extensions":{"num_son":[["bitcoin",5]]}},"extensions":{}}] null unlocked >>> sign_builder_transaction 0 true sign_builder_transaction 0 true { "ref_block_num": 15574, "ref_block_prefix": 2061226971, "expiration": "2023-03-12T19:42:03", "operations": [[ 5,{ "fee": { "amount": "3000000000", "asset_id": "1.3.0" }, "registrar": "1.2.18", "referrer": "1.2.18", "referrer_percent": 0, "name": "newaccount", "owner": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST5FLZ99Uyu5CRZbocRdwmvTyaz3w2GCdRqxbP4CwgXT2TVDjd8R", 1 ] ], "address_auths": [] }, "active": { "weight_threshold": 1, "account_auths": [], "key_auths": [[ "TEST5pqbnNEr1cTTyAqesZcX8GbDN6CwCXRvbC7UnsyRemfWWhSXUT", 1 ] ], "address_auths": [] }, "options": { "memo_key": "TEST7hP3qVwiEQrEXQJynwt9qwQeqwRf34AGNBZ7RyzxjquSFjC4Up", "voting_account": "1.2.5", "num_witness": 0, "num_committee": 0, "votes": [ "3:38", "4:39", "5:40", "3:41", "4:42", "5:43", "3:44", "4:45", "5:46", "3:47", "4:48", "5:49", "3:50", "4:51", "5:52", "4:54", "5:55", "4:57" ], "extensions": { "num_son": [[ "bitcoin", 5 ] ] } }, "extensions": {} } ] ], "extensions": [], "signatures": [ "2034c1e0c77e99a21a26cf84948d87d9dce574b906f7eac4d8376907388d24bd483eb6f5219d4bcbe5d1ebb7440bd4013bdca05d1b213b9e25b877fa7a15cc77e9" ] } unlocked >>> ```
prandnum (Migrated from gitlab.com) closed this issue 2023-03-12 19:52:09 +00:00
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#513
No description provided.