Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zebra's block template can contain duplicate transactions #5982

Closed
1 task
teor2345 opened this issue Jan 17, 2023 · 4 comments · Fixed by #6006
Closed
1 task

Zebra's block template can contain duplicate transactions #5982

teor2345 opened this issue Jan 17, 2023 · 4 comments · Fixed by #6006
Assignees
Labels
A-consensus Area: Consensus rule updates A-rpc Area: Remote Procedure Call interfaces C-bug Category: This is a bug I-consensus Zebra breaks a Zcash consensus rule

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jan 17, 2023

Motivation

When I use zebra-utils/zcash-rpc-block-template-to-proposal from PR #5944 to send a block proposal from Zebra to both zcashd and Zebra, I see these errors in Zebra's block template:

Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json:
bad-txns-inputs-missingorspent
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.28232.json:
{
  "reject_reason": "rejected",
  "capabilities": [
    "proposal"
  ]
}

The template in template-getblocktemplate-template.json contains two copies of transaction f7b68748b40a49bf7cb0ce8b9565a29bfd65cd917c68d0ee18feaf2614055608. This is incorrect and breaks a consensus rule.

Both Zebra and zcashd agree that this block proposal is invalid.

This bug is a blocker for mining pools using Zebra, because it produces invalid blocks.

Specifications

Duplicate transactions are invalid because of the consensus rules that prevent:

  • double-spending a transparent input
  • revealing a shielded spend nullifier that has already been revealed

Complex Code or Requirements

It is difficult to reproduce this bug, because it depends on the mempool's state at the time, and the chain tips of both nodes.

But the bug isn't happening due to a chain fork or a concurrent block commit, that would be a previous block hash error.

Testing

We might need to re-test with the same script a few times to reproduce this error, and make sure it is gone.

Tasks

  • Fix the consensus bug in the block proposal or mempool code
@teor2345 teor2345 added C-bug Category: This is a bug A-consensus Area: Consensus rule updates S-needs-triage Status: A bug report needs triage P-High 🔥 I-consensus Zebra breaks a Zcash consensus rule A-rpc Area: Remote Procedure Call interfaces labels Jan 17, 2023
@teor2345
Copy link
Contributor Author

teor2345 commented Jan 17, 2023

zcashd's logs say:

2023-01-17T07:21:06.896112Z ERROR main: ConnectBlock(): inputs missing/spent 

Zebra's logs say:

2023-01-17T07:21:06.952093Z  INFO zebra_rpc::methods::get_block_template_rpcs::get_block_template: Got error response from chain_verifier CheckProposal request verify_chain_error=Block could not be full-verified verify_chain_error.sources=[block contains duplicate transactions]

The full script logs are:

Checking getblocktemplate node release info...                                                                                                                                                             
Connected to zebrad (port 28232) for getblocktemplate { "mode": "template"  }                                                                                                                              
                                                                                                                                                                                                           
Checking proposal nodes release info...                                                                                                                                                                    
Connected to zcashd (port 8232) for getblocktemplate { "mode": "proposal", "data": "..."  }                                                                                                                
Connected to zebrad (port 28232) for getblocktemplate { "mode": "proposal", "data": "..."  }                                                                                                               
                                                                                                                                                                                                           
Checking zebrad template network and tip height...                                                                                                                                                         
Checking proposal nodes network and tip height...                                                                                                                                                          
                                                                                                                                                                                                           
getblocktemplate template request (zebrad port 28232):                                                                                                                                                     
getblocktemplate { "mode": "template"  }                                                                                                                                                                   
                                                                                                                                                                                                           
Querying zebrad main chain at height >=1951401...                                                                                                                                                          
0.00user 0.00system 0:00.00elapsed 71%CPU (0avgtext+0avgdata 5636maxresident)k
289inputs+0outputs (0major+880minor)pagefaults 0swaps
Block template data is in /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/template-getblocktemplate-template.json

Turning the template into block proposal data using block-template-to-proposal...
Block proposal data is in /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-data*

getblocktemplate proposal submissions:
getblocktemplate { "mode": "proposal", "data": "..."  }

