Commit Graph
1095 Commits
Author SHA1 Message Date
Kyle Altendorf 7079391a38 drop the root node type, internal or leaf might be the root 2024-05-14 21:04:55 -04:00
Kyle Altendorf a622b13cce just RawLeafMerkleNode.key_value 2024-05-14 20:34:04 -04:00
Kyle Altendorf b85c3fbdeb NewTypes and other 2024-05-14 20:27:54 -04:00
Kyle Altendorf 2468b519b7 raw node [de]serialization tests 2024-05-14 11:00:25 -04:00
Kyle Altendorf c7e697e857 add chia.data_layer.util.merkle_blob 2024-05-14 09:56:22 -04:00
Kyle Altendorf 98df4ce222 change datalayer python and logging from tree id to store id (#17864)
* change python and logging from tree id to store id

* always more

* oops

* again

* and...

* comment

* more
2024-05-10 13:45:45 -07:00
Florin ChiricaandKyle Altendorf 6c25d3a184 Optimize DL autoinserts. (#17883)
* Optimize DL autoinserts.

* Lint.

* Improve tests.

* update root history references

* Stress test benchmarks.

* Try with low limit first.

* Try without -k

* Gather more data.

* Run only benchmark.

* Remove exception.

* Increase limit

* Increase limit.

* Increase timeout

* Add new benchmark.

* Increase timeout.

* Timeouts.

* Increase timeout

* Revert stress test.

* Use the correct limit

* Update test.

* Add option to disable the optimization.

* Revert optimisation in offers.

* Test all cases properly.

* Apply suggestions from code review

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Improve case handling.

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-05-09 08:55:51 -05:00
Matt Hauff aefe7fdf28 Observer Mode (#17792)
* Observer Mode

* Address comments by @altendky

* Change RPC default and fix test coverage

* Add test coverage for rpc marshaller

* Fix @marshal util to return proper transactions
2024-05-07 13:39:25 -07:00
80880bfa71 DL Multistore batch update. (#17806)
* Multistore batch update.

* Lint

* Lint.

* Add test.

* Update data_layer_rpc_api.py

* Read from 'transactions' instead of 'tx_records'

* Fix test.

* Improve coverage.

* Submit all pending roots.

* Lint.

* Revert debug change.

* Add fee.

* Fix fee test.

* Update chia/cmds/data_funcs.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Address review comments.

* Lint.

* Refactor RPC.

* Apply suggestions from code review

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Improve coverage

* Lint

* Update data_layer_rpc_api.py

---------

Co-authored-by: Matt <quexington@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-04-26 08:05:30 -07:00
Florin Chirica a441eb1db7 DL migrate DB. (#17814)
* DL migrate DB.

* Add test.

* Add get_keys to the test.

* Skip mypy for dynamic classmember.

* Mypy.

* Black.

* Update data_store.py

* Add unknown version test.
2024-04-09 14:23:12 -07:00
Kyle Altendorf 7c65c4363b fix other cases as well 2024-04-01 13:36:52 -04:00
Amine Khaldi 105f07167a Speedup clean_node_table by leveraging relaxed foreign_keys (#17769)
* Speedup clean_node_table by leveraging relaxed foreign_keys.

* Present an attempt to address the delete_store_data scenario.
2024-03-27 12:39:54 -07:00
Florin Chirica 1879faea40 Don't download DL existing DAT files. (#17730)
* Don't download DL existing DAT files.

* Lint.

* Try to improve coverage.
2024-03-27 09:33:26 -07:00
Amine Khaldi 22608088e1 Optimize clean_node_table's query (#17779)
Optimize clean_node_table's query.
2024-03-27 09:15:43 -07:00
Amine Khaldi 5350428eb1 Speedup leaf_hash in data_layer_util.py (#17759)
Speedup leaf_hash in data_layer_util.py.
2024-03-25 08:45:52 -07:00
Amine Khaldi cd6f4f56de Speedup key_hash in data_layer_util.py (#17758)
Speedup key_hash in data_layer_util.py.
2024-03-25 08:45:37 -07:00
Earle Lowe 08710b9acc Really fix Data layer download banning (#17664) 2024-03-25 08:30:34 -07:00
Earle LoweandAmine Khaldi f5aa40a181 Optimize insert/upsert/delete by using get_node_by_key (#17765)
* Optimize insert/upsert/delete by using get_node_for_key

* Add a unit test for insert's key already present code path.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-03-25 08:30:18 -07:00
Earle Lowe ab555bfb80 Some proof optimizations - use get_ancestors_optimized (#17665)
* Some proof optimizations - use get_ancestors_optimized

* avoid using ancestors_optimized in DL Offers flow
2024-03-25 08:29:54 -07:00
Florin ChiricaandAmine Khaldi d4948afc94 Optimize DL get key by node. (#17680)
* Optimize DL get key by node.

* Fix KeyNotFoundError case.

* Update index name.

* Improve the exception check in test_get_node_by_key_with_overlapping_keys.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-03-15 09:19:38 -07:00
Earle Lowe 48e4039e58 Update black to 24.1.1 and update source as needed (#17499)
* Update source to black 24 spec

* update black to 24.1.1

* update pylint to ignore multiple-statements

* update test file

* black updates

* format updates

* Update test_network_protocol_files.py

* Update test_network_protocol_files.py
2024-03-13 11:08:19 -07:00
Amine Khaldi 5d8a917448 Merge commit 'd3d0f1b9810309c81881718e44edda27d4a62d24' into checkpoint/main_from_release_2.2.0_d3d0f1b9810309c81881718e44edda27d4a62d24 2024-03-01 11:45:02 +01:00
Kyle Altendorf 151d3555e0 use QueuedAsyncPool for DataLayer.periodically_manage_data() subscription handling (#17550)
* preliminary `AsyncPool`

* touchup

* use `AsyncPool` for `DataLayer.periodically_manage_data()` subscription handling

* fix

* tweak

* more

* test worker exception logging

* ignore

* add `QueuedAsyncPool`

* use `QueuedAsyncPool`

* fix

* cleanup

* tidy

* fixup

* fixup

(cherry picked from commit 484f34044d)

* Update data_layer.py

* fixup test coverage
2024-02-27 15:42:19 -08:00
Florin ChiricaandKyle Altendorf 368fecc17e DL multiple batch updates. (#17414)
* DL multiple batch updates.

* Lint.

* Lint.

* Add RPCs.

* Lint

* Lint

* Lint

* Add test.

* Lint.

* Add publish pending root option.

* Improve test.

* Fix cmd.

* Lint.

* Fix test

* Revert

* Add test.

* More tests.

* Improve test.

* Apply suggestions from code review

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Lint.

* Test.

* Latest local root.

* Change publish to submit.

* More submit instead of publish.

* Coverage.

* Lint.

* Improve coverage.

* Lint.

* Lint.

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-02-23 09:56:00 -08:00
Kyle Altendorf 821910b1b3 avoid datalayer manage data loop delay for self subscriptions (#17536) 2024-02-16 10:16:23 -08:00
Earle Lowe d3d0f1b981 Use Datalayer banning logic for HTTP download failures (#17515)
* use server_missed_file when http download fails

* Add test that we ban servers on http download failure
2024-02-14 11:09:46 -08:00
Florin ChiricaandKyle Altendorf fa220629ec DL RPC pagination. (#17347)
* DL RPC pagination.

* Lint.

* Lint.

* Add RPCs.

* Lint.

* Lint.

* Add test.

* Lint.

* Add root_hash.

* Coverage.

* Fix bug.

* Update chia/cmds/data.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Dedupe.

* Lint.

* Add reference dict to test.

* Fix test.

* Fix test.

* Fix test.

* Fix test.

* Lint.

* Fix test

* Lint

* Remove short option.

* Add test.

* Lint.

* Update tests/core/data_layer/test_data_rpc.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-02-14 11:08:20 -08:00
Amine Khaldi 71166f18c8 Augment match_dl_singleton to accept both types of puzzles (#17520)
Augment match_dl_singleton to accept both types of puzzles.

This allows us to use serialized programs without the need to convert them into programs.
2024-02-12 10:05:09 -08:00
Matt HauffandAmine Khaldi 76bb49c4fd Return TXs from CATWallet and Offer creation (#17506)
* Don't autopush transactions by default anywhere

* Remove ignore_max_send_amount

* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins

* Unify transaction pushing into a single method

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount

* Return offer transactions from create_offer_for_ids

* Return transaction list from CATWallet.create_new_cat_wallet

* Missed an instance in a newer test

* Missed an instance in a newer test

* Simplify processing some transaction records.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-02-08 09:04:49 -08:00
StartToaster e553c45485 checkpoint: into main from release/2.2.0 @ 63417e765a (#17494)
Source hash: 63417e765a
Remaining commits: 2
2024-02-05 15:28:36 -08:00
Matt Hauff c6f1a57c56 Unify transaction pushing (#17458)
* Don't autopush transactions by default anywhere

* Remove ignore_max_send_amount

* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins

* Unify transaction pushing into a single method

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount

* Inadvertent changes

* Test fixes

* Inadvertent change

* Bad import?

* Inadvertent changes?

* readd missing test
2024-02-05 10:34:47 -08:00
Amine Khaldi f8777ed559 Merge commit '63417e765aaff91fb30485577f86a4af55aba029' into checkpoint/main_from_release_2.2.0_63417e765aaff91fb30485577f86a4af55aba029 2024-02-05 18:47:03 +01:00
Earle LoweandKyle Altendorf 63417e765a Add support for generating and verifying DataLayer Proofs of Inclusions (#16845)
* initial implementaion of get_proof and verify_proof for datalayer

* Add wallet RPC and stop using offer blobs

* Don't require DL wallet to validate DL proof

* Convert to dl_verify_proof to free function

* More updates to DL proofs get/verify

* More updates to DL proofs get/verify

* More updates to DL proofs get/verify

* remove some unused verification functions

* oops deleted some important things

* fix type

* Add tests for DL proofs

* WIP using streamable classes for RPC

* Tests pass with new serializable classes

* use clvm tree hash calls instead of magic numbers and std_hash

* expanded tests to include more ways to call the same thing

* minor tests updates from feedback

* add in CLI tests

* Add separate create_multiple_keys_option

* Add helper and fixup key option

* Update tests/core/data_layer/test_data_rpc.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Add layer of indirection for the proof response

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-02-05 08:35:28 -08:00
Matt Hauff aeecaca663 Remove ignore_max_send_amount (#17418)
* Remove ignore_max_send_amount

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount
2024-01-29 14:31:42 -08:00
StartToaster c4eea85b72 Remove Announcement class in favor of Condition subclasses (#17377)
Recreation of PR #16384

checkpoint: into main from long_lived/vault @
f96aaee604
Remaining commits: 16
2024-01-29 10:49:12 -08:00
Arvid Norberg fdd480dfb3 use rust implementation of CoinSpend (#17408) 2024-01-29 10:03:57 -08:00
Matt 9a44ca926d Merge commit 'f96aaee604072b83c9aae7bcb03a1e3856f4b4cc' into HEAD 2024-01-22 09:59:43 -08:00
Florin Chirica 41c69f5144 DL Compress get_keys_values output by hash. (#17243)
* DL Compress get_keys_values output by hash.

* Lint.

* Lint.

* Lint.

* Remove get_node from delete.
2024-01-12 09:41:00 -06:00
Florin Chirica 42d9048a79 DL upsert. (#17011) 2023-12-19 11:48:49 -06:00
Florin Chirica ebf0c00a21 DL: Use unsubscribe queue to relax subscriptions lock. (#17068) 2023-12-19 10:59:27 -06:00
Arvid NorbergandKyle Altendorf 799f3b2ea2 fix type hints in data layer (#17062)
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-12-15 09:58:58 -06:00
Arvid Norberg 2cc03be2fb SerializedProgram updates (#16926) 2023-12-14 12:53:43 -06:00
Amine Khaldi f6a7395def Merge commit 'cfab3a407d832fff5b7f966bf447f0dd92bf9e22' into checkpoint/main_from_release_2.1.2_cfab3a407d832fff5b7f966bf447f0dd92bf9e22 2023-12-11 16:56:40 +01:00
Earle Lowe cfab3a407d Adjust ban times for DL dat files (#17021) 2023-12-08 15:40:44 -06:00
Florin Chirica cb6e1d7c6d Don't allow DL mirrors with empty urls. (#16969) 2023-12-07 14:02:03 -06:00
Kyle Altendorf 99ee3e4c34 add DataStore.managed() (#16890) 2023-12-05 13:31:30 -06:00
Florin ChiricaandKyle Altendorf 53519801fb DL: remove data from DB on unsubscribe (#16786)
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-11-28 17:46:26 -06:00
Florin Chirica d80b751850 DL: delete full files for when subscribed to a datastore per config (#16850) 2023-11-27 12:18:39 -06:00
Kyle Altendorf 576ec7c08c datalayer just manage (#16756) 2023-11-21 17:13:47 -06:00
Arvid Norberg 5ab1721cff clean up SpendBundle class (#16808) 2023-11-16 19:21:28 -06:00