VeriBlock / vbk-ri-btc

Bitcoin Core integration/staging tree
https://bitcoincore.org/en/download
Other
4 stars 6 forks source link

Why check if endorsed block is confirmed #302

Closed Leonardiae closed 4 years ago

Leonardiae commented 4 years ago

After the vBitcoin ATV is confirmed the workflow is waiting for the vBitcoin endorsed block to be confirmed, which always (as far as I have seen) true and immediately marked as confirmed.

This check feels unnecessary to me because without at least one confirmation the workflow would not progress to this point.

But maybe I'm missing something here. For example that more than 1 confirmations are needed and this is being checked. If that's the case maybe also display the needed confirmations in the message. For example: Waiting for vBitcoin endorsed block (7726) to reach minimum confirmations of x... Or maybe this check is unnecessary at all?

2020-08-10 10:08:27 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Getting the mining instruction...
2020-08-10 10:08:27 pop-tasks- INFO  BitcoinFamilyChain        - Retrieving mining instruction at height 7726 from vBitcoin daemon at http://localhost:18332...
2020-08-10 10:08:27 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Successfully retrieved the mining instruction!
...
2020-08-10 11:36:40 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Successfully confirmed vBitcoin ATV 6d70375d9b47f72e4db64bfb6867c6af78d7068eeff3ceb2dace264a154d074a!
2020-08-10 11:36:40 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Waiting for vBitcoin endorsed block (7726) to be confirmed...
2020-08-10 11:36:40 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Successfully confirmed vBitcoin endorsed block 0000000082d5946bf89cd8112d42bf4ec538e8675b8225053529784ff1636292!
2020-08-10 11:36:40 pop-tasks- INFO  ApmTaskService            - [vbtc0b24b2e3] Waiting for vBitcoin payout block (7776) to be confirmed...
Warchant commented 4 years ago
  1. APM creates VBK TX and sends it to VeriBlock network
  2. This VBK TX gets confirmed in VBK Block Of Proof
  3. APM sends VBK TX, VBK Block Of Proof, Merkle Path that confirms tx is in this VBK block to vBTC -> this is known as ATV
  4. ATV is accepted to vBTC mempool and if it is valid, it will be accepted in next vBTC block
  5. Lets suppose this ATV is accepted in vBTC100, and payoutDelay is 50, then:
  6. APM will wait for vBTC150, will check that this block contains payout to payoutAddress (from config), and it will mark operation as "Complete" if so, or "Failed" otherwise.

In other words, operation is Complete when ALT POP miner got payout for their endorsement(s).