Closed arnabghose997 closed 1 month ago
Unpledge-cli :
Self Transfer Cli :
Working as expected . We can merge once backward compatibility is added.
A new command unpledge-pow-pledge-tokens
has been added, as part of the migration for older nodes (v0.0.17
and prior), to migrate from PoW based pledging to Periodic Pledging. This command will check if there are any tokens present in the unpledgequeue
table. If so, then the tokens will force unpledged and the unpledgequeue
table will be dropped. The information about pledge tokens, after the Periodic Pledging upgrade, will become part of the UnpledgeSequence
table. Following is the syntax of the command:
./rubixgoplatform unpledge-pow-pledge-tokens --port <quorum node's server port>
A fix has also been administered that affected old nodes migrating to Period Pledging. The format for storing quorum address in quorummanager
table in older versions were <node_peer_id>.<quorum_did>
format. However, in the current implementation, we expect their format to be <quorum_did>
. Especially while populating the ql
attribute of QuorumManager
struct, the values from the address
column of quorummanager
table are directly appended to it. This causes issues when invoking getPeer
method in later stages of the code.
To mitigate this, we have added a check in the NewQuorumManager
function, where we check if the address from quorummanager
table is in <node_peer_id>.<quorum_did>
format. If so, then we update it to <quorum_did>
format before appending to ql
attribute of QuorumManager
struct.
This PR intends to replace current PoW approach with Periodic Pledging. As opposed to the current approach, tokens will now be pledged for a duration of 7 days, post which token unpledging can happen. If a Trans token is in custody of owner for more than Pledge period (7 days) or if it has been transferred before the pledging period, the quorums will be able to unpledge their pledge tokens through a CLI/API call.
Since, pledged tokens are unpledged after 7 day period. a
self-transfer
CLI/API call is provided for node to essentially perform a psuedo state change, which will invite quorums to again pledge for the trans token.It has been tested locally with a temporary pledged duration value of 100 seconds with both RBT transfers and Smart contract deployment and execution.
Unpledge CLI
It goes through all the records present in the
unpledgeQueue
table and performs the unpledging process for all transactions, if anySelf Transfer CLI
Similar to general RBT transfer, we only pass the sender's address and the transaction type for Self Transfer.