0.00user 0.00system 0:00.00elapsed 62%CPU (0avgtext+0avgdata 5628maxresident)k
289inputs+0outputs (0major+886minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 85%CPU (0avgtext+0avgdata 5640maxresident)k
289inputs+0outputs (0major+885minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 71%CPU (0avgtext+0avgdata 5640maxresident)k
289inputs+0outputs (0major+887minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 85%CPU (0avgtext+0avgdata 5632maxresident)k
289inputs+0outputs (0major+881minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 5656maxresident)k
289inputs+0outputs (0major+884minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 83%CPU (0avgtext+0avgdata 5644maxresident)k
289inputs+0outputs (0major+890minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 5636maxresident)k
289inputs+0outputs (0major+890minor)pagefaults 0swaps
0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 5632maxresident)k
289inputs+0outputs (0major+886minor)pagefaults 0swaps

Proposal response diffs between ports  8232 28232 and time sources CurTime MinTime MaxTime ClampedNow:
--- /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json    2023-01-17 17:21:06.894854936 +1000
+++ /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.28232.json   2023-01-17 17:21:06.903854839 +1000
@@ -1 +1,6 @@
-bad-txns-inputs-missingorspent
+{
+  "reject_reason": "rejected",
+  "capabilities": [
+    "proposal"
+  ]
+}
--- /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json    2023-01-17 17:21:06.894854936 +1000
+++ /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MinTime.28232.json   2023-01-17 17:21:06.919854667 +1000
@@ -1 +1,6 @@
-bad-txns-inputs-missingorspent
+{
+  "reject_reason": "rejected",
+  "capabilities": [
+    "proposal"
+  ]
+}
--- /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json    2023-01-17 17:21:06.894854936 +1000
+++ /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MaxTime.28232.json   2023-01-17 17:21:06.935854496 +1000
@@ -1 +1,6 @@
-bad-txns-inputs-missingorspent
+{
+  "reject_reason": "rejected",
+  "capabilities": [
+    "proposal"
+  ]
+}
--- /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json    2023-01-17 17:21:06.894854936 +1000
+++ /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.ClampedNow.28232.json        2023-01-17 17:21:06.950854334 +1000
@@ -1 +1,6 @@
-bad-txns-inputs-missingorspent
+{
+  "reject_reason": "rejected",
+  "capabilities": [
+    "proposal"
+  ]
+}

Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.8232.json:                                      
bad-txns-inputs-missingorspent                                                                                                                                                                             
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.CurTime.28232.json:
{
  "reject_reason": "rejected",
  "capabilities": [
    "proposal"
  ]
}
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MinTime.8232.json:
bad-txns-inputs-missingorspent
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MinTime.28232.json:
{
  "reject_reason": "rejected",
  "capabilities": [
    "proposal"
  ]
}
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MaxTime.8232.json:
bad-txns-inputs-missingorspent
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.MaxTime.28232.json:
{
  "reject_reason": "rejected",
  "capabilities": [
    "proposal"
  ]
}
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.ClampedNow.8232.json:
bad-txns-inputs-missingorspent
Node said proposal was invalid, error response from /run/user/1000/tmp.Kr4uDEHYbz.block-template-proposal/proposal-check-getblocktemplate-proposal.ClampedNow.28232.json:
{
  "reject_reason": "rejected",
  "capabilities": [
    "proposal"
  ]
}

template-getblocktemplate-template.json contains:

{
  "capabilities": [
    "proposal"
  ],
  "version": 4,
  "previousblockhash": "000000000041c7a3fe3c2e557d6011adc139c1b3ef5f24b9c0374a6bca854ecc",
  "blockcommitmentshash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "lightclientroothash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "finalsaplingroothash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "defaultroots": {
    "merkleroot": "3319b2f5e04f03bb0e69e7ae2b24e0607e442e5362b5670beda38dbe604173a2",
    "chainhistoryroot": "b0f3d31b9dbc3efdd16497ef569eaf961b12d44c1140618cef49caee72ffa90a",
    "authdataroot": "d4ac15b68ab2a886d18bb2e155bb5e2f8135201ca391a3ea03c61eb833c14fff",
    "blockcommitmentshash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095"
  },
  "transactions": [
    {
      "data": "0400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d000000000000000000000000",
      "hash": "f7b68748b40a49bf7cb0ce8b9565a29bfd65cd917c68d0ee18feaf2614055608",
      "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
      "depends": [
      ],
      "fee": 785,
      "sigops": 2,
      "required": false
    },
    {
      "data": "0400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d000000000000000000000000",
      "hash": "f7b68748b40a49bf7cb0ce8b9565a29bfd65cd917c68d0ee18feaf2614055608",
      "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
      "depends": [
      ],
      "fee": 785,
      "sigops": 2,
      "required": false
    }
  ],
  "coinbasetxn": {
    "data": "0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff0503aac61d00ffffffff04a2b8e60e000000001976a914be3a9e1d9af0ec5dbe67271284c9cf53b79aa74f88ac38c94d010000000017a9142e1fff58b8ec78077b50b7ffa2144267512b32bf8740787d010000000017a914931fec54c1fea86e574462cc32013f5400b8912987286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c908700000000aac61d000000000000000000000000",
    "hash": "11a90fc04e6fd1361e4272fe0789ddce2b1edf19a16aa9dec90368a88611061d",
    "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
    "depends": [
    ],
    "fee": -1570,
    "sigops": 1,
    "required": true
  },
  "longpollid": "0001951401a7c919f6167394521000000000027fefa9c9",
  "target": "0000000001ad6700000000000000000000000000000000000000000000000000",
  "mintime": 1673939811,
  "mutable": [
    "time",
    "transactions",
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 20000,
  "sizelimit": 2000000,
  "curtime": 1673940066,
  "bits": "1c01ad67",
  "height": 1951402,
  "maxtime": 1673945210
}

proposal-data.CurTime.json contains:

{ "mode": "proposal", "data": "04000000cc4e85ca6b4a37c0b9245fefb3c139c1ad11607d552e3cfea3c7410000000000a2734160be8da3ed0b67b562532e447e60e0242baee7690ebb034fe0f5b21933958037d2389232d6275970840595d9307a527c061c983e6d052d3d42551b9960624cc66367ad011c0000000000000000000000000000000000000000000000000000000000000000fd4005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff0503aac61d00ffffffff04a2b8e60e000000001976a914be3a9e1d9af0ec5dbe67271284c9cf53b79aa74f88ac38c94d010000000017a9142e1fff58b8ec78077b50b7ffa2144267512b32bf8740787d010000000017a914931fec54c1fea86e574462cc32013f5400b8912987286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c908700000000aac61d0000000000000000000000000400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d0000000000000000000000000400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d000000000000000000000000" }

proposal-data.CurTime.debug contains:

{
  "capabilities": [
    "proposal"
  ],
  "version": 4,
  "previousblockhash": "000000000041c7a3fe3c2e557d6011adc139c1b3ef5f24b9c0374a6bca854ecc",
  "blockcommitmentshash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "lightclientroothash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "finalsaplingroothash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095",
  "defaultroots": {
    "merkleroot": "3319b2f5e04f03bb0e69e7ae2b24e0607e442e5362b5670beda38dbe604173a2",
    "chainhistoryroot": "b0f3d31b9dbc3efdd16497ef569eaf961b12d44c1140618cef49caee72ffa90a",
    "authdataroot": "d4ac15b68ab2a886d18bb2e155bb5e2f8135201ca391a3ea03c61eb833c14fff",
    "blockcommitmentshash": "60991b55423d2d056d3e981c067c527a30d9950584705927d6329238d2378095"
  },
  "transactions": [
    {
      "data": "0400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d000000000000000000000000",
      "hash": "f7b68748b40a49bf7cb0ce8b9565a29bfd65cd917c68d0ee18feaf2614055608",
      "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
      "depends": [],
      "fee": 785,
      "sigops": 2,
      "required": false
    },
    {
      "data": "0400008085202f89024093c6f339fa0948d5276a7593862940154def5dd15b82e5c36017e0dffe752a010000006a473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21feffffffd55fff7d49f537ebf492e059b63cd187f8485a8d73904b9bfc2d86b8733ce546000000006b483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6ddfeffffff021cd9b459010000001976a9147eb1eda601eb6ebbaa0995e58ee643d57817546088aca5080000000000001976a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac7cc61d00d2c61d000000000000000000000000",
      "hash": "f7b68748b40a49bf7cb0ce8b9565a29bfd65cd917c68d0ee18feaf2614055608",
      "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
      "depends": [],
      "fee": 785,
      "sigops": 2,
      "required": false
    }
  ],
  "coinbasetxn": {
    "data": "0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff0503aac61d00ffffffff04a2b8e60e000000001976a914be3a9e1d9af0ec5dbe67271284c9cf53b79aa74f88ac38c94d010000000017a9142e1fff58b8ec78077b50b7ffa2144267512b32bf8740787d010000000017a914931fec54c1fea86e574462cc32013f5400b8912987286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c908700000000aac61d000000000000000000000000",
    "hash": "11a90fc04e6fd1361e4272fe0789ddce2b1edf19a16aa9dec90368a88611061d",
    "authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
    "depends": [],
    "fee": -1570,
    "sigops": 1,
    "required": true
  },
  "longpollid": "0001951401a7c919f6167394521000000000027fefa9c9",
  "target": "0000000001ad6700000000000000000000000000000000000000000000000000",
  "mintime": 1673939811,
  "mutable": [
    "time",
    "transactions",
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 20000,
  "sizelimit": 2000000,
  "curtime": 1673940066,
  "bits": "1c01ad67",
  "height": 1951402,
  "maxtime": 1673945210
}
Block {
    header: Header {
        version: 4,
        previous_block_hash: block::Hash(
            "000000000041c7a3fe3c2e557d6011adc139c1b3ef5f24b9c0374a6bca854ecc",
        ),
        merkle_root: Root(
            "a2734160be8da3ed0b67b562532e447e60e0242baee7690ebb034fe0f5b21933",
        ),
        commitment_bytes: [u8; 32](
            "958037d2389232d6275970840595d9307a527c061c983e6d052d3d42551b9960",
        ),
        time: 2023-01-17T07:21:06Z,
        difficulty_threshold: CompactDifficulty(
            0x1c01ad67,
            Some(ExpandedDifficulty("0000000001ad6700000000000000000000000000000000000000000000000000")),
        ),
        nonce: [u8; 32](
            "0000000000000000000000000000000000000000000000000000000000000000",
        ),
        solution: EquihashSolution(
            "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        ),
    },
    transactions: [
        V4 {
            inputs: [
                Coinbase {
                    height: Height(
                        1951402,
                    ),
                    data: CoinbaseData(
                        "\\x00",
                    ),
                    sequence: 4294967295,
                },
            ],
            outputs: [
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        250001570,
                    ),
                    lock_script: Script(
                        "76a914be3a9e1d9af0ec5dbe67271284c9cf53b79aa74f88ac",
                    ),
                },
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        21875000,
                    ),
                    lock_script: Script(
                        "a9142e1fff58b8ec78077b50b7ffa2144267512b32bf87",
                    ),
                },
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        25000000,
                    ),
                    lock_script: Script(
                        "a914931fec54c1fea86e574462cc32013f5400b8912987",
                    ),
                },
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        15625000,
                    ),
                    lock_script: Script(
                        "a914d45cb1adffb5215a42720532a076f02c7c778c9087",
                    ),
                },
            ],
            lock_time: Height(
                Height(
                    0,
                ),
            ),
            expiry_height: Height(
                1951402,
            ),
            joinsplit_data: None,
            sapling_shielded_data: None,
        },
        V4 {
            inputs: [
                PrevOut {
                    outpoint: OutPoint {
                        hash: transaction::Hash(
                            "2a75fedfe01760c3e5825bd15def4d1540298693756a27d54809fa39f3c69340",
                        ),
                        index: 1,
                    },
                    unlock_script: Script(
                        "473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21",
                    ),
                    sequence: 4294967294,
                },
                PrevOut {
                    outpoint: OutPoint {
                        hash: transaction::Hash(
                            "46e53c73b8862dfc9b4b90738d5a48f887d13cb659e092f4eb37f5497dff5fd5",
                        ),
                        index: 0,
                    },
                    unlock_script: Script(
                        "483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6dd",
                    ),
                    sequence: 4294967294,
                },
            ],
            outputs: [
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        5799991580,
                    ),
                    lock_script: Script(
                        "76a9147eb1eda601eb6ebbaa0995e58ee643d57817546088ac",
                    ),
                },
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        2213,
                    ),
                    lock_script: Script(
                        "76a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac",
                    ),
                },
            ],
            lock_time: Height(
                Height(
                    1951356,
                ),
            ),
            expiry_height: Height(
                1951442,
            ),
            joinsplit_data: None,
            sapling_shielded_data: None,
        },
        V4 {
            inputs: [
                PrevOut {
                    outpoint: OutPoint {
                        hash: transaction::Hash(
                            "2a75fedfe01760c3e5825bd15def4d1540298693756a27d54809fa39f3c69340",
                        ),
                        index: 1,
                    },
                    unlock_script: Script(
                        "473044022015122d43e051e9b8e37b85bcba422caa5ff6f8f3c7e03f17571ae4eca10275a202204338a01fe79634fb9e6c5a38e76423d6564d0d62c252adc272dcbddd58a5068601210301749fd242a0b3bdd3f7083c98fd6fc9c4e101491b1a49e7b75d74cce6586b21",
                    ),
                    sequence: 4294967294,
                },
                PrevOut {
                    outpoint: OutPoint {
                        hash: transaction::Hash(
                            "46e53c73b8862dfc9b4b90738d5a48f887d13cb659e092f4eb37f5497dff5fd5",
                        ),
                        index: 0,
                    },
                    unlock_script: Script(
                        "483045022100f679efe9ef9a4c3ac7d3d54af2eea0a7b61a7ec3d8f3b24c1be50685163b59e402207ccc3ff1dd3006b4690a15c6d271ec53433f352c127e8f22a3742237a58e9fcf01210285b79d685ccfd14acc06ecccbefd176b997389c951007ab652afecfe7d80c6dd",
                    ),
                    sequence: 4294967294,
                },
            ],
            outputs: [
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        5799991580,
                    ),
                    lock_script: Script(
                        "76a9147eb1eda601eb6ebbaa0995e58ee643d57817546088ac",
                    ),
                },
                Output {
                    value: Amount<zebra_chain::amount::NonNegative>(
                        2213,
                    ),
                    lock_script: Script(
                        "76a9142fbbabfefa713333c3a4bb37b9b3f884d6cd9aad88ac",
                    ),
                },
            ],
            lock_time: Height(
                Height(
                    1951356,
                ),
            ),
            expiry_height: Height(
                1951442,
            ),
            joinsplit_data: None,
            sapling_shielded_data: None,
        },
    ],
}

