Commit Graph

52 Commits

Author SHA1 Message Date
Arvid Norberg
21fb6f260e
transition to using chia_rs module (#11094) 2022-04-08 09:37:10 -07:00
Arvid Norberg
fe77c69018
run_generator2 rust call and compact conditions data structure (#8862)
* use run_generator2 rust call and compact spend bundle conditions data structure pervasively.

* address review comments
2022-04-04 11:53:13 -07:00
Mariano Sorgente
890c7d3754
Fix remaining linting issues (#10962)
* FIx remaining linting issues

* Revert type:ignore

* Revert token_bytes change
2022-04-02 13:22:55 -07:00
Arvid Norberg
7a82f0d299
use rust clvm in Program.run() (#10878)
* remove Program.from_serialized_program

* run the rust clvm implementation (instead of python) even for wallet programs
2022-03-28 11:58:59 -07:00
Arvid Norberg
656d7d94d8
fix type annotations for FullBlock.header_hash and FullBlock.prev_header_hash (#10909) 2022-03-27 12:20:30 -07:00
Kyle Altendorf
884ebd902b
remove chia.util.clvm pass-through file (#10130)
* remove chia.util.clvm pass-through file

* in tests too
2022-02-14 12:52:14 -08:00
Adam Kelly
8aeefdec02
Fix running blocks with generators that use back-references (#10102)
* Fix running blocks with generators that use back-references

* Update tools/run_block.py

Co-authored-by: Thomas Pytleski <pytlesk4@gmail.com>

Co-authored-by: Thomas Pytleski <pytlesk4@gmail.com>
2022-02-07 16:03:56 -08:00
Arvid Norberg
6872e75a48
benchmark for blockchain.get_block_generator() (#9999) 2022-02-03 16:09:04 -08:00
Arvid Norberg
3d063fea8f
remove the GeneratorArgs type, and instead include the heights and generator programs as separate lists in BlockGenerator. The heights are not necessary when validating blocks, so this makes it easier to omit them in that case. The heights are only used when generating/farming a block. (#10006) 2022-01-31 18:49:39 -08:00
Arvid Norberg
b8ada1ceb7
introduce restrictions on generators at a specific height (#9957)
* introduce restrictions on generators at a specific height. disallow division on negative numbers and disallow redundant leading zeros on integer condition arguments (produced by a generator)

* use SOFT_FORK_HEIGHT constant

* there is no need to specify height when validating block in block_creation

* Update tests/core/full_node/test_mempool.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-28 12:29:11 -08:00
Arvid Norberg
234b31f21a
move CoinSpend.hints() to a free function in the wallet. It does not belong in the full node and can only be called on coins whose program is trusted (#9953) 2022-01-26 08:52:41 -08:00
Arvid Norberg
77db90ba6a
move member function get_memos() out of SpendBundle and into a free-function living in the wallet code. It does not belong to the full node. Also rename it to indicate that it's expensive (and dangerous) to call (#9907) 2022-01-23 21:45:41 -08:00
Yostra
89f15f591c
Merge standalone wallet into main (#9793)
* wallet changes from pac

* cat changes

* pool tests

* pooling tests passing

* offers

* lint

* mempool_mode

* black

* linting

* workflow files

* flake8

* more cleanup

* renamed

* remove obsolete test, don't cast announcement

* memos are not only bytes32

* trade renames

* fix rpcs, block_record

* wallet rpc, recompile settlement clvm

* key derivation

* clvm tests

* lgtm issues and wallet peers

* stash

* rename

* mypy linting

* flake8

* bad initializer

* flaky tests

* Make CAT wallets only create on verified hints (#9651)

* fix clvm tests

* return to log lvl warn

* check puzzle unhardened

* public key, not bytes. api caching change

* precommit changes

* remove unused import

* mypy ci file, tests

* ensure balance before creating a tx

* Remove CAT logic from full node test (#9741)

* Add confirmations and sleeps for wallet (#9742)

* use pool executor

* rever merge mistakes/cleanup

* Fix trade test flakiness (#9751)

* remove precommit

* older version of black

* lint only in super linter

* Make announcements in RPC be objects instead of bytes (#9752)

* Make announcements in RPC be objects instead of bytes

* Lint

* misc hint'ish cleanup (#9753)

* misc hint'ish cleanup

* unremove some ci bits

* Use main cached_bls.py

* Fix bad merge in main_pac (#9774)

* Fix bad merge at 71da0487b9

* Remove unused ignores

* more unused ignores

* Fix bad merge at 3b143e7050

* One more byte32.from_hexstr

* Remove obsolete test

* remove commented out

* remove duplicate payment object

* remove long sync

* remove unused test, noise

* memos type

* bytes32

* make it clear it's a single state at a time

* copy over asset ids from pacr

* file endl linter

* Update chia/server/ws_connection.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-13 12:08:32 -08:00
Arvid Norberg
0ba838b7a8
New clvm generator api (#9645)
* use the new run_generator2() and run_chia_program() API of clvm_rs

* bump clvm_rs dependency to 0.1.17
2022-01-11 15:32:43 -08:00
Arvid Norberg
659f4f4890
remove (redundant) spent field on CoinRecord. Replace it with a property (#9658) 2021-12-22 18:50:32 -08:00
Arvid Norberg
2801d96477
unify the name we use for strict/safe mode (#9545)
* unify the name we use for the special mode we run CLVM in, when accepting transactions into the mempool. We currently call this, strict mode, safe mode, safe and unsafe. Neither of these names are very descriptive. This patch renames this mode to mempool-mode

* import as
2021-12-13 08:38:35 -08:00
Kyle Altendorf
8291f0221a
Make the sized bytes types hint compatible (#9369)
* Rework sized bytes for type hinting compatibility

* add a bunch of type: ignores

* this will be handled elsewhere

* noqa E501 instead of changing code

* normalize comment plurality

* @classmethod

* Revert "@classmethod"

This reverts commit 95db80e339.

* add ignore in benchmarks

* just E501 again...

* add some new type: ignores
2021-12-02 09:43:39 -08:00
Kyle Altendorf
1073f9d5dd
mypy: warn_unused_ignores = true (and remove some) (#9085)
* mypy: warn_unused_ignores = true (and remove some)

* catch up

* type checking tweaks

* precommit uses mypy --no-warn-unused-ignores

* revert a bit

* precommit explanatory comment

* Update .pre-commit-config.yaml

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-11-23 12:44:53 -08:00
Kyle Altendorf
05f67167fe
Correct some type hints adjacent to bytes32 (#8957)
* Correct some type hints adjacent to bytes32

Note that these errors won't show up until the sized bytes are
rewritten to "support" hinting.  They are too dynamic at the moment.

* drop some bytes32 hints with unneeded Optional

* Apply suggestions from code review

* remove code change, this pr is hints only
2021-11-22 13:16:52 -08:00
Arvid Norberg
a29b1158ee
fix lgtm issues (#9198) 2021-11-19 11:11:25 -08:00
Adam Kelly
996f518810
Plotnft fees (#9116)
* Add fees to plotnft commandline and RPCs

* Return calculated fee based on number of transactions

* Extend tests to support fees. Default fee to 0 if not present in RPC call.
2021-11-04 10:44:36 -07:00
Mariano Sorgente
8a028c3594
Ms.mempool locking (#9050)
* Prority locking to consensus

* Remove pstats

* Linting

* Do some stuff outside of lock

* Fix startup

* Add log timings

* Try some different locking

* Add limit

* catch excp

* CLVM inside lock

* Try using a semaphore instead

* use events for lock queue

* test

* Add logging for message types

* type

* remove seed

* check new peak waiters

* correct FullNodeAPI self.full_node.new_peak._waiters typo

* correct logging string typos

* only warn about new_peak Waiters if there is at least 1

* remove no-longer-accepted parameter to FullNode.peak_post_processing()

* only warn about respond_transaction Waiters if there is at least 1

* lint

* Change some constants

* Small fix and logging changes

* Put message types outside

* Change some log levels so we can test with info

* More logging

* Increase rate limits but decrease paralelism

* tweaks

* Log dropped tx

* Fix pool rpc test

* Test fixes

* Mempool optimization

* Remove from seen if fails

* Increase queue sizes

* Message types info

* More test and logging

* Small changes to networking just in case

* Decrease logging

* Decrease logging even further

* Decrease logging even further even further

* Decrease logging 3

* Transaction queue

* Don't cancel tasks or close connection

* Cancel tasks on disconnect (for shutdown purposed)

* Fix typo

* Catch cancelled

* Do multiple at a time

* More accurate farmer response time

* More efficiently create tasks

* Increase queue size and priority by fee

* Revert priority

* Don't re-request too many times for dropped TX

* Handle cancelled error so we don't go into a bad state

* Catch cancelled in syncing tasks

* Reduce new_peak_sem to improve performance

* Less bytes conversion

* Missing file, and 2 workers for CLVM

* Validate BLS in a new thread

* tests

* Change semaphore constants

* correct a cancellation triggered exception and assertion

* Fix send_transaction, dont use BaseException, fix tests

* Fix more tests

* only log transaction handler cancellation in debug

* typing in log

* move unfinished validation to diff proc

* it is asyncio.CancelledError

* Add a test for bad signature

* Fix more tests, reduce logging, lint

* One more lint

* blockchain tests, pass bytes directly, single call

* Try to fix rl_wallet failures

* Fix mempool test

* catch everything

* Don't test RL wallet

* Fix more tests and return error code

* Improve error handling in multiprocess

* Add pre-validation time

* Add pre-validation time in logs, and revert pytest.ini changes

* Add log correctly

* Ms.bls cache experiment (#9115)

* Logging for cache

* Less logging

* Return to original plan

* Clean up

* Remove coment

* Remove log

* formalize LockQueue shutdown

* Comments

* Fix blockchain test

* Improve cache

* Remove logs

* Fix sign_coin_spends

* Fix pool wallet

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Yostra <straya@chia.net>
2021-11-04 09:29:05 -07:00
Richard Kiss
0c7e5194bd
Add Program.at utility function. (#8713) 2021-10-19 10:35:25 -07:00
Arvid Norberg
732fb51fe0
add alternative to pkm_pairs_for_conditions_dict() which is a bit more straigh-forward and returns the public keys and messages in the forms we need them to validate them. This is a step towards simplifying the conditions data structures (#8128) 2021-10-19 06:26:53 -07:00
Yostra
5766a8d367
Fullnode related changes from wallet protocol and unharded derivation (#8522)
* fullnode related changes from wallet protocol and unharded derivation

* limit total subscriptions per peer

* reset counter on disconnect

* dict not a set

* check membership

* remove unused tests, lint
2021-09-18 10:27:34 -07:00
Matt Hauff
e18a71376d
Make SpendBundle.debug() use the default genesis challenge by default (#8431) 2021-09-14 10:39:40 -07:00
Arvid Norberg
5ee182932e
Rust conditions (#7167)
* use rust implementation of condition checker

* enable rust condition checker at specific block height

* bump switch-over height
2021-08-17 14:57:41 -07:00
Matt Hauff
950e78e1f2
Added some new class methods to the Program objects (#8041) 2021-08-13 10:15:25 -07:00
Arvid Norberg
485fab80b7
don't save unknown conditions (#7548)
* don't save unknown conditions

* remove UNKNOWN enum from ConditionOpcode enum
2021-08-02 14:40:32 -07:00
Matt Hauff
30cb11a051
Partial reversion of CoinSpend rename for API compatibility (#7636)
* Partial reversion of the coin spend rename

* Make `SpendBundle` json-serialize the classic way by default.

Co-authored-by: Richard Kiss <him@richardkiss.com>
2021-07-21 10:24:47 -07:00
Richard Kiss
6cf29102f9
Rename coin solution to coin spend (#6841)
* Rename `CoinSolution` as `CoinSpend` everywhere.

* Run `black` everywhere.
2021-07-12 16:31:27 -07:00
Adam Kelly
89f7a4b3d6
Pools mainnet (#7047)
* added clarifying comments

* WIP test

* added WIP test

* Refine genesis challenge. Remove unnecessary pool_puzzle function

* Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend

* Rename create_member_spend to create_travel_spend

* Add singleton id logging

* Enhance logging for debugging

* renaming

* rephrase inside the puzzle

* fixed signing and added some support functions

* Fix issue with announcement

* Progress spending the singleton

* Fix arguments to pool_state_to_inner_puzzle call

* Fix arguments to pool_state_to_inner_puzzle

* Improve error message when wallet is not running

* Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier

* Fix parent coin info bug

* Multiple state transitions in one block

* Lint

* Remove assert

* Fix incorrect p2_singleton_ph calculation (thanks nil00)

* Update waiting room puzzle to accept genesis_challenge

* Update calls to create_waiting

* Go to waiting state from committed state

* Augment debug_spend_bundle

* fix 2 bugs in wallet

* Fix lint

* fix bad_agg_sig bug

* Tests and lint

* remove breakpoint

* fix clvm tests for new hexs and hashs

* Fixed a bug in the coin store that was probably from merging. (#6577)

* Fixed a bug in the coin store that was probably from merging.

* The exception doesn't need to be there

* CI Lint fix

* Added lifecycle tests for pooling drivers (#6610)

* Ms.poolabsorb (#6615)

* Support for absorbing rewards in pools (untested)

* Style improvements

* More work on absorb

* Revert default root and remove log

* Revert small plots

* Use real sub slot iters

* Update types

* debug1

* Fix bugs

* fix output of agg sig log messages

* Make fewer calls to pw_status in test

* remove old comment

* logging and state management

* logging

* small bug fix & rename for accuracy

* format

* Fix types for uncurry function

* lint

* Update test to use exceptions

* Change assumptions about self-pooling in lifecycle test

* Install types for mypy

* Revert "Install types for mypy"

This reverts commit a82dcb712a.

* install types for mypy

* install types for mypy

* More keys

* Remove flags requiring interactive prompts

* Change initial spend to waiting room if self-pooling

* lint

* lint

* linting

* Refactor test

* Use correct value in log message

* update p2_singleton_or_delated_puzhash

* initial version of pool wallet with p2_singleton_or_delay

* run black formatting

* fix rebase wonkiness

* fix announcement code in p2_singleton_or_delayed

* removed redundant defaulting
standardised hexstr handling

* lint fixes

* Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures

* Signatures validate on this test now although the test still does not check it.

* Lint fix

* Fixed plotnft show and linting errors

* fixed failing farmer/harvester rpc test

* lint fix

* Commenting out some outdated tests

* Updated test coverage

* lint fix

* Some minor P2singleton improvements (#6325)

* Improve some debugging tools.

* Tidy pool clvm.

* Use `SINGLETON_STRUCT`. Remove unused `and` macro.

* Use better name `SINGLETON_MOD_HASH`.

* Finish lifecycle test suite.

* Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72)

Co-authored-by: Matt Hauff <quexington@gmail.com>

* Default delay time was being set incorrectly

* Extracted get_delayed_puz_info_from_launcher_spend to driver code

* Ms.taproot plot2 (#6692)

* Start work on adding taproot to new plots

* Fix issue in block_tools

* new test-cache

* Lint

* DID fixexs

* Fix other tests

* Python black

* Fix full node store test

* Ensure block index <= 128 bits.

* fix test_pool_config test

* fix comments in pool_config and in chialisp files

* self_pool -> pool -> self_pool

* Implement leaving pools

* Fix conflicts with main via mini-rebase

* Fixup rebase mistakes

* Bring in Mariano's node discovery chagnes from pools.dev

* Fix adapters - Thanks Richard

* build tests

* Add pools tests

* Disable DID tests

* farmer|protocol: Some renaming related to the pool protocol

* farmer: Use `None` instead of `{}` and add local `pool_state`

* protocol|farmer: Introduce and use `PoolErrorCode`

* rename: `pool_payout_instructions` -> `payout_instructions`

* refactor: `AuthenticationKeyInfo` -> `authentication_key`

* refactor: Move `launcher_id` up

* rename: Some variable name changes

* rename: `points_balance` -> `points`

* format: Squash aggregation into one line

* farmer: Make `update_pool_state` public

* farmer: Print traceback if `update_pool_state` fails

* farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info`

* farmer: Add `authentication_token_timeout` to `pool_state`

Fetch it from `GET /pool_info`

* protocol|farmer: Implement support for `GET|POST|PUT /farmer`

* farmer: Make use of `GET|POST /farmer`

- To make the farmer known by the pool
- To update local balance/difficulty from the pool periodically

* farmer|protocol: Adjust `POST /partial` to match the latest spec

* farmer: Hash messages before signing

* pools: Drop unused code

* farmer: Fix aggregation of partial signatures

* farmer: support self pooling, don't pool if url==""

* wallet: return uint64 for delay time, instead of bytes

* pool: add error code for delay time too short

* farmer: cleaner logging when no connection to pool

* farmer: add harvester node id to pool protocol

* Rename method (test fix) and lint fix

* Change errors to warnings (pool communication)

* Remove pool callbacks on a reorg

* farmer: Continue earlier when no pool URL is provided

* farmer: Print method in log

* farmer: Handle exceptions for all pool endpoint calls

* farmer|protocol: Keep track of failed requests to the pool

* farmer: Fix typo which caused issue with pooling

* wallet: simplify solution_to_extra_data

* tests: Comment out DID tests which are not working yet

* Remove DID Wallet test workflows

* Return launcher_id when creating Pool Wallet

* Name p2_singleton_puzzle_hash correctly

* Improve 'test_singleton_lifecycle_fast.py'.

* Make test more robust in the face of asynchronous adversity

* Add commandline cmds for joining and leaving pools

* Fix poolnft leave params

* Remove redundant assignment brought in from main

* Remove unneeded code

* Style and parsimony

* pool_puzzles: Check was wrong, and bad naming

* format: Fix linting

* format: Remove log and rename variable

* pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash

* gui: Use pools branch

* format: fix lint

* Remove ununsed code, improve initial_pool_state_from_dict

* farmer: Instantly update the config, when config file changes

* format: Speed up loading of the authentication key

* logging: less annoying logging

* Test pool NFT creation directly to pool

* Test switching pools without self-farming in between

* lint

* pooling: Use integer for protocol version (#6797)

* pooling: Use integer for protocol version

* pooling: Fix import

* Update GUI commit

* Ms.login2 (#6804)

* pooling: Login WIP

* pooling: add RPC for get_link

* dont use timeout

* pooling: rename to get_login_link

* format: remove logging

* Fix SES test

* Required cli argument

Co-authored-by: almog <almogdepaz@gmail.com>

* farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807)

* Fix to farm summary

* Use target_puzzlehash param name in RPC call

* Pool test coverage (#6782)

* Improvement in test coverage and typing

* Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733)

* Added new drivers for the p2_singleton puzzles

* Added new tests and test coverage for singletons

* organize pools testing directory

* black formatting

* black formatting in venv

* lint fix

* Update CI tests

* Fixing tests post rebase

* lint fix

* Minor readability fix

Co-authored-by: matt <matt@chia.net>

* farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816)

* Allow creation of PlotNFTs in self-farming state

* gui: Fix install with more RAM (#6821)

* Allow implicit payout_address in self-pool state, improve error messages and param ergonomics

* print units in non-standard wallets correctly

* Fix farmer import

* Make syncing message in CLI more intuitive like the GUI

* Fix linting and show header hash instead of height

* gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c

* Revert "Merge"

This reverts commit 23a1e688c5, reversing
changes made to a850246c6f.

* Revert "Revert "Merge""

This reverts commit 680331859f.

* Treat tx_record as Dict. Refactor tx submission

* Also add passed-in coin spends when processing new blocks in reconsider_peak

* Test utilities had moved

* Fix import of moved block_tools

* Potentially fix yaml

* Previously didn't take the right part of this change

* Add -y flag, improve commandline plotnft handling

* Fix typo

* Add -y flag to plotnft create

* pool_wallet: Restore from DB properly

* wallet: ignore bad pool configs

* Reduce memory

* pool_wallet: Add claim command

* pool_wallet: Set transaction records to confirmed

* wallet: Fix bug in transaction cache

* Formatting and remove log

* pool_wallet: CLI balance and improvements to plotnft_funcs.py

* pool_wallet: Simplify, and fix issue with double submission

* pool_wallet: Fix tests

* pool_wallet: Don't allow switching before relative lock height

* update gui

* change to 3000 mem

* Correct sense of -y flag for self-pooling

* cli: Display payout instructions for pool

* pool_wallet: Don't create massive transactions

* cli: Improvements to plotnft

* pool_wallet: Get correct pool state

* pool_wallet: Use last transaction block to prevent condition failure

* Add block height for current state

* Add outstanding unconfirmed transactions to pw_status

* Refine command line plotnft show pending transactions

* Fix tests by using the correct output from pw_status

* Try to fix windows build

* Print expected leave height

* label pool urls

* pool_wallet: Don't include pool 1.75 rewards in total

* wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet

* pool_wallet: If farming to a pool, show 0 balance in wallet

* pool_wallet: Show error message if invalid state, in CLI

* pool_wallet: Don't allow switching if there are pending unconfirmed transactions

* tests: Clean up pool test logging

* tests: Fix lint

* Changed the pool innerpuzzes (#6802)

* overload solutions for pool_innerpuz parameters

* Fix tests for reduced size puzzles

* deleted messy deprecated test

* Fix lint.

* fix bug where spend types were the wrong way around

* merge with richard's lint fix

* fix wallet bug
remove unnecessary signature
add defun-inline for clarity

* Swap to defun for absorb case
Use cons box for member innerpuz solution

* fix if statement for cons box p1

* remove unnecessary solution arg

* quick innerpuz fix to make tests pass

* Switch to key-value pairs
Undo cons box solution in pool_member inner puzzle

* fix singleton lifecycle test

* added some comments to calrify the meaning on "ps"

* lint fix

* reduce label size, search for label when reconstructing from solution

* no need to keep looping if `p` found

* lint fix

* Removed unecessary defun-inline and changed hyphens to underscores

* Changed created_coin_value_or_0 to an inline function

* Changed morph_condition to an inline function

* Added a comment for odd_cons_m113

* Rename output_odd and odd_output_found

* Add inline functions to document the lineage proof values

* Stager two rewrite

* Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed

* Extract truth functionality to singleton_truths.clib

* Fix tree hashes

* Changed truths to a struct rather than a list.

* fix test_singletons
update did_innerpuz

* recompile did_innerpuz

* fix a log error

* Renamed variable and factored out code per @richardkiss

* lint fix

* switch launcher extra_data to key_value pairs

* fix parsing of new format of extra_data in launcher solution

* fix broken test for new launcher solution format

* remove bare raise

Co-authored-by: Richard Kiss <him@richardkiss.com>
Co-authored-by: Matt Hauff <quexington@gmail.com>

* Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898)

Co-authored-by: Adam Kelly <aqk>

* Moved debug_spend_bundle and added it to the SpendBundle object (#6840)

* Moved debug_spend_bundle and added it to the SpendBundle object

* Remove problematic typing

* Add testnet config

* wallet: Memory would get corrupted if there was an error (#6902)

* wallet: Memory would get corrupted if there was an error

* wallet: Use block_record

* wallet: Add records in a full fork too

* wallet: remove unnecessary arguments in CC and DID

* add to cache, revert if transaction fails

Co-authored-by: Yostra <straya@chia.net>

* Improve comment

* pool_wallet: Fix driver bug

* wallet: Fix memory corruption

* gui: Update to latest

* Increase memory size

* tests: Add test for absorbing from pool

* small fix in solution_to_extra_data

* Fixed incorrect function name

* pooling: Fix EOS handling in full node

* [pools.testnet9]add post /partial and /farmer header (#6957)

* Update farmer.py

add post header

* Update farmer_api.py

add post header

* Update chia/farmer/farmer.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Update chia/farmer/farmer_api.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Fix lint and cleanup farmer.py

* farmer: Fix linting issues (#7010)

* Handle the case of incorrectly formatted PoolState data returned from inner singleton

* wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008)

* Fix lint in pool_puzzles

* pooling: Fix owner private key lookup, and remove unnecessary argument

* pooling: Clear target state on `delete_unconfirmed_transactions`

* Lint

* Fix non-deterministic test

* Slight cleanup clvm driver code (#7028)

* Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data

* lint

Co-authored-by: Adam Kelly <aqk>

* Revert "Add testnet config"

This reverts commit 9812442724.

Co-authored-by: matt <matt@chia.net>
Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local>
Co-authored-by: Adam Kelly <aqk>
Co-authored-by: Richard Kiss <him@richardkiss.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: almog <almogdepaz@gmail.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: arvidn <arvid@libtorrent.org>
Co-authored-by: willi123yao <willi123yao@gmail.com>
Co-authored-by: arty <art.yerkes@gmail.com>
Co-authored-by: William Blanke <wjb98672@gmail.com>
Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com>
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-29 14:21:25 -07:00
Arvid Norberg
0368544c84
validate more aspects of conditions earlier (#6654)
* validate more aspects of conditions earlier, in the process clvm execution is offloaded to

* more tests

* use as_int() in SExp rather than int_from_bytes()

* put condition parser tests in its own test class

* capitalize module-scope variable

* abbreviate enum names in parse_condition_args

* use a more realistic cost per byte in test_rom

* merge parse_coin_id and parse_hash, since they are identical
2021-06-23 09:49:23 -07:00
Arvid Norberg
6cd7a7f5b3
Bump clvm rs version (#6892)
* use deserialize_and_run_program2 from clvm_rs

* bump clvm_rs to 0.1.8

* bump clvm to 0.9.7
2021-06-22 11:47:07 -07:00
Arvid Norberg
d3a71c3e19
make the serialization of Coin follow the normal protocol of implementing stream() (#4074) 2021-05-12 10:40:26 -07:00
Arvid Norberg
ca4b25210b
Rust parse serialized (#3444)
* use rust implementation for finding length of a serialized clvm program

* bump clvm_rs version
2021-05-03 18:58:01 +09:00
Richard Kiss
b084813b12
Improve streamable (#3031)
* Avoid importing `test_constants` as it takes a long time.

* Factor out `parse_*` functions.

* First crack at refactoring `Streamable.parse`.

* Don't add `_parse_functions` attribute to `Streamable`.

This no longer requires an extra `_parse_functions` attribute on a
`Streamable`, as it may be confusing serializers or other functions
that use `__annotations__`.

* Fix lint problems with `black`.

* Fix `parse_tuple`.

* Defer some parsing failures to parse time rather than class-creation time.

* Tidy up & remove some obsolete stuff.

* Decorate `RequestBlocks` as `streamable`.

* Fix wrong uses of Streamable class

Revert an earlier commit and error out on class creation in case a
Streamable subclass is instantiated incorrectly, e.g. containing a
non-serializable member.

Fix cases where Streamable parent class was forgotten.

* Fix wrong types when creating DerivationRecord and WalletCoinRecord

* additional unit tests for streamable parsers

* add type annotations (#3222)

Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
Co-authored-by: arvidn <arvid@libtorrent.org>
2021-04-30 10:22:11 -07:00
Arvid Norberg
6cde47d112
cache VDF validation results (per process) (#3110) 2021-04-29 13:34:04 -07:00
Mariano Sorgente
e611bef223
Use secure coin ids (#3095) 2021-04-29 13:30:24 -04:00
Arvid Norberg
8717ca4b02
Leave programs in SpendBundle serialized (#2380) 2021-04-27 10:52:21 -07:00
Yostra
d88697ef42
more speed (#2223) 2021-04-26 23:21:24 -07:00
Arvid Norberg
e55988479b
More tests (#2295)
Co-authored-by: Mariano <sorgente711@gmail.com>
2021-04-21 11:17:21 -07:00
arvidn
6b4d060758 pass through max cost all the way down to where we execute the CLVM code 2021-04-17 10:34:13 -07:00
Mariano Sorgente
a6874bd2fe
Block compression and decompression (#1959)
* squash

* rebase cleanup

* cost

* Combine adam's and straya's PRs

* Fix cost test

* Fix another test

* Improve safety in reorgs

* Improve wallet in reorgs

* Improve wallet in reorgs

* Bug in reorg handling

* Bug in reorg handling, and fix test

* Band aid

* Comment out to pass test

* Comment out test

* rebase clean

* USe a list of reference generators

* create

* Integrate Block Compression

* Fix generator argument creation

* improve test

* update block tools

* Separate CompressorArg and GeneratorArg, improve type hints

* First crack at `list_to_tree`.

* Integrate generator arguments as tree

* End to end test for generators

* Fix linting issues, hook up things, and add a test

* tidy GeneratorArg test

* Get compression and decompression working in full node

* Fix fetching block generator from DB in multiprocess

* Fix edge case in reorgs, test many combinations of reorgs

* reduce max number of generators refs allowed in a block

* Apply Straya's fix for calculating the end index for generator args

* typos

* Run test_block_compression for a transaction large enough to force multiple input coins in the transaction

* Update generator compression tests for treearg change and decompressor offset args fix

* Fix merge conflict

* Fix test

* Fix full node tests

* Don't make full blocks

* fix lint

Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Richard Kiss <him@richardkiss.com>
2021-04-16 23:13:22 -07:00
matt-o-how
332d9392f9
Add test for relative seconds, and rename conditions (#1902)
* Add test for relative seconds

* rebased on top of main

* Renamed AGG_SIG to AGG_SIG_UNSAFE
Renamed height and time conditions
Changed some demo p2 puzzles to use AGG_SIG_ME

* fix merge on cost_calculator

* update hex and sha256tree of p2_delegated_conditions

* fix condition name in rl clvm

* updated the innerpuz sha256tree after careful inspection
2021-04-15 13:00:14 -07:00
Adam Kelly
73d5577bec Validate Generator Reference field during block validation. Validate size in bytes of generator against MAX_GENERATOR_SIZE. Lower max generator list entries. 2021-04-14 20:02:10 -07:00
Adam Kelly
2d26934965
Add types to support Generator Back References (#1901)
* Add types to support Generator Back References

* Add test workflows

Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-04-14 13:49:36 -07:00
matt-o-how
e977bed7e4
Add Puzzle Announcement conditions (#1780)
* Specified two types of create_announcement

* Fix create_announce_with_puzhash in specific situation

* Removed unnecessary announcement functionality from a bunch of place

* Added tests for puzzle announcement and wallet features

* fix tests/clvm/coin_store.py to use new announcements

* fix test_blockchain_transactions

* update test_blockchain_transactions to use real names

* remove lingering ConditionVarPair

* Fix another lignering CVP issue

* fix broken test imports

* fix puzzle announcement test

* change announcement_names to set and rename some functions for clarity

* Rename conditions for consistency

* typing and typo fixes

* fix name conflict in test

* fix test coin_store to use sets

* renumber opcode

* force recompile and small fixes for new conditions numberings

* add sha256tree files for updated hex files
2021-04-14 11:28:18 -07:00
Mariano Sorgente
772e6fd440
Ms.performance (#1776)
* Improve performance of streamable

* __annotations__ instead of get_type_hints

* Fix overly strict type checker

* Lints and fix test

* Lint

* Adds support for empty streamables

* Use different strategy to fix lint and support empty Streamables

* Test for empty streamable

* Changelog
2021-04-13 16:42:26 +09:00
Richard Kiss
7506f64c35 Rename to ConditionWithArgs. 2021-04-08 11:35:50 -07:00