VeriBlock / nodecore

Other
12 stars 16 forks source link

"Waiting for vBitcoin ATV to be confirmed" operation state is not clear #172

Open Leonardiae opened 4 years ago

Leonardiae commented 4 years ago

When the APM operation get to the "Waiting for vBitcoin ATV to be confirmed" it is not clear (at least to me) what this state exactly means and what it is waiting for:

2020-08-05 14:07:41 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] VTB submitted to vBitcoin! vBitcoin PoP TxId: 900cfeb2eb5f962994f1da08bd5a92f7f1425402ece7b6e5aeb98795c75bbb11
2020-08-05 14:07:41 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] Waiting for vBitcoin ATV (900cfeb2eb5f962994f1da08bd5a92f7f1425402ece7b6e5aeb98795c75bbb11) to be confirmed...

It mentions a vBTC id which can be found on the console with 'getrawatv' but when this is confirmed the operation stays in this state. Apparently something else is happening and the operation is waiting for this to complete but I'm not able to follow this part of the operation. Then after a while the magic the APM is waiting for happens:

2020-08-05 15:18:22 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] Successfully confirmed vBitcoin ATV 900cfeb2eb5f962994f1da08bd5a92f7f1425402ece7b6e5aeb98795c75bbb11!
2020-08-05 15:18:22 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] Waiting for vBitcoin endorsed block (6907) to be confirmed...
2020-08-05 15:18:22 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] Successfully confirmed vBitcoin endorsed block 00000000fc3133a5f678e9f4bcf050256f5d802c74272de68814dd09c7d2ad4e!
2020-08-05 15:18:22 pop-tasks- INFO  ApmTaskService            - [vbtc2328f36a] Waiting for vBitcoin payout block (6957) to be confirmed...

Can the info provided in this operation state be expanded so I'm able to track what it's waiting for?

Leonardiae commented 4 years ago

I think I have seen in the code that it's marked as confirmed if: bestBlockHeight - block.height < chain.config.neededConfirmations

Would it be possible to show in the operation workflow details which are shown when getoperations is called for an operation the current amount of confirmations and how many confirmations are needed?

Operation workflow: DONE 1. START Created APM operation id: vbtc50c315ad DONE 2. RETRIEVE_MINING_INSTRUCTION Endorsed vBitcoin block height: 6943 DONE 3. SUBMIT_ENDORSEMENT_TRANSACTION tVBK endorsement transaction id: C384EC1FEA60922FAA76B3BA303CB12291B0DDF8C325C260B8ACAF036ABA4B5B (fee: 0.00248000) DONE 4. CONFIRM_ENDORSEMENT_TRANSACTION DONE 5. DETERMINE_BLOCK_OF_PROOF tVBK Block of Proof: 000000000AE8B51368E173AE75B3BA6F58E9C77DFD0803D3 @ 746571 DONE 6. PROVE_ENDORSEMENT_TRANSACTION Merkle path has been verified DONE 7. WAIT_FOR_KEYSTONE_OF_PROOF tVBK Keystone of Proof: 0000000064FF5B7D850B735CF82BAA429F73787A3D8B08D0 DONE 8. GET_VBK_PUBLICATIONS Retrieved 9 VTBs DONE 9. SUBMIT_POP_TRANSACTION VTBs submitted to vBitcoin! vBitcoin ATV id: 35236a0abd965553fdb5667d34e388ab4cd33fbbf905c9cd3a38e160bc0e2f5c CURRENT 10. CONFIRM_ATV Waiting for the vBitcoin ATV 35236a0abd965553fdb5667d34e388ab4cd33fbbf905c9cd3a38e160bc0e2f5c to be confirmed (2/10) or (2 confirmations / 10 needed)

  1. WAIT_FOR_PAYOUT_BLOCK Will wait for reward to be paid in vBitcoin block @ 6983 to vBitcoin address tb1q6jufs58zzad5pu5289ml3860wly6w2h9gsxzc6
    1. COMPLETED
PCasafont commented 4 years ago

It was waiting for 10 blocks after the one containing the ATVs. On next versions it will no longer do that.

Leonardiae commented 4 years ago

You mean that next versions only wait for one block? Then current working is fine with me. If it's higher than 1 then it would be great if you can see that in the workflow (how many it's waiting for and how many confirmations are there yet).