@teor2345 teor2345 changed the title Zebra's block templates contain incorrect transactions with missing inputs Zebra's block template can contain duplicate transactions Jan 17, 2023
@teor2345
Copy link
Contributor Author

teor2345 commented Jan 17, 2023

@mpguerra can we schedule this fix in this sprint, it is blocking further testing?

(We can test for other bugs, but we can't be sure we've found them all until this one is fixed.)

@arya2 arya2 self-assigned this Jan 19, 2023
@mpguerra mpguerra added this to Zebra Jan 19, 2023
@mpguerra mpguerra moved this to 🛑 Won't Fix in Zebra Jan 19, 2023
@mpguerra mpguerra moved this from 🛑 Won't Fix to 🆕 New in Zebra Jan 19, 2023
@mpguerra mpguerra moved this from 🆕 New to 📋 Sprint Backlog in Zebra Jan 19, 2023
@mpguerra
Copy link
Contributor

@mpguerra mpguerra moved this from 📋 Sprint Backlog to 👀 In review in Zebra Jan 20, 2023
@mergify mergify bot closed this as completed in #6006 Jan 23, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Zebra Jan 23, 2023
@mpguerra
Copy link
Contributor

@arya2 unfortunately the PR was merged before the planning poker result was set. Can you please add an estimate here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-rpc Area: Remote Procedure Call interfaces C-bug Category: This is a bug I-consensus Zebra breaks a Zcash consensus rule
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants