Commit Graph

37 Commits

Author SHA1 Message Date
Arvid Norberg 7800dbb58c
Cleanup shutdown (#6011)
* ignore signals in subprocesses

The sub-processes started by ProcessPoolExecutor will also receive SIGINT when the main process receives it. This results in the signal handler running in every subprocess and fail to create the task to close all connections. They print this error to stdout

* cleanup UPnP shutdown

make an explicit call to UPnP shutdown() (which joins the thread). Improve logging a bit

* wait for initialize_weight_proof task when shutting down
2021-05-26 12:18:12 -07:00
Arvid Norberg 203232e429
add profiler to wallet process (#6019) 2021-05-26 11:01:17 -07:00
Arvid Norberg a522745ff1
rename semaphore variables to not be confused with mutexes (#5604) 2021-05-25 13:16:30 -07:00
Almog De Paz f1120d9d5d
Different lock for compact proofs (#5539)
* test

* compact proof lock

* lint

* remove wrong commit

* remove wrong commit

* check vdf info for ip and sp

* return if no proof to replace
2021-05-20 11:51:58 -07:00
Mariano Sorgente ac59ec52c6
Fix pending transaction issue, and use a different lock to prevent ho… (#5549)
* Fix pending transaction issue, and use a different lock to prevent holding blockchain lock

* Force re-run of tests
2021-05-19 18:19:52 -07:00
Yostra 108647112c
Wallet (#4887)
* spent height

* handle generator reorg

* tx cache

* coin cache

* rebuild cache if write fails

* save last few messages new_peak while syncing

* don't use dupe func

* tx reorg test

* lock not needed

* lint

* lock

* modify properly

* this shouldn't hit a disk ever

* use same number

* notify wallet only once, lock when getting a balance

* lock only if unspent coin records is None

* assert spent

* lint

* Add test for prev generator

Co-authored-by: Mariano <sorgente711@gmail.com>
2021-05-19 12:06:48 -07:00
Mariano Sorgente 1c808b6c29
Ms.spikes4 (Fix duplicate signage points) (#4844)
* Fix duplicate signage point spikes

* Block record not hash

* Fix bugs in signage point cache

* Fix test, and log in debug level

* Change transaction logging to info

* More logging improvements
2021-05-16 11:33:47 -07:00
Arvid Norberg a7d607ee90
block_store performance (#4573)
* compute header_hash once

* read header_hash from the DB instead of computing it
when adding a block to the block store, also add it to the cache. This saves an otherwise mandatory round-trip to the DB.
2021-05-14 13:23:34 -07:00
Florin Chirica bb662f27dc Address review comments. 2021-05-14 14:05:12 -06:00
Florin Chirica ca09382fe5 linter. 2021-05-14 14:05:12 -06:00
Florin Chirica 413d29083f Initial commit. 2021-05-14 14:05:12 -06:00
Almog De Paz 3277058372
optional no_tx_filter (#4560)
* add no_tx option to get_header_blocks_in_range

* add type

* get_header_block_by_height no_tx_filter

* double negetive

* add param name

* param name

* change filter to false

* test header hash

* lint
2021-05-13 10:29:53 -07:00
Arvid Norberg 12751ce811
add simple profiler, enabled by enable_profiler config (#4054)
Analyze profilers with chia/utils/profiler.py
2021-05-12 10:46:38 -07:00
Felix 3c616e2eee
#4339 flag "Consensus error 124, not disconnecting" as info (#4695) 2021-05-12 10:37:31 -07:00
Nikolaj Kuntner cbc9141689
add all none's (#4503)
Co-authored-by: Nikolaj Kuntner <>
2021-05-10 22:05:45 -07:00
Mariano Sorgente 5d3d4bbefc
No negative amounts (#4294)
Mempool no negative amounts
Don't disconnect for COIN_AMOUNT_NEGATIVE
2021-05-10 01:28:15 +09:00
Mariano Sorgente 88310d6142
Mempool sorting and accept reverted pending transactions (#3683)
* Sort by fee/cost, and fix pending tx issue in reorgs

* Fix test name

* Bring the seen list size back to normal.
2021-05-04 11:21:27 -07:00
Almog De Paz 859a080637
brake if end of ses list (#3583)
* brake if end of ses list

* log

* throw if wp peak is not heavier

* comment

* handle sync from scratch

* comment
2021-05-03 18:40:12 -07:00
Yostra 976678d651
More performance (#3279)
* speed

* more speed

* same event loop init

* typo

* sempahore

* ignore if more than semaphore

* higher_compact_semaphore

* don't ignore
2021-04-30 22:44:12 -07:00
wjblanke ec48e968a9
increase wp timeout from 3 minutes (2 megabit) to 6 minutes (1 megabit) (#3022) 2021-04-28 10:51:18 -07:00
Almog De Paz eae1cb6220
check summaries on long sync (#2894)
* check summaries against wp on long sync

* lint

* move summary check to receive_block

* lint

* lint

* ban peer if bad response during batch sync

* fix typo
2021-04-28 10:50:16 -07:00
Yostra 4ef3777119
Avoid multiple requests (#2860)
* avoid dupe requests

* move to store, clean tasks

* linting

* limit

* 10peers,5sec
2021-04-28 02:58:45 -04:00
Almog De Paz 50164d16d3
Farm while syncing (#2195)
* add long sync lock

* lint

* test getting new high peak while synced

* lint

* fix logs
2021-04-27 11:05:16 -07:00
Yostra 788b630487
More accurate fork point (#2428) 2021-04-23 14:08:15 -07:00
Mariano 111edd71bc Also lock in removals 2021-04-21 18:17:40 +09:00
Yostra b674f19203 fee part 2021-04-20 21:11:25 -07:00
Almog De Paz e2459dae54
wp timeout from config (#2119) 2021-04-19 12:48:30 -07:00
Mariano Sorgente a3fd085924
Ms.double blocks fix 2 (#2129)
* Fix issue with double blocks

* Fix shadow variable name, and lint

* improve debug log

* Fix case of empty block

* Test for recursive handling

* pytest level
2021-04-19 12:47:00 -07:00
Mariano Sorgente 90dfdeb29a
Ms.signage points 2 (#2024)
* imporve signage points farmign

* Add test and more fixes

* Remove await

* Fix lint

* Unused import
2021-04-18 18:29:53 +09:00
Yostra 03784c9cd5
WhenMainnet (#2011)
* timestamp

* freeze

* root

* prepare for mainnet

* lint

* update constants

* starting diff

* remove breakpoint
2021-04-17 23:57:58 -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
Almog De Paz e3676f130f
Add segments to db while synced (#1885)
* create segments on restart
cache segment on respond block

* save segments by header hash

* logs

* lint

* logs

* use hex

* add done check

* add done check
2021-04-14 11:22:25 -07:00
Mariano Sorgente d2466ee822
Ms.mempool improvements (#1823)
* Remove overflow from list, and remove useless call to handle_eos

* Unindent

* Changes to mempool

* tests

* progress on tests

* Add tests for new mempool

* Fix lint and revert streamable changes

* Improve logging

* Test level warning

* Fix test

* Increase mempool size to 150x
2021-04-13 21:19:12 -07:00
Yostra 773adfade5
Lock for all writes (#1758)
* lock for all writes

* use async  with where convinant

* wrapper

* more

* lint

* update wallet

* rl wallet

* indentation

* fix tests

* bad path merged into main

* wallet lock

* refacoted by mistake

* re-raise

* memory/disk inconsistency

* more inconsitency

* asyncio.cancelled is baseexception in 3.8 and 3.9
2021-04-10 19:07:02 -07:00
Yostra a69abb1717 don't start with api requests before ready 2021-04-06 17:50:25 -04:00
Mariano 691534f3fe Removes warnings by renaming some protocol messages. Also improves error handling for timelord. 2021-04-04 23:54:11 -07:00
Richard Kiss f2b577dda1 `git mv src chia` 2021-04-04 21:41:39 -07:00