Commit Graph

911 Commits

Author SHA1 Message Date
Kyle Altendorf
89740234e7
spawn (not fork) for multiprocessing (#10322)
* spawn (not fork) for multiprocessing

* just append _worker to existing process names

* return properly in getproctitle()

* black

* ignore for unhinted getproctitle()

* Add comments about the setting of the multiprocessing start method
2022-02-24 20:08:06 -08:00
dustinface
55c4eb3d28
farmer: Send a PUT /farmer if the signature verification failed (#10364)
Due to the bug which was fixed in #9922 some pools obviously still have 
incorrect authentication public keys from their farmers. This PR is to 
make sure that the farmers update their authentication public key on the 
pool if they get an `INVALID_SIGNATURE` response error from a `GET 
/farmer`.
2022-02-24 08:46:28 -05:00
dustinface
2ba0b9f41d
farmer: Log POST/PUT requests data with DEBUG log level (#10405) 2022-02-23 22:29:50 -05:00
joshpainter
8a2e876e45
Added CAT wallet name parameter (#10381)
The create_wallet_for_cat method call accepts a "name" parameter for the new CAT being created, but we weren't passing that "name" variable here so all new wallets created via this method end up being named "CAT WALLET" (the default for name parameter in create_wallet_for_cat) even if you specified a wallet name here.
2022-02-23 10:11:24 -05:00
Kyle Altendorf
d5aacd87f8
Stop launching more wallet receipt and validation tasks during shut down (#10384)
* Stop launching more wallet receipt and validation tasks during shut down

* info not error

* less f-string
2022-02-23 08:31:32 -05:00
Mariano Sorgente
d0ed4fb0d5
Ms.fix get transactions (#10380)
* Increase limit from 50 to unlimited

* Increase limit from 50 to unlimited, and allow configuring from CLI call

* Use max uint32
2022-02-23 08:28:03 -05:00
Mariano Sorgente
c844016019
Improve trusted sync performance (#10377)
* Improve trusted sync performance

* Fix broken CLI

* Decrease timestamp cache size

* Add all valid states at the right time
2022-02-22 18:37:51 -08:00
Kyle Altendorf
001effae61
asyncify wallet weight proof validation (#10376) 2022-02-22 17:39:46 -08:00
dustinface
8eb2a29834
streamable: Enable flake8 and pylint (#10355) 2022-02-22 12:42:05 -08:00
Mariano Sorgente
e1e779ee3c
Add auth key back (#10374)
* Add auth key back

* PK not SK
2022-02-22 12:34:53 -08:00
arty
062dfe9feb
Add info dump about how to use singletons (#9559)
* Add info dump about how to use singletons

* Add a comment re: matt howard pointing out that the eve spend can also be simulataneous

* Fix commentary

* Add commentary according to feedback
2022-02-22 10:24:40 -08:00
Chris Marslender
4ac563e0d0
Add to_address param to get_transactions RPC (#10319)
* Add `address` param to get_transactions to enable filtering transactions by the receiving address

* move address where to the same line as the other where, so query segments are logically grouped

* Update param to `to_address` and use timeout assert in the test
2022-02-22 09:38:59 -08:00
Kyle Altendorf
6b8b4e41bf
rework _fetch_header_blocks_inner() (#10326)
* rework _fetch_header_blocks_inner()

* flake8

* drop selected_peer_node_id

* black

* disconnect peer for None response
2022-02-21 20:08:54 -08:00
Arvid Norberg
58019afd5b
chunk coin_store request into smaller sql queries (#10359)
* chunk coin_store request into smaller sql queries, to not exceed the limit of 999 on old versions of sqlite

* extend tests for chunks
2022-02-21 20:07:05 -08:00
Patrick Maslana
e35174c268
Fixed two typos in the initial-config.yaml (#10357)
* Fixed two typos in the initial-config.yaml

* Changed the letter case for a word.
2022-02-21 09:19:47 -08:00
Kyle Altendorf
e3fb3ce96e
Move black from SuperLinter to upload workflow, use 21.12b0 in pre-commit (#10103)
* black==21.12b0 in pre-commit

Match `setup.py`.

* move black from super linter to upload workflow

* black (updated)

* configure so black . works

* --check --diff for black
2022-02-20 21:33:09 -08:00
dustinface
3608d25c80
type_checking: Drop some redundant None checks (#10334) 2022-02-20 21:30:57 -08:00
wjblanke
a59979b8c8
unused locks (#10320)
* unused locks

* unused locks

* unused locks

* unused locks

* unused locks

* unused locks

* removed unused import
2022-02-20 21:29:16 -08:00
Amine Khaldi
b544e75cd7
Align the wallet node's weight proof timeout with the full node's value. (#10341)
* Align the wallet node's weight proof timeout with the full node's value.

* Give the wallet config its own weight_proof_timeout value.

* Apply Kyle's cleaner version.

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

* Apply Kyle's anchors suggestion.

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-20 21:28:43 -08:00
Arvid Norberg
71406efe81
make blockchain.height_to_hash() return None on failure, rather than assert (#10331) 2022-02-20 10:40:46 -05:00
Mariano Sorgente
45c39f235b
Fix infinite loop (#10324) 2022-02-19 18:38:46 -08:00
Kyle Altendorf
9358a7b3e1
fix service restart (#10312)
https://github.com/Chia-Network/chia-blockchain/pull/10233/files
2022-02-19 12:57:07 -08:00
Arvid Norberg
29bd136238
name processes we spawn in tests with a test_ prefix, to make it easier and find and kill them in case they're left running (#10318) 2022-02-19 12:39:17 -08:00
Mariano Sorgente
bea709d979
Ms.memory leak2 (#10287)
* Start fixing other issues

* Fork point, sync cancelling, random peer

* Reduce logging

* Improve performance and have a fallback peer for fetching

* Disconnect not synced peers

* Make sure try catch doesn't fail

* Fix memory leaks and keep track of sync target height

* Fix lint

* Update chia/wallet/wallet_node.py

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

* Pylint has a bug so ignore pylint for this line

* Fix memory leaks

* Increase cache size

* Fix flaky test

* Fix mistake

* Spawn for memory

* Revert spawn for now

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: wjblanke <wjb98672@gmail.com>
2022-02-18 19:52:00 -08:00
Arvid Norberg
9a0095b5aa
improve checking arguments when converting the blockchain db (#10272)
* improve checking arguments when converting the blockchain db

* don't print stack traces on errors in chia db upgrade
2022-02-18 10:19:40 -08:00
Amine Khaldi
c577b5a0a5
Fix lineage proofs primary key constraint. (#10282)
* Fix lineage proofs primary key constraint.

* Linting suggested changes.
2022-02-18 07:49:56 -08:00
Kyle Altendorf
9a3194599d
do not enable signals on services in tests (#10290) 2022-02-18 07:49:19 -08:00
Amine Khaldi
f8ee3d5599
Fix fee validation in cat_spend wallet RPC API (#10284)
* Fix fee validation in cat_spend wallet RPC API.

* Linting suggested changes.
2022-02-18 07:48:49 -08:00
Chris Marslender
457812ac21
Crawler RPC IP endpoint (#10294)
* Add endpoint to crawler to get IP addresses seen by the network after a particular timestamp

* Add offset/limit for get_ips_after_timestamp
2022-02-18 07:44:06 -08:00
Chris Marslender
5e4c1a1f62
Timelord RPC + Misc Metrics Updates/Fixes (#10255)
* Add mempool_max_total_cost to RPC

* Add signage_point event

* Fix incorrect crawler RPC port lookup

* Set up initial timelord RPC server + finished_pot_challenge event

* Add new compact proof event

* Add skipping/new_peak to track when fastest or not

* Check for None on change_data

* Add skipping_peak + new_peak to changes for metrics

* Convert chain to value

* Rename iters

* Timelord RPC to 8557 - 8556 is used in simulation tests

* Make tests work with RPC server on timelord

* Change event name to finished_pot

* Use broadcast_farmer object

* Move state changed for `finished_pot` after proofs_finished.append

* Fix type on ips var + add vdf_info and vdf_proof

* fix event name on the state_changed function
2022-02-18 07:43:52 -08:00
Kyle Altendorf
47a0a9101c
apply isort (#10280) 2022-02-17 19:46:51 -08:00
Mariano Sorgente
52e439ccbe
Ms.sync cancel (#10244)
* Start fixing other issues

* Fork point, sync cancelling, random peer

* Reduce logging

* Improve performance and have a fallback peer for fetching

* Disconnect not synced peers

* Make sure try catch doesn't fail

* Fix lint

* Update chia/wallet/wallet_node.py

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

* Pylint has a bug so ignore pylint for this line

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-17 13:35:41 -08:00
Matt Hauff
fad3f88b13
Bundle CATs with announcements (#10260)
* Bundle CATs with announcements

* Make the announcement deterministic to the coins being spent
2022-02-17 11:44:28 -08:00
Matt Hauff
e61c0f477b
Accommodate multiple coin fees (#10251) 2022-02-17 11:20:19 -08:00
Matt Hauff
2c4cbb9127
Do our best to only show inner puzzle hashes (#10015)
* Do our best to only show inner puzzle hashes

* Add to get_transaction(s) API

* Unrelated minor fix

* black
2022-02-17 09:52:17 -08:00
Matt Hauff
974e29c0dd
Create a CAT lineage store (#10181)
* Create a CAT lineage store

* Lint

* Fix migration

* Forgot await

* Bad SQL statement

* fix precommit

Co-authored-by: wjblanke <wjb98672@gmail.com>
2022-02-17 08:10:17 -08:00
Kyle Altendorf
f6e479cc07
Improve StructStream hints to support decimal and other parameters like int itself (#9949)
* Improve StructStream hints to support decimal and other parameters like int itself

* get SupportsIndex from typing_extensions
2022-02-17 07:35:13 -08:00
Arvid Norberg
34159d3529
optimize get_block_generator() (#10104)
* optimize get_block_generator()

* add a v1 compatible get_generator() to speed up get_block_generator() with v1 databases. Add test. Add error log in case generator_from_block() fails.

* speed up test_full_block_utils
2022-02-17 07:32:29 -08:00
Kyle Altendorf
d1516f9e00
import ConditionOpcode from actual definition (#10132) 2022-02-17 07:30:36 -08:00
Jack Nelson
b794d78b28
Fix memory leak in sync_store.py (#10216)
* switch to orderdict and use fifo

* workaround for older python versions

* oops

* Update sync_store.py

* fixed

* move comment for clarity

* Update sync_store.py
2022-02-17 07:29:42 -08:00
Arvid Norberg
a7c73e4125
use synchronous sqlite3 library in db conversion function (#10259) 2022-02-16 16:21:25 -08:00
Kyle Altendorf
767974cb93
reinstate pre-existing signal configuration on windows for services (#10263) 2022-02-16 15:26:03 -08:00
Jeff
f8a6c54e1a
Fix to allow debugging services when launched alongside the GUI (#10233)
* Daemon RPCs `start_service` and `is_running` will additionally check
self.connections to determine if the service is running. When launching
services manually (e.g. when debugging), the GUI was attempting to have
the daemon relaunch an already-running service.

* Update chia/daemon/server.py

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

* Updates per feedback

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-15 14:43:50 -08:00
Matt Hauff
f5ade1564c
Announcement hash should never be None (#8965)
* Announcement hash should never be None

* Allow origin ID to be anywhere in the coin set

* mypy

* Change to for/else format

* Fix comment

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

* Style change to loop

* tiny bad merge

* Add test

* Lint

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-15 14:42:07 -08:00
Kyle Altendorf
220e845d51
shutdown the weight proof process pool (#10163)
* shutdown the weight proof process pool

* use a context manager for the weight proof process pool executor

* record of the debug code

* mostly cleaned up

* suppress sync task cancellation propagation when awaited while closing

* breakup multi-second WeightProofHandler.validate_weight_proof with async sleeps

* move awaiting of sync task until after existing cancellation

* properly handle shutdown file with a new instance each time and a context manager

* cleanup
2022-02-15 12:22:23 -08:00
Matt Hauff
c7ea56114d
Remove unnecessary uint64 cast (#10235) 2022-02-15 10:23:21 -08:00
dustinface
98971de9d5
pre-commit: Add a new hook to run isort (#8827)
* pre-commit: Add a new hook to run `isort`

* contributing: Add hint about `isort`

* add isort to dev deps, ignore existing .py files, use black profile

* long list to lines not comma delimited

* isort: Update and sort ignore list to match latest `main`

* add bash command line to generate isort extend skip list (#3)

* add bash command line to generate extend skip list

* tidy

* isort: More files to ignore after rebase

* tests: Fix `test_wallet_user_store.py` after rebase

* Some fixes after rebase

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-15 07:28:53 -08:00
Kyle Altendorf
65c0829f66
madMAx executable discovery error handling cleanup (#9501)
* Add missing version=None for

* Log errors in get_madmax_install_info() instead of printing
2022-02-14 22:28:42 -08:00
Adam Kelly
41717337e6
This patch enables fees for the plotnft commands - create, claim, joi… (#9968)
* This patch enables fees for the plotnft commands - create, claim, join, and leave.

It also corrects a mismatch in the wallet code that appeared to expect Announcement objects, but actually required bytes.

* Update to using Announcement class. Publish both claim tx and fee tx for correct wallet accounting.

* Update keysearch for new wallet

* Update test for fee, and update wallet_id invariant

* Rename variable tracking coin in absorb SpendBundle

* Update RPC failure cmdline diagnostic

* Remove fee parameter in sign method. Add publish transaction method. Add  entry in RPC API replies.

* Fix fee tx in absorb. Update absorb tests to test for fees

* conflict

* lint

Co-authored-by: William Blanke <wjb98672@gmail.com>
2022-02-14 20:07:06 -08:00
Kyle Altendorf
cc63c7017b
Remove deprecated initial_num_public_keys_new_wallet from initial-config.yaml (#10221)
231ef6faf2/CHANGELOG.md
> Fixed issues where the wallet code would not generate enough addresses when looking for coins, which can result in missed coins due to the address not being checked. Deprecated the config setting initial_num_public_keys_new_wallet. The config setting initial_num_public_keys is now used in all cases.
2022-02-14 12:53:47 -08: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
Arvid Norberg
229eea9b55
Log slow block height (#10160)
* improve logging of blocks that are slow

* add profiler to test_full_sync

* Update tools/test_full_sync.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-14 12:51:21 -08:00
Chris Marslender
eb3ed142e0
Crawler RPC (#10141)
* Add crawler RPC server

* Generate private keypair for crawler

* Bring over cleanup changes from the last closed PR

* Update the crawler RPC information to be its own subsection within seeder

* Add sleep before crawling to let the daemon connection get set up

* Wait for the actual callback to not be None, instead of just a random sleep interval

* Rework crawler/dns seeder to use the daemon + normal chia start process rather than the old system intended for the standalone repo

* Update configure testnet to work with seeder config

* Add back the crawler/seeder options from the standalone version

* Remove the check for none/sleep. Not needed when this is started by the daemon

* Add real data to the get_peer_counts endpoint

* Lint

* Fix calls to configure from init

* Turns out we still might sometimes move too quick before daemon/state changed callback is ready

* Add peer counts in the state_changed callback method

* Add a setting for peer_connect_timeout in the seeder: section so we can control it just for crawler

* start_seeder

* Pass config/root_path to the DNSServer so it can also use the configured crawler DB Path

* change in () instead of if/or

* Remove unnecessary return
2022-02-14 11:48:35 -08:00
Mariano Sorgente
7fa1861def
Ms.wallet refactor (#10146)
* wallet fixes

* Don't show false positive synched

* Code cleanup and lint

* Fixes

* Revert issue

* Fix reorg issue

* WIP wallet node

* More wallet refactor

* More wallet changes

* More

* Fix subscription bugs

* Fix some tests

* Fix pool tests

* More tweaks

* Lint and small issues

* call update_ui at the correct points

* Small changes

* new peak queue

* Fix peer height issue

* Rollback more for safety, and tweak logging

* Small WSM style fixes

* Change fork point in long_sync

* More fixes with real world testing

* Fix reversed filter

* Fix function name

* Fix coin store bug properly

* Raise CancelledError

* Fix rollback issue

* Lint

* Small fix

* Fix CAT issue

* Fix test trades race condition

* Fix test trades race condition

* Try to reduce flakiness

* Test coin store and fix additional method

* Improve flakiness
2022-02-14 11:28:36 -08:00
Arvid Norberg
e47958605a
Tolerate missing hints (#10207)
* update db-upgrade test to run faster, and also parameterized on whether the hints table is present

* tolerate missing hints table in db conversion function
2022-02-11 18:30:56 -08:00
Arvid Norberg
54053178bf
remove constraint on v1 database 'peak'-index. Constraints like this require at least sqlite 3.9 (2015) (#10199) 2022-02-11 13:05:13 -08:00
dustinface
b229211ea5
farmer: Move some member instantiations into Farmer.__init__ (#10179) 2022-02-11 12:34:34 -08:00
dustinface
ed70c2663a
farmer: Wait until xch_target_address is in the config in setup_keys (#10185)
* farmer: Wait until `xch_target_address` is in the config in `setup_keys`

* farmer: Reload config in `setup_keys` before `xch_target_address` checks
2022-02-11 12:33:53 -08:00
wjblanke
419f88f296
updated soft fork to 2300000 (#10170) 2022-02-09 18:02:06 -08:00
Yostra
6315cb4a4b
Try all nodes when fetching a parent. (#10152)
* try all nodes

* lint
2022-02-09 16:19:02 -08:00
Pavel Yakovlev
8b4ab4bfde
fix full sync on DB v2 (#10157)
* Update hint_store.py

* Update db_upgrade_func.py

* Fix a hint by black.

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2022-02-09 09:11:01 -08:00
Jeff
2314f47ecc
Post a state change when an offer is added or soft-cancelled. More offer (#10153)
state changes may be needed in the future, but for now the GUI will be
able to refresh wallet balances in response to offer soft-cancellation
and addition.
2022-02-08 17:58:59 -08:00
Jeff
67705e0907
Ensure wallet/db directory exists before attempting to migrate a wallet (#10151)
db from standalone_wallet/wallet/db.
2022-02-08 16:51:30 -08:00
Chris Marslender
66fae97b76
Don't return from sync_changed - create payloads list and pass it along (#10149) 2022-02-08 12:58:53 -08:00
Mariano Sorgente
613cdc47f2
Ms.wallet fixes (#10094)
* wallet fixes

* Don't show false positive synched

* Code cleanup and lint

* Fixes

* Revert issue

* Fix reorg issue

Co-authored-by: wjblanke <wjb98672@gmail.com>
2022-02-07 16:38:45 -08:00
Yostra
87aeadc343
Wallet improvements (#10077)
* disonnect from untusted faster, fork point change, pool state handle

* name conflict

* deadlock

* fix inclusion validation for first sub epoch, don't fetch header blocks on every new peak

* lint

* can be none

* revert changes

* stop wallet peers if trusted peer is connected and synced

* remove pool changes

* remove cononfusing log
2022-02-07 16:13:42 -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
Kyle Altendorf
b5f3122fc6
import ConsensusConstants from actual definition (#10131) 2022-02-07 13:15:35 -08:00
Jeff
f67ca2c5a3
STANDALONE_ROOT_PATH now expands to a different env variable to avoid (#10114)
conflicting with DEFAULT_ROOT_PATH when CHIA_ROOT is set. When the GUI
launches chia services, CHIA_ROOT is set, which was preventing the
wallet backend from copying existing DBs from the standalone_wallet.
2022-02-07 11:06:36 -08:00
Jeff
f2fe1dca62
Support for performing incremental legacy key migration. (#10085)
* CLI support for performing an incremental keyring migration. This handles the case where new keys were created by an older client or the light wallet, and those keys then need to be moved to keyring.yaml.

* Opportunistically perform a silent incremental keyring migration when the GUI unlocks the keyring.

Track when keyring migration occurs so that we don't needlessly attempt on each GUI launch. ~/.chia_keys/.last_legacy_migration will contain the app version that last attempted migration.

* Formatting & linter fixes

* Tests for `chia keys migrate`. Missing a test for incremental migration.

* Additional keyring migration tests

* Formatting updates from black in files unrelated to this branch.

* Revert "Formatting updates from black in files unrelated to this branch."

This reverts commit a85030e8e0ea7406683efd8ae41e224c861e08ff.

* Exit loop if remaining_keys <= 0

* Linter fix? Manually making this change as black doesn't identify any issues locally.

* Linter fix again...
2022-02-04 16:43:51 -08:00
Jeff
eaa6b8beab
Rename migrated standalone_wallet wallet DB to v2 (#10086)
* Rename migrated standalone_wallet wallet db to use '_new.sqlite' suffix

* Removed unnecessary format string

* Wallet DB is now named "v2" instead of "_new"
2022-02-04 09:49:20 -08:00
Arvid Norberg
fa256b8149
fix typo in 'chia init --db-v1' (#10109) 2022-02-04 08:46:17 -08:00
Gene Hoffman
f16bd948ee
Correct comment about max future block timestamp (#10105) 2022-02-03 21:05:20 -08:00
Arvid Norberg
6872e75a48
benchmark for blockchain.get_block_generator() (#9999) 2022-02-03 16:09:04 -08:00
Mariano Sorgente
b0a19582f5
check_keys: check 50 instead of 500, farm default observer (#10083)
* check_keys: check 100 instead of 500, and also observer

* check_keys: check 50, and address PR comments
2022-02-03 10:34:26 -08:00
Kyle Altendorf
5b7f46fca7
simplify new peak timeout (#10053)
* simplify new peak timeout

* correct to asyncio.TimeoutError
2022-02-02 17:13:06 -08:00
Mariano Sorgente
3b03872146
Ms.flaky2 (#10080)
* tests: add missing await to fix flaky test

* tests: More flaky pool tests

* WIP

* wallet: apply multiple states per block for pool wallet

* lint
2022-02-02 16:58:15 -05:00
arty
d2f35e627c
Fix some spam when using clvm_tools_rs (#10043) 2022-02-02 10:42:47 -08:00
Arvid Norberg
9153e82b1c
avoid computing the header hash, when we already have it available (#10075) 2022-02-02 10:40:41 -08:00
Mariano Sorgente
5b58ec3848
Ms.wallet cache (#10070)
* wallet: Invalidate caches for reorg

* wallet: lint

* wallet: remove logging

* wallet: simplify logic

* Update chia/wallet/wallet_node.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-02 10:05:57 -05:00
Arvid Norberg
7fb7a916ee
Simplify FullNode._replace_proof (#10049)
* simplify updating of proofs (when compacting them). This also saves two database lookups before the update

* fixup

* insert or ignore duplicate blocks

* when replacing a weight proof with a compact version, we do so by height. Rather than asking for all blocks at the specific height followed by a linear search for the one with the correct header hash, we can simply lookup the correct header hash and just look up that block. This simplifies the logic by dropping the looping over blocks.

* pass in header_hash to _replace_proof() to avoid the height-to-hash lookup
2022-02-01 22:31:47 -08:00
dustinface
eb0e3a2cc8
plotting: Add missing locks in PlotManager (#9708) 2022-02-01 10:02:43 -08:00
Kyle Altendorf
29fad42e0c
await peer.close() in WalletNode.validate_received_state_from_peer() (#10054)
```
farm/chia-blockchain/chia/wallet/wallet_node.py:1058: RuntimeWarning: coroutine 'WSChiaConnection.close' was never awaited
peer.close(9999)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
```
2022-02-01 09:56:35 -08:00
Earle Lowe
fd5e39470d
Do not assert if pool_state is none (#9893) 2022-01-31 19:00:49 -08:00
Kyle Altendorf
941bc580d2
Handle CAT units and names in CLI get_transaction[s] (#9942)
* Re-add CAT sending to send CLI

* Fix missing memo param

* chia wallet get_transaction reports CATs correctly

* black

* fixup get_transactions

* fixup get_transaction[s] address prefix

* black

Co-authored-by: Matt Hauff <quexington@gmail.com>
2022-01-31 18:54:31 -08:00
Chris Marslender
677e25fd02
Add data to wallet RPCs to support metrics (+ update log_exceptions helper) (#9996)
* Send coin_added event to metrics

* Add fingerprint to balance response

* Don't consume the exception by default, but enable for the metrics data usecases

* Pass sync_changed event to metrics

* bare raise
2022-01-31 18:53:43 -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
275969ddd1
remove redundant function, calculate_cost_of_program(). The cost is now part of the NPCResult object (#9964) 2022-01-31 18:49:12 -08:00
Arvid Norberg
108f72a756
fix DB conversion with duplicate hints in the v1 database (#10041) 2022-01-31 18:48:37 -08:00
Jeff
d136b84498
Fixed Offer history limit and GUI sorting (#10025)
* trade_store: Migrated the `is_my_offer` property from the serialized
trade_record to a new `is_my_offer` column in the trade_records table.
Rewrote get_trades_between to move the query/sorting into the database.
This supports the presentation of offers in the GUI (two lists sorted by
relevance).

RPC: get_all_offers now accepts options to restrict the listing to
completed offers, my offers, taken offers. Added get_offers_count call
to return a breakdown of the number of offers (my offers, taken offers,
total).

CLI: Updated `chia wallet get_offers` to include options to exclude
created/taken offers, as well as an option to reverse the listing. The
-ia|--include-all option has been renamed -ic|--include-completed to
make sense in the context of the --exclude-[my-offers|taken-offers]
options. The full listing is now output, fixing the issue with hitting
the prior paging cap of 50 records.

* Linter fixes

* Updated trade tests. Fixed reverse sort when ordering offers by relevance.

* Make column spec explicit on insert to better support possible future migrations. If a future migration adds a new column with a default value, inserts/updates made by an older client will fail unless the insert explicitly indicates which columns are being updated. By explicitly listing the columns to update, any unspecified columns will have their default value applied.
2022-01-31 18:48:05 -08:00
Mariano Sorgente
34edf6e35e
pool_wallet: Deterministic derivation of auth key, and only count poo… (#9922)
* pool_wallet: Deterministic derivation of auth key, and only count poolWallets for indeces

* cli: Use the same limit for cli creation

* farmer: no more auth keys in config

* farmer: handle case of no authentication sk

* farmer: remove async, and fix test

* lint

* test: Add a test for many pool wallets, and user store

* test: Wait for wallet to be synced in test

* wallet: fix startup (no dns servers) and change to server checking of plotnfts

* cli: change to server checking

* tests: fix user store test

* Improve caching

* PR comments

* Remove useless class

* Try to fix test again
2022-01-30 12:31:55 -05:00
Mariano Sorgente
f28fcccfa5
Ms.main tests (#10026)
* Try to fix compact tests

* Don't compactify recent blocks, earlier

* Update test_simulation.py

Increase number of blocks

* Update setup_nodes.py

* Update test_simulation.py

* Update test_daemon.py
2022-01-29 21:37:11 -05:00
Mariano Sorgente
6e37b74742
Change compact block (#10011)
* Change compact block

* Also recent blocks

* Add bill's rollback code

* Fix v2 issue

* Fix v2 issue blockchain

* Fix tests
2022-01-28 19:19:10 -08:00
wjblanke
442a83e968
change lite wallet peers from 5 to 3 (#9994) 2022-01-28 19:17:14 -08:00
Yostra
ca84fa9f8d
Sync improvements (#9974)
* stash

* change log level

* stash changes

* cat tests

* add node id chia show

* make max sibscribe items configurable

* lint

* add logs for limits

* paralelize incluzion valdiation, don't diconnet from remote peers until local peer in synced

* wallet rate limit

* test log lvl, trusted, black

* only validation under semaphore

* flake mypy trade test

* reduce flakyness

* merge fix

* rename

* linting

* validate parallel, apply serial

* reduce falkyness

* lint

* Fix CAT tests

* black

* flaky test, total amount

* fix cat test

* skip existing state

* skip existing

* try other caches

* flake8

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: William Blanke <wjb98672@gmail.com>
2022-01-28 19:16:47 -08:00
Matt Hauff
fa2cdd6492
Fix signing with path m key (#10009) 2022-01-28 15:34: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
Chris Marslender
cbbdb6510a
Adding additional data to RPCs for metrics (#9945)
* Add "metrics" as an additional destination for get_blockchain_state changes

* Add compact/uncompact blocks to get_blockchain_state

* Add total mempool cost to blockchain state

* Add hint count to blockchain state

* Add info about max cost, block_cost, and block_fees

* Add mempool min fee to blockchain state

* Add dict for mempool fee estimates

* dont start key with number

* Move max block cost to blockchain state

* Add generic exception logging util

* Catch/log any exceptions in counting hints

* Fix inconsistent key

* Assert row is not none

* Move block count metrics to a new endpoint

* report on block instead of unfinished_block for metrics

* Mark the block event with bool for if transaction block or not

* Add some basic tests for counting hints

* Add some basic tests on counting compact/uncompact blocks

* Fix lint

* Add k-size

* Add timestamp

* Add header_hash + height
2022-01-27 18:42:49 -08:00
Arvid Norberg
2bb591c681
default log rotation to 50 MB (instead of 20) and make it configurable (#9986) 2022-01-27 15:54:20 -08:00
Mariano Sorgente
f845cb3206
More logging when errors happen (#9987) 2022-01-27 14:18:29 -05:00
Matt Hauff
0c8727f469
Remove wallet-only as a service group (#9935) 2022-01-26 17:21:08 -08:00
Yostra
b08c904ebf
migration (#9948) 2022-01-26 17:19:42 -08:00
Arvid Norberg
a501c53228
default new installs to use v2 blockchain database schema (#9951)
* default new installs to use v2 blockchain database schema. Leave an option to initialize a v1 database

* rename default database file to say v2
2022-01-26 17:14:05 -08:00
Matt Hauff
70150e9372
Keep backwards compatibility on coin record RPCs (#9938)
* Keep backwards compatibility on coin record RPCs

* Abstract functionality to a function
2022-01-26 16:45:21 -08:00
Arvid Norberg
38e8c8c355
simplify cost calculation. It's already computed in rust (#9931) 2022-01-26 09:07:22 -08:00
Arvid Norberg
7acdf2d30f
avoid converting puzzle_reveal and solution into python representation, just to convert it back again when running it (#9958) 2022-01-26 09:06:41 -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
Jeff
bb1c16cee5
[CLI] chia keys derive [wallet-address | child-key | search] (#9184)
* Added chia keys derive (wallet-address | child-key) to display derived wallet addresses or public keys

* Support for public key (unhardened) derivation

* Fleshed out the search command. Can perform a substring search on wallet addresses, public, and private keys.
Support for deriving private keys

* Default to unhardened derivation. Added --hardened-derivation option. HD paths denote hardened derivation with a 'h' suffix at each index.

* Added --no-progress to reduce output. Exit code indicates search success/failure. Option name cleanup.

* chia keys derive search can now search for multiple terms

* chia keys derive search can be restricted to searching pubkeys|privkeys|addresses|all

* Allow child-key derivation rooted from an arbitrary HD path

* Search derived keys rooted under an arbitrary HD path

* LGTM fixes

* Remove extra master_sk_to_wallet_sk_unhardened definition

* Cleanup and fixed search output

* Cleanup and comments

* Added tests for `chia keys` commands

* Using @pytest_asyncio.fixture to decorate empty_keyring() as suggested in pytest's output.

* Set asyncio-mode to auto to address pytest warning

* See if tests pass without checking exit status

* Added chia init step to tests that direclty invoke the `cli` function

* Explicitly add --root-path option to tests that run the `cli` function.

* Tests fix

* Re-enable checks against exit_code

* More fine tuning to address CI failures

* Changes to address naming and other feedback

* Updated tests
2022-01-25 20:42:16 -08:00
Matt Hauff
ba826da8fd
Fix sending CATs with the CLI (#9934)
* Re-add CAT sending to send CLI

* Fix missing memo param

* Address comments by @altendky

* mypy
2022-01-25 12:54:51 -08:00
Arvid Norberg
1a84ee8db1
fix mempool issue where it would reject a spend bundle that spends an ephemeral coin with an ASSERT_SECONDS_RELATIVE 0 condition. Such condition is a no-op in the main blockchain validation, so the mempool should also allow it. (#9882) 2022-01-25 11:11:19 -08:00
Arvid Norberg
5375c1a0af
[v2] remove unused counter column in hint table (for v2 schema) (#9778)
* remove unused counter column in hint table (for v2 schema)

* the new db file is expected to be empty. fail if any tables already exist
2022-01-25 07:45:54 -08:00
Gene Hoffman
3a4670c9d0
isort consensus for fun and profit! (#9834) 2022-01-25 07:42:19 -08:00
Arvid Norberg
8f83ba79bb
remove one magic number from weight_proof (#9929) 2022-01-25 07:39:38 -08:00
dustinface
eecc7cd1cd
plotting: Move show_memo out of PlotManager (#9932)
This flag is only used by the `chia plots check` command.
2022-01-25 07:37:39 -08:00
Mariano Sorgente
11fc35bbca
mempool: Change logging to use a larger TX, it was way too small (#9937) 2022-01-24 22:20:33 -05:00
Mariano Sorgente
4708db1b2c
Set reserved cores to 0 (#9790)
* Set reserved cores to 0

* Change reserved cores to 0.

* Remove wallet config since it's unused
2022-01-23 21:52:10 -08:00
dustinface
b2235699a7
harvester: Drop plot existance check in lookup_challenge (#9877)
Saves a `Path.exists()` call in each lookup which obviously can be more 
expensive in some setups + this is anyway the job of 
the `PlotManager` and the existance is already implied due to the plot 
being in `PlotManager.plots`.
2022-01-23 21:49:11 -08:00
Yostra
40fbc28a4a
clear cache on login (#9852) 2022-01-23 21:47:26 -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
Kyle Altendorf
5f4e39480e
Fix streamable for Python 3.10 (#9918) 2022-01-23 21:44:51 -08:00
Juraj Oršulić
515ee9b07e
Spelling nits in p2_delegated_puzzle_or_hidden_puzzle.py (#9913)
* Spelling nits

* One more

* ++
2022-01-23 21:44:25 -08:00
Kyle Altendorf
c1a8dac07c
Set default wallet: dns_servers in code (#9880) 2022-01-21 18:53:48 -08:00
Kyle Altendorf
ee9c7968a8
Pick TX type even when added coin has been spent (#9840) 2022-01-21 09:54:01 -08:00
Mariano Sorgente
f0a6189f2d
Move BLS validation to other processes during sync (#9746)
* Try putting BLS in multiprocess

* Fix test

* Fix test again

* Fix test again ^ 2

* Don't use cache unless necessary, cleanup of unused code.

* WIP fixing tests

* Blockchain tests passing

* Remaining tests and lint

* More test fixes

* Fix full_node_rpc test

* Fix remaining tests

* Correct boolean

* Don't validate sig if CLVM fails. Also testing signature validation properly

* Simplify block prevalidation API and improve tests

* Fix logic error and remaining tests

* Update comments and change to AssertionError

* Try to improve CI performance

* Fix mempool test, try to fix test_blockchain performance

* Set default argument to fix test

* Fix DB conversion test

* Use cache for validating signatures (#9859)

* Use cache for validating signatures

* comments: fix typo

* Don't rerun the super slow part of the test (#9887)
2022-01-20 14:50:41 -08:00
Matt Hauff
2e3c054c3a
Add remaining offer code to main (#9886)
* Add remaining offer code to main

* Fix compression test

Co-authored-by: Jeff <paninaro@gmail.com>
2022-01-20 14:49:31 -08:00
dustinface
2c4f4d78b3
plotting: Drop plot_removed and just check if the path is still there (#9879)
This saves a `Path.exists()` call for all plots for each refresh 
interval.
2022-01-20 07:48:01 -08:00
Kyle Altendorf
59f8feff59
Restore chia wallet add_token CLI (#9867) 2022-01-20 07:47:23 -08:00
Jack Nelson
467478ef75
add limit to creation of plotNFT's from the CLI (#9857)
* add limit to creation.

limit is 20 and can be overridden with --override_limit

* Fix english lint

* Update plotnft_funcs.py

* Update plotnft_funcs.py
2022-01-20 09:21:16 -05:00
Arvid Norberg
0554d92870
[v2] build indices last (#9856)
* drop pragma temp_store and cache_size

* defer creating indices until the conversion is done

* increase commit rate
2022-01-19 17:52:54 -08:00
Arvid Norberg
c780f0978c
add chia function to convert blockchain database to v2 (#9613) 2022-01-19 11:43:56 -08:00
Kyle Altendorf
69fe8751ba
Stop slicing No off No Info for connection hash status (#9803)
```
FULL_NODE 000.000.000.00                         50616/8444  a1b2c3d4... Jan 13 16:21:01      0.0|0.0    
                                                 -SB Height:        0    -Hash:  Info...
```

Should read `-Hash: No Info`
2022-01-19 11:41:08 -08:00
Jack Nelson
c1166584a7
Add ability to change payout address using cli. (#9835)
* Add change payout address

Tested and working on testnet10

* correct small mistake

* Update plotnft_funcs.py

* Update plotnft_funcs.py

* Make code look better

Thanks for the idea Quex.

Co-Authored-By: Matt Hauff <quexington@gmail.com>

* add auto switching from central server

* Revert "add auto switching from central server"

This reverts commit 93f10a35c8.

* Update plotnft_funcs.py

Co-authored-by: Matt Hauff <quexington@gmail.com>
2022-01-19 11:39:21 -08:00
Earle Lowe
142b0c5c5b
Safer check for pool_list in config (#9810)
* Safer check for pool_list in config

* safer pool_list check
2022-01-19 11:35:24 -08:00
Kyle Altendorf
2acf03e850
Default connect_to_unknown_peers to True (#9864) 2022-01-18 20:17:44 -08:00
Jack Nelson
f5f1c27859
Remove bintools from wallet api. (#9836)
* make the change

* add length check

* clean up code more.
2022-01-18 17:25:32 -05:00
Arvid Norberg
fa16829a1f
simplify run_generator by just returning the NPCResult. It already has an error field (#9850) 2022-01-18 11:05:57 -08:00
Kyle Altendorf
d52aaad143
Reorder wallet addition and puzzle hash interest (#9831) 2022-01-15 16:35:22 -08:00
wjblanke
6283f82f85
update sauce (#9816) 2022-01-14 11:59:46 -08:00
dustinface
896ef6e988
harvester: Reuse plot_public_key instead calculating it in each lookup (#9789) 2022-01-13 17:58:25 -08:00
Arvid Norberg
2851bedbcc
sanity check the blockchain database on startup. If we can't find a peak, we also should not find any coins (#9780) 2022-01-13 14:53:48 -08:00
Arvid Norberg
93d967525b
revert allow-upgrades configuration option. It makes it significantly more complicated to do proper database migrations (#9768) 2022-01-13 14:53:27 -08:00
Chris Marslender
516f5639db
Add testnet10 config (#9805)
* Add testnet10 config

* Add testnet10 to missed files

Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
2022-01-13 13:13:05 -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
c143b71c22
log the synchronous mode used to open the blockchain database in (#9781) 2022-01-11 15:32:05 -08:00
Earle Lowe
34d44c1324
Limit server to TLS 1.2 and set cipher list (#9195)
* Limit server to TLS 1.3 (also ran isort)

* Set minimum to TLS1.2 and add warning
2022-01-10 21:02:23 -08:00
xchdata.io
1495d40ff3
Cosmetic: fix timelord import sort order (#9441)
As introduced by the previous commit
ae8bdbc3c7.
2022-01-10 21:01:28 -08:00
arty
8610ab704a
Add commentary about sign_coin_spends and p2_delegated_puzzle_or_hidden_puzzle (#9452) 2022-01-10 21:00:24 -08:00
Kyle Altendorf
e498a406a0
Make the hard coded 2 reserved cores configurable (#9709)
* Make the hard coded 2 reserved cores configurable

* add missing reserved_cores parameters

* add missing reserved_cores parameters
2022-01-10 20:58:29 -08:00
xchdata.io
af0d6385b2
Remove unused Timelord#potential_free_clients (#9680)
`Timelord`'s `potential_free_clients` attribute is no longer used
anywhere. Seems to be a left-over from a big restructuring in
bbb3d28559.
2022-01-08 19:45:22 -03:00
Jack Nelson
d22976aebe
Add coin announcement to create signed transaction rpc call (#9735)
This will allow pool operators and developers to have more control of the types of transactions they create using the wallet RPC.
2022-01-07 10:16:24 -03:00
Yostra
13ff7489b6
better optimization of mempool (#9125) 2021-12-23 15:00:37 -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
3e895f9b62
remove zero condition cost constants. They only contribute complexity. They must be zero by consensus rules, they won't change. (#9657) 2021-12-22 18:49:52 -08:00
Mariano Sorgente
5ff92076b6
Add a comment for mempool replacement rules (#9632) 2021-12-21 10:18:47 -08:00
Mariano Sorgente
92c44bbe10
Increase timeout from 10 to 30 seconds while syncing, to allow for some slowdowns in peers. (#9634) 2021-12-20 19:08:21 -08:00
dustinface
6bc8a3e204
harvester: Refine log in Harvester._plot_refresh_callback (#9400)
Adds the total number of loaded plots to the plot refresh log of the
harvester's refresh callback and moves `started` and `batch_processed`
event logs from `INFO` to `DEBUG` level to reduce plot refresh related
logging.
2021-12-20 10:43:22 -08:00
Arvid Norberg
8ec2631d70
use context managers for database cursor objects & stream results (#9582)
* use context managers for database cursor objects, to ensure they are closed. Also stream results back from cursors, rather than reading the full list of results up-front

* Update chia/full_node/block_store.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-12-20 10:39:53 -08:00
Arvid Norberg
f1dcd36c2a
In main chain (#9550)
* add in_main_chain column to full_blocks table

* add test for block_store in_main_chain

* test block_store invariant
2021-12-17 14:37:45 -08:00
Kyle Altendorf
499d01a6c5
Extend the use of AmountWithPuzzlehash(TypedDict) and more uint64() (#9563) 2021-12-17 14:36:48 -08:00
dustinface
2ab146bf2d
plotting|tests|github: Fix and test re-loading/removal of plots where we missed the keys (#9578)
* tests: Allow to use custom keys in `BlockTools.new_plot`

* tests: Create three plots with `G1Element()` as farmer/pool key

But not add them as default plots. Just to have plots in the test cache with different keys from
within and outside the keychain for plot loading tests.

create

* test|github: Bump `test-cache` version to `0.28.0`

* plotting: Drop plots from `no_key_filenames` after the keys appeared

* plotting: Drop plots from `no_key_filenames` if the plot was removed

* tests: Test loading of plots where we miss the keys

* plotting: Use `x.copy()` instead of `list(x)`

* plotting: Add a comment about the missing keys plot removal

* tests: Fix after #9595
2021-12-17 14:36:29 -08:00
Arvid Norberg
9de8235691
extend chia init to support initializing an (experimental) v2 blockchain database (#9599) 2021-12-17 14:35:43 -08:00
Mariano Sorgente
2f86d0eee1
Ms.fix puzzle store (#9606)
* Fix puzzle store to 100 addresses

* Remove unnecessary function call

* Lint
2021-12-17 14:34:27 -08:00
dustinface
234d121c2a
chia|tests|pre-commit: Add missing __init__.py files (#8758)
* chia|tests: Add missing `__init__.py` files

* check and create needed __init__.py files via pre-commit

* plotting|tests: Handle `mypy` issues introduced by the `main` rebase

* pre-commit: Run `build-init-files.py` more verbose

* tests: Ignore `__pycache__` folders in `build-init-files.py`

* Update tests/build-init-files.py

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

* Update tests/build-init-files.py

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

* tests: Add shebang, make executable, add description

To `tests/build-init-files.py`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-12-16 18:52:46 -08:00
dustinface
aabc54bb53
plotting|tests: Fix try/except in PlotManager._refresh_task (#9588)
* plotting: Fix try/except in `PlotManager._refresh_task`

* tests: Move the start refreshing call into `PlotRefreshTester` ctor

It being in `run()` before where it was called every test iteration lead
to not detecting an issue with the try/except introduced in #9409. See
ee1dd1912f4678d7b960b670473bd4b3ffbd890b for the fix.
2021-12-16 15:14:34 -08:00
dustinface
a68ffecea1
plotting|tests: Fix and test removal of invalid plots (#9587)
* plotting: Drop from `failed_to_open_filenames` if the plot was removed

* tests: Test removal from `failed_to_open_filenames`
2021-12-16 15:14:12 -08:00
Kyle Altendorf
7af4a58b63
DaemonProxy request IDs should be hinted as strings (#9584) 2021-12-16 15:13:41 -08:00
Kyle Altendorf
1ec2fc1526
Fix new complaints from mypy 0.920 (#9586) 2021-12-15 17:52:25 -08:00
Arvid Norberg
31bb2c987a
remove block_records table, use the full_blocks table instead (with a new column) (#9510) 2021-12-15 15:25:00 -08:00
dustinface
b76b75f317
farmer|server|tests: Fix for farmer service crash if the keychain is empty (#9515)
* farmer: Run a start background task to wait if there are no keys yet

* farmer: Run the handshake in a background task if there are no keys yet

* tests: Yield the service in farmer/harvester setups

* tests: Introduce `start_service` in farmer/harvester setups

* server: Make `ChiaServer` and `Service` restartable

* tests: Test the delayed start/handshake in `test_farmer_harvester.py`

* tests: Move `test_farmer_harvester.py` to `tests/core/farmer_harvester`

Attempt to avoid issues due to the global block tools / shared keychain 
between tests

* farmer: Return `bool` in `Farmer.setup_keys`

* tests: Add `__init__.py` to `tests/farmer_harvester`
2021-12-14 18:03:59 -08:00
Chris Marslender
fc0b1dd7a4
Crawler retry db on lock (#9562)
* Remove initial writes to DB, since there is nothing new to write at this point

Both of these methods are called later after each crawler iteration. The lines being deleted write all the same data back to the DB right after the initial data was loaded FROM the DB in the "create" method call, which is a waste of time, especially for mainnet where there are hundreds of thousands of records to write back

* Add additional logs around DB writes

* Add a retry around writing to the DB in case something else has a lock on the DB

Metrics processes read from this DB periodically and sometimes things time out just right and we get a lock exception. Without this retry, we'd hit the other exception handler which doesn't allow the loop to continue
2021-12-14 18:01:45 -08:00
Arvid Norberg
a3c79c939d
use zstd compression for full blocks (#9492) 2021-12-13 22:44:29 -08:00
xchdata.io
41ff79a86c
Properly assign keyring observer to instance field (#9556) 2021-12-13 22:41:51 -08:00
Jeff
30a0ff02bc
Restore peer_db_path and wallet_peers_path config keys/values for downgrading from a newer install. (#9557) 2021-12-13 22:01:14 -08:00
Earle Lowe
7d801144ea
Add TLS version to collected crawler stats (#9534) 2021-12-13 08:40:22 -08:00
Kyle Altendorf
8bbbc7f9d8
Fix odd string format (#9508)
I would like to just have a list of strings instead of splitting, but let's at least have it be a clean string for now.
2021-12-13 08:39:36 -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
Arvid Norberg
5076348f2d
when validating blocks in the blockchain, we don't use strict-mode (safe mode) (#9544) 2021-12-11 15:20:09 -08:00
Matt Hauff
c6637455b3
Added sorting functionality to /get_transactions (#9278)
* Added sorting functionality to /get_transactions

* Added comment about reversals

* Add determinism and clean up reversal

* Change default back to 50
2021-12-10 15:19:58 -08:00
Kyle Altendorf
4ab1a8a798
Correct coin hints type hint to bytes (#9493)
* Correct coin hints type hint to bytes

* Update full_node.py
2021-12-10 15:01:09 -08:00
Kyle Altendorf
44b4d69ad7
Fix some hints (#9484)
* Fix some hints

* remove unused import

* correct AmountWithPuzzlehash.amount to be uint64
2021-12-10 15:00:43 -08:00
Kyle Altendorf
5eeec865e9
stub and use SizedBytes.fromhex() until upstream is released (#9458)
* stub SizedBytes.fromhex() until upstream is released

https://github.com/python/typeshed/pull/6201

* black

* more

* more

* more

* more

* more

* import TYPE_CHECKING via from

* more

* more

* catch up
2021-12-10 14:59:49 -08:00
Mariano Sorgente
99adab1b83
Do not included reversed blocks in get_blocks response if flag is provided (#9141)
* Do not included reversed blocks in get_blocks response

* Do not break RPC by changing the default behaviour, but instead add a flag.
2021-12-10 09:18:02 -08:00
Juraj Oršulić
9ec44cc2ac
Fix comment typo in the standard wallet puzzle (#9346) 2021-12-10 09:17:06 -08:00
Chris Marslender
772e607681
always update best timestamp even if we weren't able to connect to keep track of gossiped peers properly (#9538) 2021-12-10 09:16:17 -08:00
dustinface
ad7b549cbd
plotting|tests: Catch exceptions in the plot manager thread (#9409)
Without this the plot manager thread silently dies on exceptions and
refreshing just stops. This change leads to refreshing reset and a error
log on exceptions.
2021-12-07 09:57:24 -08:00
Geoff Walmsley
a085d26670
added get_coin_records_by_parent_ids to spend_sim (#9438)
* added get_coin_records_by_parent_ids to spend_sim

* fix linting errors
2021-12-07 09:56:37 -08:00
Arvid Norberg
8db6ee540d
[v2] Remove is_peak field (#9487)
* remove is_peak field, instead, store the peak hash in a single place

* Update chia/full_node/block_store.py

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

* Update chia/full_node/block_store.py

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

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-12-07 09:55:49 -08:00
Kyle Altendorf
475514db0b
fix a hint issue by just removing an _ (#9482) 2021-12-07 07:57:39 -08:00
Kyle Altendorf
9a6ab80f68
rename variable to avoid hint confusion (#9474)
Earlier in the function `peak_hash` is used and is detectible as
`bytes32`.  At this location it is assigned from an `Any` hinted
value thus leaving `bytes32` as a valid, although inaccurate,
hint.  Renamed to avoid this collision of uses.  When we ban `Any`
we will end up dealing with this.
2021-12-07 07:57:03 -08:00
Kyle Altendorf
c5902841de
Just use bytes32() some more (#9472)
* Just use bytes32() some more

* black

* more
2021-12-07 07:55:48 -08:00
Kyle Altendorf
406253f782
Adjust compress_root() to return bytes32 (#9470) 2021-12-07 07:55:04 -08:00
Kyle Altendorf
b998193c7e
create and use SizedBytes.from_hexstr() (bytes32) (#9467)
* create and use SizedBytes.from_hexstr() (bytes32)

* another

* more

* more
2021-12-07 07:54:26 -08:00
Matt Hauff
6a1f79f325
Add an RPC to get currently logged in fingerprint (#9436)
* Added /get_fingerprint to wallet RPC

* Added to client too

* return only the fingerprint

* Change RPC name

* Added test
2021-12-07 07:45:32 -08:00
Arvid Norberg
84c48469ed
remove unused field (is_block) from full_blocks and block_records tables (#9481) 2021-12-06 15:39:07 -08:00
Arvid Norberg
cd80f67d74
[v2] use binary fields in coin_store table (#9455)
* use binary fields on coin_store table

* fix coin_store benchmark format string
2021-12-06 11:22:12 -08:00
Arvid Norberg
a97b03ac56
use binary keys in block_store (#9454) 2021-12-06 11:21:48 -08:00
dustinface
59b8be5f72
chia|tests: Pass the loaded/removed plots with PlotRefreshResult (#9306)
* chia|tests: Pass the loaded/removed plots with `PlotRefreshResult`

Instead of just the counts.

* plotting: Default to `False` for `expected_result_matched`

* tests: Validate the loaded/removed plots match the expectations
2021-12-06 07:53:26 -08:00
Arvid Norberg
70d31a8c68
V2 database framework (#9442)
* fix block_store benchmark linting issues

* basic support for database versioning

* update benchmark to run v1 and v2
2021-12-03 13:52:10 -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
Florin Chirica
ae8bdbc3c7
Windows blueboxing. (#8394)
* Windows bluebox.
2021-12-01 11:32:49 -08:00
Arvid Norberg
a9d0346fd0
cache heigh-to-hash and height-to-ses maps between runs (#8771)
* factor out map of block height to block hash and sub epoch summary from blockchain into its own class, BlockHeightMap

* save and restore the height-to-hash map and height-to-sub epoch summary map to flat files, to imrove startup time. Add unit tests

* add back assert
2021-12-01 09:43:16 -08:00
Arvid Norberg
e10c58f66c
Spent field (#9386)
* ensure that the spent field is redundant. It can be deduced from (spent_index == 0)

* use spent_index instead of spent, in coin_record database

* since we don't use the spent-field, there's no need to query the database for it
2021-12-01 09:42:15 -08:00
Arvid Norberg
b91a0eaddc
avoid calling SpendBundle.fees() a second time in peak post processing 2. This is an expensive function, that's why we cache its result (#9434) 2021-12-01 09:41:50 -08:00
Arvid Norberg
f030e32edf
Name coin fields (#9381)
* name the fields we pull from the coin_records database

* we don't need to ask for the coin_name in coin_record lookups, we never use it
2021-11-30 06:43:54 -08:00
Arvid Norberg
8d617f0df0
_blockchain_lock_queue is not always initialized by the time we shut down (#9402) 2021-11-29 10:58:14 -08:00
Gregory
025c45f0b5
Chia Seeder (#8991)
* initial hack

* crawler

* add pytz

* Checkpoint.

* Catch some bugs.

* Localhost dig working.

* Checkpoint: return only high quality nodes.

* Statistics.

* Try improving finding reliable nodes.

* Bug.

* Move db to memory.

* Timestamp in the last 5 days.

* Increase crawl parameters, 180+ connections per sec.

* Bug.

* Optimize for DNS traffic.

* Prepare for hosting.

* Minimum height.

* Typo.

* Try catch everything.

* dnslib.

* Add db, format code.

* nits.

* No connections for the dns server.

* Rename src -> chia

* Fix some issues with v1.1

* Crawler task pool.

* Optimize closing connections.

* Split crawler and dns server.

* Install instructions.

* Catch startup bug.

* Try a big timeout for lock aquire.

* lint.

* Lint.

* Initial commit extended stats.

* Simplify code.

* Config.

* Correct stats.

* Be more restrictive in crawling.

* Attempt to fix stats bug.

* Add other peers port to config.

* Update README for the config.

* Simplify crawl task.

* Fix bug on restarts.

* Prevent log spamming.

* More spam prevention.

* Fix bug.

* Ipv6 (#1)

* Enable ipv6.

* Fix bug.

* Use numeric codes for QTYPE.

* ANY working.

* More spam prevention.

* Try to improve IPv6 selection.

* Log IPv6 available.

* Try to crawl more aggresive for v6.

* rename dns.py to crawler_dns.py so it doesn't conflict with imported package names

* Remove pytz package off dependencies

* Tidy-up ws_connection.py

* Fix spelling

* Reinstate chia-blockchain readme, with additional lines pertaining to the DNS introducer & crawler

* More detailed info in the README wrt Chia Seeder

* Nit

* More memetic naming of Chia Seeder

* Nit

* Add entry points

* Add entry in packages

* Patch some methods on the upstream server

* Update peer record fields

* Standard library imports first

* Crawler API check

* Reconcile crawl store

* Account for crawler_db_path in config

* Await crawl store load DB and load reliable peers

* Updates to crawler

* Rename to dns_server

* Crawler-specific overrides for the chia server

* Edit comment

* Undo changes to ChiaServer in view of crawler-specific overrides introduced in previous commit

* Nit

* Update service groups

* Expand name maps, mostly

* Fix the init config

* Remove unused import

* total_records unused at this stage

* Remove ios_reliable in peer_reliability table

* Remove row[20] entry

* Split overly long line

* Fix

* Type hint for ns_records

* Reconcile mismatch btw type int and uint64

* Type annotations in crawler

* Check whether crawl store is set

* Remove upnp_list

* Lint

* Chia Seeder CLI

* Lint

* Two white spaces

* 3rd party package import

* Cleaner way to handle overrides for ChiaServer method

* Address linter warnings

* Rename

* Nits

* Fix

* Change port #

* Most chia_seeder commands up and running

* Rename

* Progress of sorts

* Fix

* Improve legibility

* Fix naming

* Fix setup.py

* Lint

* None -> ''

* Remove whitespace

* Rename

* Log ipv6 better. (#9227)

* Log ipv6 better.

* Lint.

* -

* Undo GUI changes

* Another attempt

* GUI changes

Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: Florin Chirica <fchirica96@gmail.com>
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
2021-11-27 18:30:25 -08:00
Gregory
a80b7df38c
[Easy] Fix typo, and display overlap if applicable (#8992)
* VAILD_* -> VALID_*

* Display overlap, using format string literals

* Fix
2021-11-27 18:29:46 -08:00
Kyle Altendorf
bf01b58cb4
tweak mypy config (#9368)
* tweak mypy config

* add types-click to pre-commit
2021-11-24 13:06:39 -08:00
dustinface
b89d958108
server: Drop reply_to_request and use send_message instead (#9327)
It's doing the same thing.
2021-11-24 11:28:24 -08:00
dustinface
a95dfba70b
plotting|util|tests: Introduce chia.util.generator_tools.list_to_batches (#9304)
* plotting|util: Introduce `chia.util.generator_tools.list_to_batches`

* tests: Test `list_to_batches` in  `test_list_to_batches.py`

* util|tests: Return an empty iterator for empty input lists

* tests: Test list sizes from 1-10 in `test_valid`
2021-11-24 11:27:31 -08:00
Arvid Norberg
aacdc03188
Sql index changes (#9349)
* make the is_peak index smaller

* condition database updates on a configuration option

* drop unused coin_spent index

* drop redundant index on primary key

Co-authored-by: neurosis69 <83925572+neurosis69@users.noreply.github.com>
2021-11-23 13:23:07 -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
Arvid Norberg
2fb72c1297
tell sqlite to use the puzzle_hash index when looking up coins by puzzle_hash (#9352) 2021-11-23 09:53:33 -08:00
Chris Ross
2c4aaa1ec9
Resolve v6 addresses (#8861)
* Address deficiency discussed in #8552, add ability to resolve to IPv6
addresses for hostnames.

* If there is no prefer_ipv6 in the config, set it True (per @hoffmang9)
and write it back to config.yaml

* Pass prefer_ipv6 flag to get_host_addr, which required a little digging
for it in a few places that call get_host_addr.

* Update a couple things for consistency

* Move the load_config into Wallet's __init__ so it doesn't get called so
many times as it would in has_full_node.

* Pass None into get_host_addr if there's no preference in config, so we have only that one place where the coded default lives.  also fix an oversight where we were building a PeerInfo from a PeerInfo in some cases.

* Change the default here to match the default coded into util/network.py.  It seems that github testers can't handle trying to use IPv6 and this may be easier for average users (sadly)

* A test to see if manually creating the server on :: (IP6_ANY) lets tests connect to localhost with IPv6 on

* Revert back to IPv4 default and remove the override inserted into
TCPSite for testing.

* Don't test for ip6-localhost, as it's not on all systems.

* Bah.  Forced formatting of commented code...

* Add a type annotation for the addrset variable

* If we don't quote the socket enums, pylint gets upset because it has issues figuring out where/how they're defined.  So, quote them here.

Co-authored-by: Chris Ross <cross+chia@distal.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-11-22 14:34:03 -08:00
chuwt
e66e6505fa
full_node: break when having 3 peaks (#9101) 2021-11-22 13:17:58 -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
Don Kackman
3e2dc4d52f
add get_version to daemon wss endpoint (#8710)
* add get_version to damon wss endpoint

* add unit test for daemon::get_version

* use fixture for get_daemon

* fix flake8 warning in test

* Update server.py

Co-authored-by: wjblanke <wjb98672@gmail.com>
2021-11-19 22:43:44 -08:00
Earle Lowe
0d84578999
EL.Show NFT contract address on plot check (#8910)
* Show NFT contract address on plot check

* Update string for consistency with plotnft show
2021-11-19 11:27:49 -08:00
dustinface
584000f0b3
rpc|tests: Introduce RPC endpoint /get_routes (#9084)
* rpc: Move `RPCServer._wrap_http_handler` to `chia.rpc.util`

* rpc: Introduce `RPCServer.get_routes`

* rpc|tests: Introduce RPC endpoint `/get_routes`
2021-11-19 11:20:56 -08:00
Kyle Altendorf
420f9f066b
Avoid exception on shutdown from RpcServer._state_changed() (#9108)
```
2021-11-03T19:09:09.603 full_node chia.rpc.rpc_server     : WARNING  Sending data failed. Exception Traceback (most recent call last):
  File "/farm/chia-blockchain/chia/rpc/rpc_server.py", line 69, in _state_changed
    await self.websocket.send_str(dict_to_json_str(payload))
AttributeError: 'NoneType' object has no attribute 'send_str'
.
```
2021-11-19 11:18:45 -08:00
Kyle Altendorf
37e6a5f83c
Initialize FullNode._transaction_queue_task and avoid AttributeError on shutdown (#9182)
```python-traceback
Traceback (most recent call last):
  File "/farm/chia-blockchain/venv/bin/chia_full_node", line 33, in <module>
    sys.exit(load_entry_point('chia-blockchain', 'console_scripts', 'chia_full_node')())
  File "/farm/chia-blockchain/chia/server/start_full_node.py", line 60, in main
    return run_service(**kwargs)
  File "/farm/chia-blockchain/chia/server/start_service.py", line 255, in run_service
    return asyncio.run(async_run_service(*args, **kwargs))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1823, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.8/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
  File "/farm/chia-blockchain/chia/server/start_service.py", line 193, in _accept_signal
    self.stop()
  File "/farm/chia-blockchain/chia/server/start_service.py", line 210, in stop
    self._node._close()
  File "/farm/chia-blockchain/chia/full_node/full_node.py", line 704, in _close
    self._transaction_queue_task.cancel()
AttributeError: 'FullNode' object has no attribute '_transaction_queue_task'
```
2021-11-19 11:17:32 -08:00
Adam Kelly
1f0cd65f63
Show active network (#9194) 2021-11-19 11:16:35 -08:00
Kyle Altendorf
d45f8db533
Strip IPv6 [] correctly even with non-4-character segments (#9249)
* Strip IPv6 [] correctly even with non-4-character segments

For example, the existing code failed to properly strip
`[____:____:____:600:____:a2:____:____]` resulting in the trailing `]`
below.  (four character segments and node id redacted with `_`)

```
FULL_NODE ____:____:____:600:____:a2:____:____]   8444/8444  ________... Nov 12 20:46:47      1.5|18.9
                                                 -SB Height:  1131954    -Hash: 344cbef3...
```

* Simply IPv6 strip

Technically this hazards stripping multiple brackets from either end or a right bracket from the left, etc.  Perhaps this is ok.
2021-11-19 11:14:57 -08:00
dustinface
f8e8edc567
server: Refine return value of WSChiaConnection.send_message (#9305) 2021-11-19 11:13:50 -08:00
Jeff
c4e14f5c78
Peer db new serialization (#9079)
* Serialize/deserialize peer data alongside existing sqlite implementation (to be removed)

* Simplified AddressManagerStore. No longer uses sqlite and is no longer async.

* Removed aiosqlite usage from AddressManagerStore.
Added PeerStoreResolver class to determine the appropriate location for "peers.dat"
Updated initial-config.yaml to include "peers_file_path" default, replacing "peer_db_path" (similar change for "wallet_peers_path")

* Minor comment changes/additions

* Added migration from sqlite peer db.
Made AddressManagerStore's serialization async as it was right at the edge of blocking for too long.

* Minor tweaks to checking for migration

* Removed AddressManagerSQLiteStore class scaffolding

* makePeerDataSerialization now returns bytes instead of a PeerDataSerialization object

* Async file I/O for write_file_async using aiofiles
Added more tests

* Separate out the synchronous part of move_file

* Renamed write_file to files since we're opening up the capabilities a bit

* Update references to write_file

* Renamed test_write_file to test_files

* Tests covering move_file and move_file_async

* Minor refinements to behavior and tests

* Use aiofiles for reading peers.dat

* Added missing mypy typing info for aiofiles. Also added types-PyYAML to dev_dependencies so that `mypy chia tests` doesn't require running with --install-types

* Add types-aiofiles to the linting workflow

* Directory perms can now be passed into write_file_async.
Added an explicit f.flush() followed by os.fsync() after writing the temp file contents.
2021-11-19 11:12:58 -08:00
Arvid Norberg
a29b1158ee
fix lgtm issues (#9198) 2021-11-19 11:11:25 -08:00
Florin Chirica
13a49c7a2e
Fix wallet gossip. (#8709)
* Increase wallet sleep.

* Fix wallet gossip.

* Type checking.

* Add callable.

* Address comment.

* Remove Callable.
2021-11-10 10:39:56 -08:00
Jeff
c889d08756
Start plotting the next valid item in the queue, not the last (#9205) 2021-11-09 13:43:35 -08:00
Jeff
dfc6b7b835
Fixes for the --passphrase-file option (#9166)
* Fix support for --passphrase-file when using chia start

* Strip trailing CR/LFs when reading the passphrase from a file

* Improve error handling when --passphrase-file specifies a bad passphrase

* Handle case where the default passphrase is cached

* Formatting change made by black

* Escape hatch for the unlikely case that someone is using a passphrase with trailing CR/LFs
2021-11-09 11:00:06 -08:00
Jeff
1fd7197df0
CLI fixes for plotting with madmax (#9197)
* Fixed waitforcopy when using madmax CLI

* Fixed madmax CLI usage with the tmptoggle -G option

* Don't specify a default for tmpdir2

* Removed defaults for tmp/tmp2/final dirs. Values must be provided.
2021-11-09 10:52:09 -08:00
FazendaPool
a27c10ae50
Farmer reports Chia version to the Pool without breaking protocol (#9067)
* famer reports chia version to pool without breaking protocol

* fix linting

* fix linting
2021-11-04 20:24:46 -07:00
Yostra
39c9bc1a41
change constant (#9130) 2021-11-04 15:29:43 -07:00
Adam Kelly
869f39893c
Plotnft fees cmdline fix (#9129)
* 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.

* Make plotnft cmdline fees use XCH, like

* fix validator

* cmdline tests

* Remove duplicate option
2021-11-04 15:29:11 -07: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
Jeff
c80208cda9
Terminate madmax/bladebit on Windows on Ctrl-C (#9113) 2021-11-04 08:59:13 -07:00
Kyle Altendorf
eb62a28519
Add missing .name() in WalletStateManager.get_filter_additions_removals() (#8958) 2021-11-02 08:44:43 -07:00
justinengland
479f89c9b0 friendlier class calls 2021-11-01 22:39:26 -06:00
justinengland
acea2fccb4 black 2021-11-01 22:39:26 -06:00
justinengland
7aee94c82b removing is not none 2021-11-01 22:39:26 -06:00
justinengland
a7581a4692 adding any variable device 2021-11-01 22:39:26 -06:00
justinengland
99cbdedc1c using None again 2021-11-01 22:39:26 -06:00
justinengland
f79f07ab98 changing bool to string 2021-11-01 22:39:26 -06:00
justinengland
02ece9c549 replacing none with quotes 2021-11-01 22:39:26 -06:00
justinengland
2c54becd02 fixing bad include 2021-11-01 22:39:26 -06:00
justinengland
1e3985c56f syntax 2021-11-01 22:39:26 -06:00
justinengland
d6ff52cc0b syntax 2021-11-01 22:39:26 -06:00
justinengland
c32721d28c syntax 2021-11-01 22:39:26 -06:00
justinengland
552b4a1860 more formatting 2021-11-01 22:39:26 -06:00