Commit Graph

21 Commits

Author SHA1 Message Date
Kris Nuttycombe 6477c6165b Update getblocktemplate test to use persisted sprout chain 2022-07-18 09:00:34 -06:00
Kris Nuttycombe 1b8a9af946 Add tests to check auth data commitments committing to Orchard actions.
In the process of adding these tests, I also found and fixed a number
of type errors in Orchard auth data root computation.

Fixes #5223
2022-05-09 21:01:11 -06:00
Jack Grigg 165901c654 qa: Remove hard-coded consensus branch IDs from RPC tests
Also fixes a bug in the `nuparams` helper, which would have caused MSB
zeroes in consensus branch IDs to not be rendered in the `-nuparams`
option. This hadn't been encountered because we haven't yet generated a
consensus branch ID with a zero MSB.
2022-03-23 20:28:31 +00:00
Jack Grigg 4559186596 rpc: Fix regression in getblocktemplate output
We added support for the NU5 consensus rules in v4.5.0, which alters the
block header to contain a `hashBlockCommitments` value instead of the
chain history root. However, the output of `getblocktemplate` wasn't
returning this value; once NU5 activated, the `blockcommitmentshash`
field was being set to "null" (all-zeroes).

In v4.6.0 we added full NU5 support to `getblocktemplate`, by adding a
`defaultroots` field that gave default values for `hashBlockCommitments`
and the components required to derive it. However, in doing so we
introduced a regression in the (now-deprecated) legacy fields, where
prior to NU5 activation they contained nonsense.

This commit fixes the output of `getblocktemplate` to have the intended
semantics for all fields:

- The `blockcommitmentshash` and `authdataroot` fields in `defaultroots`
  are now omitted from block templates for heights before NU5 activation.

- The legacy fields now always contain the default value to be placed
  into the block header (regaining their previous semantics).

Co-authored-by: Larry Ruane <larry@z.cash>
2022-01-05 12:07:46 +00:00
Larry Ruane dfefab2f55 test: check getblocktemplate output before and after NU5
This test currently fails with submitblock returning the error
"bad-heartwood-root-in-block".

Added authdigest to GBT coinbasetxn field because we can't obtain this
via getrawtransaction.

Co-authored-by: Jack Grigg <jack@z.cash>
2022-01-05 12:07:46 +00:00
Larry Ruane 1f223ebed7 assert that the return value of submitblock is None 2021-12-28 22:10:13 -07:00
Larry Ruane b538577359 test: Use result of getblocktemplate to submitblock
This will ensure that miners can use the values returned by
getblocktemplate (in particular, the block commitment hash)
to submit a valid block using the submitblock RPC.
2021-12-22 15:35:46 -07:00
Larry Ruane c937ba5ae5 getblocktemplate: add NU5 commitments to new `defaultroots` section
- merkleroot
- authdataroot
- chainhistoryroot
- blockcommitmentshash
2021-12-16 18:52:04 -07:00
MarcoFalke 818d2de39b [qa] Remove hardcoded "4 nodes" from test_framework
Zcash: Applied changes to our RPC tests.
2020-11-21 02:34:47 +00:00
mdr0id 10b25c2b53 Update py2 env path, remove py2 assert 2020-02-09 08:14:21 -08:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
mdr0id 4ca5def62f Make pythonisms consistent 2018-12-18 12:16:23 -08:00
Eirik Ogilvie-Wigley 25c13ef702 Add hashFinalSaplingRoot to getblocktemplate 2018-06-01 15:47:30 -06:00
Daira Hopwood aff0bf7fa1 Clean up imports to be pyflakes-checkable. fixes #2450
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-22 18:09:04 +01:00
Jack Grigg bc54cf06cc
Fix RPC test 2016-10-22 15:36:38 -05:00
Jack Grigg 07064ea2d1
GBT: Add RPC tests 2016-10-21 23:38:37 -05:00
Luke Dashjr bc6cb4177b QA RPC tests: Add tests block block proposals 2014-11-20 00:15:17 +00:00
Wladimir J. van der Laan b6c99efe9c
Merge pull request #5121
214091d Update license in pull-tester and rpc-tests (Michael Ford)
2014-10-27 13:48:45 +01:00
Daniel Kraft dcb98466b4 Extend getchaintips RPC test.
Add the capability to simulate network splits to the RPC test framework
and use it to do more extensive testing of 'getchaintips'.
2014-10-24 08:53:04 +02:00
Michael Ford 214091d584 Update license in pull-tester and rpc-tests
Add missing copyright/license header where necessary
2014-10-23 09:48:19 +08:00
Wladimir J. van der Laan b45a6e8394 Add test for getblocktemplate longpolling 2014-07-11 14:48:16 +02:00