Commit Graph

141 Commits

Author SHA1 Message Date
Matt Hauff
fe9b4aa318
Add condition opcodes for agg sigs to condition_codes.clib (#15889)
* Add condition opcodes for agg sigs to condition_codes.clib

* Add comment about hard fork

* pylint
2023-08-03 03:05:37 -05:00
Arvid Norberg
f0cb47baef
remove softfork2 logic (#15793) 2023-08-01 11:28:16 -05:00
Matt Hauff
12514717e3
Remove some old chialisp files (#15824)
* Remove some old chialisp files

* Fix mypy-exclusions.txt
2023-07-25 12:09:50 -05:00
Matt Hauff
217e81f478
Move some puzzles out of chia.wallet.puzzles (#15822) 2023-07-24 10:39:16 -05:00
Matt Hauff
80c07a7476
Remove references to old offer mod (#15694)
* Remove references to old offer mod

* Add guards in RPC against parsing old offers

* Fix benchmark test

* test coverage
2023-07-17 15:02:04 -05:00
Arvid Norberg
1e534d0281
pass consensus constants into get_name_puzzle_conditions(). (#15736)
pass consensus constants into get_name_puzzle_conditions(). This is required for tests that use alternate constants, such as fork activation heights
2023-07-11 09:52:49 -05:00
Matt Hauff
0bd6a8ac3b
Move CAT_MOD from cat_loader -> cat_utils (#15459)
Move CAT_MOD from chia.wallet.puzzles.cat_loader -> chia.wallet.cat_wallet.cat_utils
2023-06-06 19:13:11 -05:00
dustinface
b2cbea84d9
wallet: Hint puzzle_utils.py (#15422) 2023-06-06 12:39:15 -05:00
dustinface
9e9c75912f
full_node: Refactor get_puzzle_and_solution_for_coin (#15323) 2023-05-17 17:34:33 -05:00
Amine Khaldi
78713b8289
Merge commit 'f100cd2cdf2630b270b88fc03e63f64af50005af' into checkpoint/main_from_release_1.8.1_f100cd2cdf2630b270b88fc03e63f64af50005af 2023-05-09 11:34:09 +01:00
Arvid Norberg
f100cd2cdf
Softfork2 testing (#15204)
* update tests to use the new softfork2 height

* activate both softforks immediately on testnet
2023-05-04 16:14:15 -05:00
dustinface
aa40fa7f21
wallet: Drop AmountWithPuzzlehHash, use Payment instead (#15019) 2023-04-27 09:52:27 -05:00
Matt Hauff
e5b94d34a0
Chialisp file extensions (#14996)
* Rename chialisp file extensions

* Add pre-commit check for .clvm files

* Delete sha256tree files

* remove hash files in favor of central dictionary

* Add check for missing files like hex and hash entries

* Enhance clsp pre-commit check

* Actually check hash matches

* Update tools/manage_clvm.py

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

* Update tools/manage_clvm.py

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

* Fix Windows file writing

* Fix setup.py package_data fields

* Load hash dict at runtime

* Move away from exception pattern

* Bad equality check

* Minor fixes

* remove trailing whitespace fix

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-04-18 11:27:17 -05:00
dustinface
ed66308272
tests: Reuse puzzle_utils.make_create_coin_condition in test_puzzles (#15018) 2023-04-12 11:30:57 -06:00
Amine Khaldi
8afba0814d
Remove no longer needed cost_per_byte cases (#14850)
Remove no longer needed cost_per_byte cases.
2023-03-24 18:29:50 -05:00
Amine Khaldi
7acba82607
Merge commit 'f637881f80049f5648acd1936a2da936b5ca79a1' into checkpoint/main_from_release_1.7.1_f637881f80049f5648acd1936a2da936b5ca79a1 2023-03-24 14:36:57 +01:00
Arvid Norberg
8dbfc4840a
enable soft-fork2 conditions (incl. ASSERT_BEFORE) (#14733)
* enable soft-fork2

* add blockchain (consensus) test for time-lock conditions (non-ephemeral spend)

* introduce new soft-fork rule to compare ASSERT_SECONDS_* conditions against the previous transaction block's timestamp (to be consistent with ASSERT_HEIGHT_* conditions)

* bump chia_rs. This updates the mempool rules to disallow relative height- and time conditions on ephemeral coin spends

* implement assert_before in mempool_check_time_locks. Extend ephemeral coin test in blockchain with assert_before conditions

* implement support for assert_before conditions in compute_assert_height()

* support assert-before in mempool

* add timelock rule

* address review comments
2023-03-23 11:30:10 -05:00
Arvid Norberg
f637881f80
1.7.1 fixes (#14860)
* Zstdwjb (#80)

* limit decompression output size

* added test

---------

Co-authored-by: William Blanke <wjb98672@gmail.com>

* check MAX_GENERATOR_REF_LIST_SIZE earlier (#68)

* make INFINITE_COST more reasonable (#69)

---------

Co-authored-by: William Allen <wallentx@users.noreply.github.com>
Co-authored-by: William Blanke <wjb98672@gmail.com>
2023-03-21 00:20:53 -05:00
Kyle Altendorf
ff5ef6e073
remove leading newlines from indented code blocks (#14653)
* remove leading newlines from indented code blocks

* catch another one
2023-02-23 21:53:48 -06:00
Arvid Norberg
1b6201852a
bump chia_rs to 0.2.2 (#14533)
* bump chia_rs to latest version

* add new error codes for ASSERT_BEFORE_* condition failures, ASSERT_CONCURRENT_SPEND failing, ASSERT_CONCURRENT_PUZZLE_FAILED and for impossible constraints

* add new condition opcodes for ASSERT_BEFORE_*, ASSERT_CONCURRENT_SPEND and ASSERT_CONCURRENT_PUZZLE

* fixup Spend and SpendBundleCondition types

* fixup tests that otherwise fail with MINTING_COIN

* fix test that otherwise would fail with RESERVE_FEE_CONDITION_FAILED

* remove use of NO_NEG_DIV flag. It's now implied

* remove duplicate test parameters
2023-02-10 15:14:56 -06:00
Matt Hauff
59e389968e
Add cost logging to CLVM tests as fixture (#14444) 2023-02-10 15:13:45 -06:00
Amine Khaldi
5169f10e50
Merge commit '9cc25cc820accad778bf626500aedd299f62a825' into checkpoint/main_from_release_1.7.0_9cc25cc820accad778bf626500aedd299f62a825 2023-02-09 14:28:39 +01:00
Matt Hauff
9cc25cc820
Quex.offer mod tests (#14478)
* add test

* do some forwards compat stuff

* Add a forwards compat example

* fix test

* Add more forwards compat tests

* Add more forwads compat tests

* Add forwards compatibility for nft1s

* add forward compatibility for nft offers

* Add forwards compatibility tests for DL offers

* Update DL test offers

* lint

* isort

* offer mod bytes

* Fix compression test

* isort again

* Add special offers for <=3.7 (CATs)

* Add special offers for <=3.7 (NFT1s)

* Add special offers for <=3.7 (NFT0s)

* Add special offers for <=3.7 (DLs)

* Check for conflicting items during aggregation

* isort

* Return created old offers properly marked
2023-02-06 22:04:39 -06:00
Matt Hauff
97230ca3b0
Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -06:00
Arvid Norberg
68c9aafc0a
move SerializedProgram to its own file (#14391)
* move SerializedProgram into its own file (to fixup type annotations)

* fix type annotations for SerializedProgram

* fixup import statements for new SerializedProgram module
2023-01-27 17:20:23 -06:00
xdustinface
0cdce83b57
isort: Remove all tests exceptions and sort the related files 2022-12-05 02:06:00 +01:00
Kyle Altendorf
3b084a165b
configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00
Kyle Altendorf
789ee4f415
Add .clvm.hex pre-commit check (#12050)
* Add .clvm.hex pre-commit check

* report all results

* stuff

* maybe pass

* add todo

* explicitly define suffixes

* check for (and remove) extra hex and hash files

* remove garbage failure hex and hash files

* provide runner scripts

* matrix pre-commit checks

* maybe now

* more cross platform

* move it

* oops

* shell:

* maybe

* more configurable

* explicitly specify powershell

* tidy

* remove other stuff

* tidy

* remove existing pytest clvm hex etc checker

* add a trailing newline to decompress_block_spends.clvm.hex.sha256tree

* Update activated.ps1

* git config --global core.autocrlf false

* Update pre-commit.yml

* only check `chia/`

* typing_extensions

* typing_extensions

* removing unused typing import

* move top_level out of the rglob

* catchup dl clvm hex files

* Revert "catchup dl clvm hex files"

This reverts commit cd3d4f70b8.

* now
2022-09-12 16:08:55 -05:00
Kyle Altendorf
f19fc609e5
Merge branch 'main' into checkpoint/main_from_release_1.6.0_12fcaf0e982590efcf26a954c67cd760035d9e6e 2022-08-31 19:02:24 -04:00
Arvid Norberg
163552b8d9
Implement generator_for_single_coin() in python instead of clvm and apply quex' optimization to only computing the puzzle hash if the parent and amount matches (#13237) 2022-08-30 16:30:34 -05:00
Amine Khaldi
78a3c9c83a
Merge main into checkpoint/main_from_release_1.6.0_12fcaf0e982590efcf26a954c67cd760035d9e6e 2022-08-30 21:29:45 +01:00
Richard Kiss
18c40d6269
Calculate puzzle hashes directly, as an optimization. (#13034) 2022-08-30 14:25:42 -05:00
Amine Khaldi
aacad8fecf
Merge main into checkpoint/main_from_release_1.6.0_12fcaf0e982590efcf26a954c67cd760035d9e6e 2022-08-30 13:25:43 +01:00
Arvid Norberg
497679e97d
implement a more efficient Program.uncurry() (#13204) 2022-08-29 15:25:24 -05:00
Amine Khaldi
eeb2277955
Merge commit '12fcaf0e982590efcf26a954c67cd760035d9e6e' into checkpoint/main_from_release_1.6.0_12fcaf0e982590efcf26a954c67cd760035d9e6e 2022-08-29 17:45:49 +01:00
Arvid Norberg
5b56a562ed
cat_wallet mypy fixes (#12998)
* enable mypy for cat_utils

* mypy fixes for cat_wallet

* mypy fixes for cat_wallet.lineage_proof

* Update chia/wallet/cat_wallet/cat_utils.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-08-17 01:01:21 -05:00
Amine Khaldi
286fe8fb7c
Merge commit 'e5bc89e5b6ea36b9e1c65da7c13fdc96cfaae2dd' into checkpoint/long_lived_atari_from_main_e5bc89e5b6ea36b9e1c65da7c13fdc96cfaae2dd 2022-08-15 19:39:28 +01:00
Amine Khaldi
8e646dbacc
Merge commit 'd7dd977d9dd05382d08bea731177bc5edcb88013' into checkpoint/long_lived_atari_from_main_d7dd977d9dd05382d08bea731177bc5edcb88013 2022-08-15 15:34:06 +01:00
Amine Khaldi
27c5ba9f8f
Merge commit '72c8ba4a2923dace453be01b700a1cd6a118633a' into checkpoint/long_lived_atari_from_main_72c8ba4a2923dace453be01b700a1cd6a118633a 2022-08-15 12:58:03 +01:00
Amine Khaldi
e3fc8e4e05
Merge commit '2de8f7caac47fef5385031db777390f6e77b8862' into checkpoint/long_lived_atari_from_main_2de8f7caac47fef5385031db777390f6e77b8862 2022-08-14 13:21:00 +01:00
Matt Hauff
140bdbb491
CLVM tests 2022-08-01 09:06:30 -05:00
Kyle Altendorf
e5bc89e5b6
catchup: into main from long_lived/post_1.5.0 @ 916ccee549 (#12629)
* updated wallet name

* deprecated series

* swap to cat2

* updating .gitmodule to point to defender-gui

* Remove break (its preventing other sockets from getting data when earlier ones have an error) (#12241)

* Convert DID Wallet to use the new coin selection algorithm that the normal wallet and the CAT wallet already use (#12063)

* small type change

* use coin_selection.py with DID Wallet

use more efficient coin selection methods.

* Add special DID edgecase + fix int type

* Ms.fix coin selection (#12261)

* Fix coin selection bug

* Fix properly

* Fallback in cases of too many coins selected

* Also check for num coins

* Lint issues.

* Add another test

* No sorting, and faster knapsack

* Lint fix

* Remove comment and useless check

* Lint line

* Tx submission idempotance, and prioritize wallet (#12282)

* Tx submission idempotance, and prioritize wallet

* TODO comment

* Updating gui modules

* extend min_coin to rpc calls & cli for coin selection  (#12274)

* add tests to test if min_coin is working

they are passing, but no harm in being safe

* expand min coin amount across wallet.py

* extend to trade_manager

* add new options to rpc's

almost done lol.

* add min_coin_amount to wallet send

* make param non optional

alleviate None errors

* add cat wallet changes, rpc and all + fix a bug i accidentally made

oops

* Fix offer compression backwards compatibility

* bumping gui pin to head of release/1.5.0

* Calculate NFT royalty amount

* Create NFT wallet after the DID created (#12175)

* Bumping gui

* Show total amount to be paid for NFT offers

* Fix for NFT0 and NFT+Royalty detection suggested by quex

* Linter fix and formatting change

* Add RPCs for getting/extending the current derivation path index (#12472)

* Sleep to allow neworking layer to execute (#12463)

* Sleep to allow neworking layer to execute

* Add comment

* Added param to indicate how many additional phs create_more_puzzle_hashes should create. (#12493)

Account for range() not including last_index when `up_to_index` is provided.

* Fixed the wallet db rename from v2/v1 to v2_r1.
Removed vestigial code for dealing with the lite wallet db now that
we're syncing v2_r1 from scratch.

* When extending the derivation index, make sure we don't mark previously (#12513)

unused indices as used. This helps minimize gaps in the address space.

* Updating SBX asset ID

* Adding 1.5.0 changelog (#56)

* Adding 1.5.0 changelog

* Adding CVE fix

* Updating gitmodules (#57)

* Updating gitmodules

* Pinning gui

* black fixes

* mypy fixes

* xfail some run_block tests that need CAT2 update

* fix test

* Fix test based on series<->edition changes

* Drop EOL impish and hirsute (#12559)

(cherry picked from commit 189790ced2)

* Expand select_coins rpc  (#12360)

* change type to uint64, 128 is too big anyway

* add new options to select_coins endpoint

* oops

* add tests and finalize

* oops

(cherry picked from commit d5bf4d8b59)

* .resolve() for wallet db path tests in windows

* followup to actually fix the wallet db path tests

* Update .gitmodules

* Update wallet_node.py

* Update trade_manager.py

Co-authored-by: Sebastjan <trepca@gmail.com>
Co-authored-by: matt <matt@chia.net>
Co-authored-by: William Allen <wallentx@users.noreply.github.com>
Co-authored-by: wallentx <william.allentx@gmail.com>
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Jeff Cruikshank <jeff@chia.net>
Co-authored-by: Kronus91 <t.yu@chia.net>
Co-authored-by: Justin England <justin@chia.net>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
2022-07-29 16:58:21 -05:00
arty
d7dd977d9d
Bump clvm_tools_rs for bug fix (#11186)
* Bump clvm_tools_rs for bug fix

* Add test for fixed 0.1.7 bug in clvm_tools_rs

* Remove other tmp file

* formatting (i prefer single quotes in python, lint likes dbl)

Co-authored-by: wjblanke <wjb98672@gmail.com>
2022-07-26 11:58:05 -05:00
Freddie Coleman
72c8ba4a29
New RPC block_spends - Get spends for block using transaction generator (#12062)
* New RPC block_spends - Get spends for block using transaction generator (#10446)

* get spends for block using transaction generator

* type annotations and use existing function

* return None on exception

* parse to CoinSpend

* specify return type of get_block_spends in rpc client

* see what can be asserted

* test fix

* flags not necessary as we don't validate

* simplifying as cost is not required as we are not validating

* improve test to cover transaction generator ref_list

* simplify test

* remove unused import

* slight change and cleanup

* lint cleanup

* clean up

* wait until transaction is in mempool

* fix lint

Co-authored-by: Jack Nelson <jack@jacknelson.xyz>

* fix lint

Correct type and run lint checker

* switch to custom clvm

* add new puzzle

* curry and make better

* forgot to set linter to tools dir

* undo run_block changes

* Revert "curry and make better"

The tests do not like it

* correct tests

Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
2022-07-25 09:17:09 -05:00
Mariano Sorgente
2de8f7caac
optimize ph generation (~65% faster) (#12467)
* optimize ph generation

* Remove useless check

* More perf improvements

* G1 Elem not bytes

* Fix test

* Fix more tests

* Fix more more tests
2022-07-22 11:05:35 -05:00
Matt Hauff
920d73122b
Merge branch 'dl_generate_signed_transaction' into dl_offer_hooks 2022-07-20 14:26:29 -05:00
Matt Hauff
917a76b50e
Merge remote-tracking branch 'origin/long_lived/atari' into dl_to_nft_chialisp 2022-07-20 14:03:33 -05:00
Richard Kiss
a7462f66e9
Add Program.replace. (#12362) 2022-07-15 13:11:56 -05:00
Richard Kiss
3d5fed439d
Add Program.replace. 2022-07-15 11:32:47 -05:00
Amine Khaldi
9d4a66287c
Merge commit '3c2fc1947df311aa80130a0f60288547cf09250d' into checkpoint/long_lived_atari_from_main_3c2fc1947df311aa80130a0f60288547cf09250d 2022-07-14 20:36:30 +01:00