Commit Graph

1202 Commits

Author SHA1 Message Date
Henry de Valence dda0d2dd41 Remove check_block
Per discussion where @yaahc suggested that it would be simpler to delete this function entirely and treat it as an implementation detail.

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-08-21 16:38:33 -04:00
Jane Lusby 7dcac97d0b Update book/src/dev/rfcs/XXXX-asynchronous-script-verification.md
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-08-21 16:38:33 -04:00
Henry de Valence a3a4ba858a Add async script RFC 2020-08-21 16:38:33 -04:00
teor 6a3615e039
fix: Commit sled state in a transaction (#933)
Fixes a race condition between the height and hash tree updates, when
they are executed simultaneously with GetDepth. `get_tip` uses the height
tree, but `get` uses the hash tree.
2020-08-21 12:36:00 -07:00
teor 3400b72699 fix: Make the start acceptance tests stricter 2020-08-21 07:22:53 +10:00
teor 02e6027c57 refactor: Remove duplicate acceptance test code 2020-08-21 07:22:53 +10:00
teor 1e0e4914a0 fix: Improve an acceptance test failure message
If the tests conflict with a local zebrad, zcashd, or other tests, they
need to be run with a custom config, or in an isolated environment.
2020-08-21 07:22:53 +10:00
teor b8e8d4f548 fix: Remove some deeply-nested instrument spans
Closes #923.
2020-08-20 14:52:39 -04:00
teor 9a8af731b1 fix: Remove redundant ConsensusBranchId constants 2020-08-20 14:52:09 -04:00
teor 5afa24588a fix: Remove unused dependencies 2020-08-20 14:49:17 -04:00
Alfredo Garcia d349f2bbc2
Refactor acceptance serialized_tests (#920)
* add network listening address to default config
2020-08-20 07:48:22 +10:00
Jane Lusby 1d6183ef84
Make zebra-script wrap the C++ script implementation in zcashconsensus (#708)
* attempt to use zcashconsensus crate in zebra-script

* boop

* update verify fn to use zebra types

* a bit more cleanup

* cleanup

* more

* beep boop

* fix renamed member

* cleaning

* get a real branch id

* remove as of yet unneeded api

* Update zebra-chain/src/transaction.rs

* Update zebra-chain/src/transaction.rs

* more cleanup

* oops wrong dep section

* use a tuple to communicate arg association

* update to use published version of zcash_script

* fix new compiler error

* install llvm on windows

* fix bindgen bug????

* try to get docker file to win

* okay try everything

* fix windows build maybe

* always download choco

* fix paths for moved types

* try a different error message

* try convenience script

* try installing just llvm

* add back one more

* try installing some headers

* try a diff package

* try everything

* remove the minimum

* try newer docker builder image

* cleanup docker image

* cleanup extra ci step
2020-08-18 11:08:53 -07:00
Alfredo Garcia 8539302ad8 rename checks to check 2020-08-18 11:03:40 -07:00
Alfredo Garcia 4dac4d4df7 move `is_coinbase_first` from chain to consensus 2020-08-18 11:03:40 -07:00
dependabot[bot] e67d3fc5e3 build(deps): bump codecov/codecov-action from v1.0.12 to v1.0.13
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.0.12 to v1.0.13.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.0.12...6004246f47ab62d32be025ce173b241cd84ac58e)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-18 06:43:03 -04:00
Henry de Valence d63562994d deps: Update x25519-dalek, ed25519-zebra 2020-08-17 20:47:48 -07:00
dependabot[bot] 982f59b30d
build(deps): bump proptest from 0.10.0 to 0.10.1 (#913)
Bumps [proptest](https://github.com/altsysrq/proptest) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/altsysrq/proptest/releases)
- [Changelog](https://github.com/AltSysrq/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/altsysrq/proptest/compare/0.10.0...v0.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-17 14:19:34 -07:00
Henry de Valence 177d38e176 utils: prevent accidental publication. 2020-08-17 12:47:32 -07:00
Henry de Valence 455f91501d doc: exclude zebra-utils, zebra-checkpoint.
These are internal-only crates for development.
2020-08-17 12:47:32 -07:00
Henry de Valence 8e15c16b42 chain: TransparentAddress -> transparent::Address 2020-08-17 11:46:34 -07:00
Henry de Valence ebdceb5197 chain: rename TransactionHash to transaction::Hash 2020-08-17 11:46:34 -07:00
Henry de Valence d49d3d2b30 chain: tweak docs for JoinSplitData, ShieldedData 2020-08-17 11:46:34 -07:00
Henry de Valence 5c176d2f96 chain: move JoinSplit to sprout 2020-08-17 11:46:34 -07:00
Henry de Valence 1fc859d0c5 chain: move Spend, Output into sapling
The ShieldedData container for the spend and output descriptions of a
transaction does *not* move, because it's encoding transaction
structure.  A good sign that this is the right factoring is that the
transaction module now only needs to pull in sapling::{Spend, Output}
and not all the internals.
2020-08-17 11:46:34 -07:00
Henry de Valence d945cd28e8 chain: move Transparent{Input,Output} to transparent
Also bring the `Script` type there too.
2020-08-17 11:46:34 -07:00
Deirdre Connolly 25f63518f4 Allow clippy::unit_arg because of derive(Arbitrary) 2020-08-17 11:46:34 -07:00
Henry de Valence d57390d265 chain: doc tweaks (mostly block::) 2020-08-17 11:46:34 -07:00
Henry de Valence 94d6d448bb chain: rename to block::merkle::{Root, Tree}. 2020-08-17 11:46:34 -07:00
Henry de Valence 2712c4b72a chain: rename BlockHeader to block::Header 2020-08-17 11:46:34 -07:00
Henry de Valence 103b663c40 chain: rename BlockHeight to block::Height 2020-08-17 11:46:34 -07:00
Henry de Valence 61dea90e2f chain: rename BlockHeaderHash to block::Hash
This is the first in a sequence of changes that change the block:: items
to not include Block as a prefix in their name, in accordance with the
Rust API guidelines.
2020-08-17 11:46:34 -07:00
Henry de Valence 04ba696515 chain: remove block::block 2020-08-17 11:46:34 -07:00
Henry de Valence 9766d32fa6 chain: touch up amount docs 2020-08-17 11:46:34 -07:00
Henry de Valence d0ee7a9961 chain: amount::AmountConstraint -> amount::Constraint 2020-08-17 11:46:34 -07:00
Henry de Valence fd548592bf chain: remove clippy::try_error annotation 2020-08-17 11:46:34 -07:00
Henry de Valence dcc1e19129 chain: touch up docs 2020-08-17 11:46:34 -07:00
Henry de Valence ce1e81b274 chain: move merkle_tree to block::merkle.
This Merkle tree is the SHA256d one used only for including transactions
in a block, so it should be kept there in order to not be confused with
other Merkle trees (like the note commitment trees).
2020-08-17 11:46:34 -07:00
Henry de Valence 7298e7c636 chain: create a transparent module. 2020-08-17 11:46:34 -07:00
Henry de Valence e8f923ec86 chain: move Memo into transaction 2020-08-17 11:46:34 -07:00
Henry de Valence 312c66264a chain: extract sprout code into sprout module. 2020-08-17 11:46:34 -07:00
Henry de Valence e06f59ee21 chain: extract sapling code to sapling module 2020-08-17 11:46:34 -07:00
Henry de Valence c5a8cb0c91 chain: create primitives module.
This contains definitions of primitive types used in other structures
and re-exports of component libraries.
2020-08-17 11:46:34 -07:00
Henry de Valence 196e841cd9 chain: rename LightClientRootHash to RootHash
It's not accurate to call it a LightClientRootHash, because it's not
always a root has for a light client -- sometimes it's a different kind
of root hash.
2020-08-17 11:46:34 -07:00
Henry de Valence b296d1e2a3 chain: move Block into a leaf module.
This might make things a little easier to rearrange.  In the future it
would probably be good to change to block::Hash, block::Header, etc.
2020-08-17 11:46:34 -07:00
Henry de Valence 948b067808 chain: move Network, NetworkUpgrade to parameters
Also, avoid using star-imports of the enum variants, which pollutes the
namespace.
2020-08-17 11:46:34 -07:00
Henry de Valence 64d9d55992 chain: organize block tests
This moves the tests::generate module into the block tests.  Because
this whole set of changes is just focused on reorganization, the
generate code is unchanged, but in the future, the code should be
rewritten as a collection of proptest strategies.
2020-08-17 11:46:34 -07:00
Henry de Valence 855b89dec4 chain: create a new work module for proof-of-work
This extracts the `difficulty` module from `block` and the
`equihash_solution` module from the crate root.  The PoW calculations
are significantly more complicated than the other block code and pretty
dissimilar from it, so it makes more sense to create a common proof of
work module.

The `EquihashSolution` and `EQUIHASH_SOLUTION_SIZE` are renamed to
`equihash::Solution` and `equihash::SOLUTION_SIZE` and imported that
way, except in `block/header.rs`, to avoid a conflict with the
`equihash` crate.  In the future it would be better to encapsulate the
equihash solution check into the `equihash::Solution` type so that
callers only need to import our `work::equihash`.

The test organization leaves a little to be desired but I think that
this can be improved as we fill out the proof of work implementation.
2020-08-17 11:46:34 -07:00
Henry de Valence dad6340cd3 chain: move BlockHeight into block 2020-08-17 11:46:34 -07:00
Henry de Valence 5f71bcd0d1 chain: move LockTime into transaction 2020-08-17 11:46:34 -07:00
Henry de Valence 8e9a239687 chain: clean transaction tests module.
This moves the transaction strategies to `arbitrary`, to live with the
other strategy impls (`Arbitrary` is just a default type-associated
strategy), splits the proptests into a new `prop` module, and splits the
test vector checks into a `vector`s module.

This ensures that we keep code in leaf modules and only have
organization (use statements) in non-leaf modules.
2020-08-17 11:46:34 -07:00