Commit Graph

5398 Commits

Author SHA1 Message Date
ar 0ba36dd1a1 cache pool value balances by height 2024-09-20 16:24:13 -04:00
ar 56ae48f635 Use a single query to check for unspent outputs in the mempool 2024-09-17 16:20:43 -04:00
Arya 6c233f4b37 Replaces placeholder setup channel with one that sends the mempool svc to the tx verifier, adds a timeout layer, adds a TODO about a concurrency bug 2024-09-16 20:21:08 -04:00
Arya b520d7b83c updates tests 2024-09-16 20:07:53 -04:00
Arya 520660f3dd updates block template construction to avoid including transactions unless their dependencies have already been added. 2024-09-16 20:03:29 -04:00
Arya bc981c0736 Adds transaction dependencies to the `FullTransactions` response, let the caller handle it (required to avoid moving zip317 tx selection code to mempool) 2024-09-16 19:47:40 -04:00
Arya 695a258093 fixes doc links 2024-09-16 18:34:52 -04:00
ar a8389344bb removes unused `len()` method 2024-09-16 17:47:52 -04:00
ar aed637ac0b appeases clippy. 2024-09-16 17:01:21 -04:00
ar 29654b4207 updates tests 2024-09-16 16:48:29 -04:00
ar bebe50ef1d Remove dependent transactions from verified set when removing a tx 2024-09-16 16:30:56 -04:00
ar 61e6e21272 prune pending outputs when rejecting and removing same effects. 2024-09-16 16:18:38 -04:00
ar ae87a27974 replaces `UnminedTxId` type with `transaction::Hash` in mempool's verified set 2024-09-16 16:07:33 -04:00
Arya 2fc7829f0d Adds `pending_outputs` field on mempool Storage and responds to pending outputs requests when inserting new transactions into the mempool's verified set 2024-09-07 00:53:08 -04:00
Arya 0a72b41db7 polls mempool svc from tx verifier when a mempool tx that creates transparent outputs has been verified.
adds a TODO for adding a `pending_outputs` field to the mempool Storage
2024-09-07 00:18:15 -04:00
Arya d0b2d41de1 Adds transaction dependencies when inserting a tx in `VerifiedSet` 2024-09-07 00:06:54 -04:00
Arya 90812b1ff3 Updates `Storage.insert()` to accept a list of spent mempool transaction outputs 2024-09-06 23:01:04 -04:00
Arya be6fd7b556 Updates mempool `Downloads` to return the spent_mempool_outpoints from the tx verifier response 2024-09-06 22:57:14 -04:00
Arya cbb34e646a Adds `spent_mempool_outpoints` as a field on tx verifier mempool response 2024-09-06 22:50:01 -04:00
Arya c9c0a1102e Updates `spent_utxos()` to query the mempool for unspent outputs 2024-09-06 22:36:39 -04:00
Arya 745e6a7836 Adds a TODO, updates field docs 2024-09-06 21:49:15 -04:00
Arya e60197c59c updates `created_outputs` when inserting or removing a transaction from the mempool's verified set 2024-09-06 21:44:18 -04:00
Arya ecc2dddf79 Updates mempool service and its `Storage` to use the updated `VerifiedSet` `transactions()` return type. 2024-09-06 21:11:15 -04:00
Arya 5c7f45b8b8 Updates VerifiedSet struct used in mempool storage 2024-09-06 21:01:17 -04:00
Arya 77aa2e325e updates transaction verifier's poll_ready() method to setup the mempool service handle. 2024-09-06 20:34:50 -04:00
Arya 3c05b035a3 Adds TODOs 2024-09-03 23:02:05 -04:00
Arya 174f4ea280 Removes `Clone` impl on `transaction::Verifier` to add mempool oneshot receiver, updates tests. 2024-09-03 22:54:25 -04:00
Arya 85fdd88d84 Adds a `mempool` argument to the transaction::Verifier constructor (and a `new_for_tests()` constructor for convenience) 2024-09-03 22:40:19 -04:00
Arya fde3370980 Adds a parameter to `zebra_consensus::router::init()` for accepting a mempool setup argument, adds and uses an `init_test()` fn for passing a closed channel receiver in tests where no mempool service is needed in the transaction verifier. 2024-09-03 22:25:42 -04:00
dismad e9bbb97473
Update README.md (#8824)
typo
2024-09-03 13:43:57 +00:00
Marek f2427d62e6
add(docs): Add minimal hardware requirements (#8822)
* clean-up: Remove outdated note

* Add minimal hardware requirements

Source & credit: https://x.com/Zerodartz/status/1811460885996798159

* Apply suggestions from code review

Co-authored-by: Arya <aryasolhi@gmail.com>

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2024-09-03 13:43:51 +00:00
Marek 5541b27a12
Remove `shielded-scan` from experimental features (#8827) 2024-09-03 10:04:36 +00:00
Marek 9a616f46a5
fix(deps): Replace `serde_yaml` by `serde_yml` (#8825)
* Use `serde_yml` instead of `serde_yaml`

* Regenerate `openapi.yaml`
2024-09-02 19:00:26 +00:00
Arya 6b95d271d8
fix(rpc): Return verification errors from `sendrawtransaction` RPC method (#8788)
* Adds a mempool request to wait for a transaction verification result and uses it in `sendrawtransaction` RPC method

* removes unnecessary clone

* fix clippy warnings

* returns verification errors for all `mempool::Queue` requests, removes `QueueRpc` request variant

* returns oneshot channel in mempool::Response::Queue

* updates a test vector to check for download or verification error in mempool::response::Queued result receiver

* Always require tokio as a dependency in zebra-node-services

* checks for closed channel errors in sendrawtransaction and updates a prop test to check that verification errors are propagated correctly
2024-08-30 20:09:10 +00:00
Arya 0ef9987e9e
fix(state): Write database format version to disk atomically to avoid a rare panic (#8795)
* Splits `atomic_write_to_tmp_file` out of `zebra_network::Config::update_peer_cache`

* Uses the new `atomic_write_to_tmp_file` fn in `update_peer_cache()`

* Replaces repetitive code for getting the default peer and state cache directories with `default_cache_dir()`

* Converts `atomic_write_to_tmp_file` to a blocking function and adds `spawn_atomic_write_to_tmp_file` for use in async environments.

* Uses `atomic_write_to_tmp_file` to write database versions to disk

* Removes `spawn_atomic_write_to_tmp_file()` and inlines its body at its callsite to avoid adding tokio as a dependency of zebra-chain.

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

---------

Co-authored-by: Marek <mail@marek.onl>
2024-08-29 21:09:27 +00:00
Gustavo Valverde cdb9efdb27
fix(docker): allow the `zebra` user access to relevant dirs (#8817)
* fix(docker): allow the `zebra` user access to relevant dirs

When runnning a Zebra node using Docker without a privileged user, you won't be able to modify some files and directories, not even the ones in the current directory, as the `zebra` user has no permission to `/`.

The best way to solve this is making the `/opt/zebrad` the current `WORKDIR`. This also requires moving the `entrypoint.sh` from the root `/` directory to `/etc/zebrad` as this directory is used to save configuration, and other files.

An `APP_HOME` ARG is used as not all platforms where a Docker container is deployed allows writting permissions to the `/opt` directory. This allow some users to re-build the image with a custom `WORKDIR`

* fix(docker): allow starting the container without a `zebrad` command

As `gosu` is just required and available in our `runtime` image, trying to run `docker run -it --rm  --name tests -t zfnd/zebra:<pr> /bin/bash` in other stages will fail, as `gosu` is not available.
2024-08-29 19:57:17 +00:00
Arya bf4d253897
Updates checkpoints (#8811) 2024-08-28 01:41:28 +00:00
Arya 8b1be8846e
chore: Release v1.9.0 (#8734)
* Updates `EOS_PANIC_AFTER` end of support constant from 16 weeks to 14 weeks, so the Mainnet panic height is just before the second halving and end of the current dev fund.

* version bumps

* Updates CHANGELOG.md

* Updates changelog

* updates end of support time to 10 weeks

* Adds a note to the changelog about recovering after finalizing blocks from a fork

* Add new changes on main to CHANGELOG.md

* Updates ESTIMATED_RELEASE_HEIGHT

* Apply suggestions from code review

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Update zebrad/src/components/sync/end_of_support.rs

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2024-08-28 01:07:37 +00:00
Arya adde5c92f3
change(consensus/network): Updates `CURRENT_NETWORK_PROTOCOL_VERSION` and adds an NU6 activation height on Testnet (#8804)
* Updates CURRENT_NETWORK_PROTOCOL_VERSION and adds an NU6 activation height on Testnet

* Updates post-NU6 funding stream start height on Testnet

* updates snapshots

* updates snapshot
2024-08-27 23:24:33 +00:00
Alfredo Garcia 6922e7126c
build(deps): Upgrade ECC dependencies (#8810)
* upgrade ECC depenencies

* update deny.toml
2024-08-27 23:24:28 +00:00
Gustavo Valverde ec85aa8a48
fix(docker): add `gosu` and remove unsupported flag in `adduser` (#8808)
* fix(docker): typo and uknown option in debian

* fix(docker): use `gosu` for rootless execution

Some of our entrypoint commands requires creating directories and files in places a non-privileged user can't access.

So we use `gosu` to step down from `root` to a non-privileged user during container startup, right at our application execution.
2024-08-27 21:29:50 +00:00
Gustavo Valverde 0d36681d8f
fix(docker): do not run the Zebra nodes with the root user (#8803) 2024-08-27 11:55:24 +00:00
dependabot[bot] cdf73b2c26
build(deps): bump the devops group with 3 updates (#8789)
Bumps the devops group with 3 updates: [google-github-actions/auth](https://github.com/google-github-actions/auth), [tj-actions/changed-files](https://github.com/tj-actions/changed-files) and [codespell-project/actions-codespell](https://github.com/codespell-project/actions-codespell).


Updates `google-github-actions/auth` from 2.1.4 to 2.1.5
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v2.1.4...v2.1.5)

Updates `tj-actions/changed-files` from 44.5.2 to 45.0.0
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v44.5.2...v45.0.0)

Updates `codespell-project/actions-codespell` from 2.0 to 2.1
- [Release notes](https://github.com/codespell-project/actions-codespell/releases)
- [Commits](https://github.com/codespell-project/actions-codespell/compare/v2.0...v2.1)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: devops
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: devops
- dependency-name: codespell-project/actions-codespell
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: devops
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 11:38:14 +00:00
Gustavo Valverde 6cf34b25ff
feat(docker): Add SBOM and provenance attestations (#8802)
This adds metadata about the contents of our image, what it contains, and how it was built.
2024-08-26 17:56:09 +00:00
Tomek Piotrowski 37de457f2b
build(deps): make librustzcash crates workspace dependencies (#8792)
* build(deps): make librustzcash crates workspace dependencies

Fixes #8791

* add duplicated dependencies to deny.toml
2024-08-24 00:55:57 +00:00
Alfredo Garcia cccf98bbfa
fix sample configurations in the custom testnet book documentation (#8794) 2024-08-21 21:11:54 +00:00
Alfredo Garcia 79f565cd34
fix openapi tool output order (#8785) 2024-08-20 22:13:34 +00:00
Arya 9fbcb4ccd2
Updates ignored failure messages in lightwalletd_integration test (#8784) 2024-08-20 22:13:29 +00:00
Arya 0ecc5eb900
Updates `protocol::Version::min_specified_for_upgrade()` with likely NU6 protocol versions (#8733) 2024-08-20 18:57:09 +00:00
Alfredo Garcia bcd66ad71e
docs(fix): `reject_and_remove_same_effects` docs is wrong (#8776)
* update docs for `reject_and_remove_same_effects`

* Apply suggestions from code review

Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>

---------

Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-20 17:43:41 +00:00