Commit Graph

3854 Commits

Author SHA1 Message Date
Florin Chirica
bb662f27dc Address review comments. 2021-05-14 14:05:12 -06:00
Florin Chirica
3cbb5dc4d5 Fix bug. 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
Rostislav Skudnov
b2800c94fa
Optimize Streamable parsing by avoiding extra post-init checks (#4714)
* Optimize Streamable parsing by avoiding extra post-init checks

A performance test indicates that this optimization makes parsing block
records from database up to 40% faster (0.66 vs 1.09 seconds for 10000
records).

* Add type annotations, remove unnecessary .keys() call in Streamable

Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
2021-05-13 10:33:59 -07: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
Peter Tripp
178f63a3a3
exempt_peer_networks: allow exceeding target_peer_count. (#3234)
* exempt_peer_networks: allow exceeding target_peer_count.

* Flake8.

* Cleanup incorrect types.

* More typing.

* Added configuration examples for exempt_peer_networks.

* Be generous in the IP network definitions we allow as input.

* Correctly define 192.168.1.0/24 without host bits.

* Trivial change to re-trigger tests.

Co-authored-by: wjblanke <wjb98672@gmail.com>
2021-05-12 17:44:26 -07:00
An Long
eb7b6dd243
Makes linter happy (#2483) 2021-05-12 17:31:28 -07:00
Don Kackman
56890df98d
only copy cert files for init -c (#3328)
* only copy cert files for init -c

* fix linter error on single vs double quotes

* black formatting
2021-05-12 15:34:20 -07:00
An Long
5034fcc85d
Add more types (#3441) 2021-05-12 15:32:21 -07:00
Vyacheslav Linnik
2b19635d88
fix TypeError exception in case of unresponsive service (#4122) 2021-05-12 15:27:40 -07:00
J. Eckert
df7dad8634
quick fix to update out-of-date CLI reference to close issue 4397 (#4538)
* quick fix to update out-of-date CLI reference to close issue 4397

* additional typo fixes in the cmds section

* removed old reference to incline Mnemonic inclusion in chia keys add
e Please enter the commit message for your changes. Lines starting

* Update keys_funcs.py

fixed some rogue quote changes due to a text editor flub

Co-authored-by: J. Eckert <sargonas@Js-MacBook-Air.sargonas.net>
Co-authored-by: J. Eckert <sargonas@Js-MacBook-Air.local>
2021-05-12 15:24:55 -07:00
lamba09
080e830bb1
removes match_string variable (#4671)
The `match_string` variable is an alias of `grep_string` and thus can be
replaced by it.

Co-authored-by: Mario Seeli <mario.seeli@dectris.com>
2021-05-12 13:00:41 -07:00
Matty G
a56177ee56
Update to reflect CLI change (#4025) 2021-05-12 11:05:44 -07:00
Frederico Silva
abd01b1e83
cmd: farm challenges, add missing space (#4038) 2021-05-12 10:50:30 -07:00
Chris Marslender
536d33ef59
second check should be fee, not amount again (#4112) 2021-05-12 10:49:48 -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
Arvid Norberg
58a0eb548f
avoid calling header_hash repeatedly in weight_proof (#4060)
header_hash is a property that serializes and hash the foliage block, this is somewhat expensive, especially the serialization
2021-05-12 10:44:11 -07:00
Will Bendick
25f4b6c101
prevents multiple copies of same service with lockfile (#4713) 2021-05-12 10:43:22 -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
Yostra
60fd84191d
don't read from cli (#4625) 2021-05-12 10:38:35 -07:00
Felix
3c616e2eee
#4339 flag "Consensus error 124, not disconnecting" as info (#4695) 2021-05-12 10:37:31 -07:00
Chris Marslender
4fc32cb5a8
Add pending coin removal count (#4509) 2021-05-11 09:40:49 -07:00
Nikolaj Kuntner
cbc9141689
add all none's (#4503)
Co-authored-by: Nikolaj Kuntner <>
2021-05-10 22:05:45 -07:00
Benedict Jin
bac1b8db6b Remove the useless loop iterator variable for did_wallet 2021-05-09 23:31:18 -07:00
Alfonso Perez
1faa5e67af
Clarify units of amount and fees in wallet help dialog (#3472)
* clarify units of amount and fees

* format code to pass linting rules
2021-05-10 14:58:38 +09:00
Chris Marslender
61baae5648 Add unspent coin count to wallet balance API 2021-05-09 13:21:38 -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
justinengland
ec0a4cec4b fixing dupes 2021-05-05 18:19:45 -06:00
justinengland
3bfb6a7628 black stuff 2021-05-05 18:19:45 -06:00
justinengland
0f2af011d5 adding testnet0 back 2021-05-05 18:19:45 -06:00
justinengland
6d88e2e2f4 proper white space for precious python. 2021-05-05 18:19:45 -06:00
justinengland
b8b7f91dc6 syntax 2021-05-05 18:19:45 -06:00
justinengland
717f5dd995 syntax? 2021-05-05 18:19:45 -06:00
justinengland
a1e66ee7fb fixing linting errors 2021-05-05 18:19:45 -06:00
Justin England
ab38cae3f8 Update chia/cmds/configure.py
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
2021-05-05 18:19:45 -06:00
justinengland
36f8eae04e fixing line too long 2021-05-05 18:19:45 -06:00
justinengland
d4f2199c3a spacing 2021-05-05 18:19:45 -06:00
justinengland
d77c70bd4c better wording 2021-05-05 18:19:45 -06:00
justinengland
bce1c3fbe3 making easier to configure testnet settings 2021-05-05 18:19:45 -06:00
justinengland
ae9c2668bc removing _ 2021-05-05 18:19:45 -06:00
justinengland
7d32527706 fixing bad selectec network key 2021-05-05 18:19:45 -06:00
justinengland
5833b1f7a5 making port an int for printing 2021-05-05 18:19:45 -06:00
justinengland
fbe5ec3632 adding argument to configure function preamble 2021-05-05 18:19:45 -06:00
justinengland
bff9e4a248 adding configure options. removing old testnets 2021-05-05 18:19:45 -06: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
Arvid Norberg
b759958d13
fix indentation issue in message send retry logic. factor out retry coroutine (#3629) 2021-05-04 22:28:58 +09: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
Adam Kelly
faa5c832d1
hide secret wallet key by default with 'chia keys show' (#3565)
Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-05-03 12:55:00 -07:00
Arvid Norberg
912dc84663
don't increment counters for outgoing messages blocked by the rate limit. (#3518)
This was causing a problem where outbound messages, blocked by the rate limiter,
would still increment the counters as-if they had been sent. This, in turn,
could cause other message types to get blocked becuase the rate limiter thought
we had sent a lot of the other (blocked) message type.
2021-05-03 11:18:29 -07:00
Mariano Sorgente
5ce1bfc34c
Don't retry respond_peers message (#3508) 2021-05-03 18:58:17 +09: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
Mariano Sorgente
fe257cdfe1
Improve wallet consistency (#3305)
* Improve wallet consistency

* Improve CLI significantly, and fix self-tx balances

* Fix await

* Fix deadlock and test

* Remove spam.sh
2021-05-01 15:13:04 -04:00
Mariano Sorgente
d044cbb763
2 harvesting features (#3331)
* 3 harvesting features:
- Debug level shows the time for every quality lookup
- Warning level if takes longer than 5 seconds
- Allow configuration of plot loading interval (default 2 minutes)

* Comment out super logging
2021-05-01 10:16:19 -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
Mariano Sorgente
75d75de190
SES could corrupt DB. Also don't cancel a task which could lead to corrupt memory. (#3237) 2021-04-30 16:11:05 -04:00
Richard Kiss
a7f996b4dc
Tests skipping mempool (#3065)
* Avoid importing `test_constants` as it takes a long time.

* Some new tests that circumvents mempool.

* Fix lint problems.
2021-04-30 10:23:45 -07: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
Gene Hoffman
977928607c
Update CLI tools to use EiB when appropriate. (#3117) 2021-04-30 10:19:34 -07:00
Joel
c75bf4b2f4
fix takes 1 positional argument but 2 were given (#3202) 2021-04-30 10:18:20 -07:00
wjblanke
33a0c4c6ba
wait to end of process to avoid zombies (#3160) 2021-04-30 10:17:43 -07:00
Yostra
44728ff98d
increase ratio (#3155) 2021-04-30 10:14:56 -07:00
wjblanke
10dce11b42
fix plot dupe (#3154) 2021-04-29 22:39:39 -07:00
Yostra
17c45bf64e
just filter limit (#3152) 2021-04-30 01:00:09 -04:00
Yostra
f740056fb2
remove commit and not needed query (#3148) 2021-04-30 00:22:18 -04:00
Arvid Norberg
6cde47d112
cache VDF validation results (per process) (#3110) 2021-04-29 13:34:04 -07:00
matt-o-how
637177519a
Add announcements for standard tx (#3023)
* changed bahviour of wallet and wallet tools for standard solutions

* black formatting wallet_tools

* added a test for hypothetical stolen zero_output coin

* swap to sha256 from sha256tree for message

* fix wallet_tools version, address lint issues

* correctly int_from_bytes

* fix uninstantiated key in dict

* Comment out broken test

* Fix types (used SerializedProgram)

Co-authored-by: Mariano <sorgente711@gmail.com>
2021-04-30 03:13:00 +09:00
Mariano Sorgente
e611bef223
Use secure coin ids (#3095) 2021-04-29 13:30:24 -04:00
Antonio Borrero Granell
ad205d9cd6
Fix typo (#3069) 2021-04-29 13:30:07 -04:00
Mariano Sorgente
e3ab63a472
Ms.empty blocks3 (#3064)
* Fix empty blocks

* Remove error log

* Missing imports

* .header_hash instead of .prev_hash in simulator
2021-04-29 16:14:16 +09:00
Yostra
5f9f63155d
Add lock, keep cache consistent (#3051)
* execute task decorator

* use blockchain lock

* indentation

* lint

* execute_task
2021-04-29 16:13:00 +09:00
Adam Kelly
0f57b11af5
Fix memory bloat when displaying plot logs in GUI by sending only new changes (#2847)
* Fix memory bloat when displaying plot logs in GUI by sending only new changes

* Add updated lines field to plot logs message

* Send full log during service connection, and send log updates every time

* updated plot logs
fixed removing of the plots from the queue

* used message from main process

* used just one plot for serial plotting

* lint format

Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Zlatko <zlatko@chia.net>
2021-04-28 14:52:48 -07:00
Will Bendick
0810f4ab74
locks on updates to plot_ids (#3036) 2021-04-28 14:22:22 -07:00
Adam Kelly
ea10fcb0fe
Don't show mnemonic seed by default in chia keys show (#3032)
Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-04-28 12:45:37 -07:00
Mariano Sorgente
621c13c249
Improve safety of coin store (#2984)
* Improve safety of coin store

* Add test for exception

* Fix issue with fork_point_with_peak
2021-04-28 15:27:56 -04:00
Mariano Sorgente
b4f316555d
Decrease mempool size temporarily (#3018) 2021-04-28 10:53:29 -07:00
Mariano Sorgente
8aed3645be
1,2,3 mojo attack prevention (#3017) 2021-04-28 10:52:22 -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
2d4159d0b6
show syncing on long sync (#2985) 2021-04-28 10:50:44 -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
Mariano Sorgente
cb054ef72b
Hopefully reduce chances of nonce collision (#2161)
* Hopefully reduce chances of nonce collision

* No collisions
2021-04-28 13:34:32 -04: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
Yostra
47e6f0d4c6 count and time 2021-04-28 02:44:52 -04:00
Yostra
a614430952 cache and retry after 10 min and on startup 2021-04-28 02:29:15 -04:00
matt-o-how
c1846b0f49
Singleton improvements (#2286)
* Changed singleton to take puzzlehash as origin.
Updated DID wallet to use this

* fixed hex and sha256tree for singleton puzzle

* require more signature for DID spends

* fix singleton tests
black format did wallet

* fix broken test
fix linting
switch to inline functions

* remove unused defuns from singleton_top_layer
2021-04-27 11:25:33 -07: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
An Long
cb625117db
add more type hints (#2816) 2021-04-27 11:00:41 -07:00
Arvid Norberg
8717ca4b02
Leave programs in SpendBundle serialized (#2380) 2021-04-27 10:52:21 -07:00
Will Bendick
c75b826808
bytes to hex (#2856)
* converts bytes to hex

* line too long
2021-04-26 23:22:44 -07:00
Yostra
a929ec889e
Use lru cache (#2433)
* use lru cache

* use new func

* cache block after write is done

* dont iterate as orederd dict
2021-04-26 23:21:58 -07:00
Yostra
d88697ef42
more speed (#2223) 2021-04-26 23:21:24 -07:00
Yostra
4c98dd2b71
decorator (#2221) 2021-04-26 23:21:04 -07:00
Mariano Sorgente
cc1aba8c3b
Ms.ph scan (#2808)
* Work on offline signing

* Fix lint
2021-04-26 11:18:29 -07:00
Mariano Sorgente
e76bf3dad5
Create puzzle hashes in normal operation (#2783) 2021-04-26 11:16:31 -07:00
Martin Mihaylov
59de4ffe9f
Add back logging for added coins (#2720)
It was removed in commit ee3dfb9eb1 for
unknown reason. A few people on keybase have learned to rely on it to
check for new coins being received by their wallet. Arguably not the
best way to do so but seems like a useful log output to have in general.
2021-04-26 01:23:25 -07:00
An Long
e6f3db4e6a
Using the top level exceptions from aiohttp (#2700) 2021-04-26 01:23:06 -07:00
An Long
6027e8707c
fix type hint of harvester rpc client (#2706) 2021-04-26 01:22:31 -07:00
An Long
1ec9444950
Fix type hint error (#2605) 2021-04-24 22:33:26 -07:00
An Long
6b0a70ff8e
Raise error when convertbits got invalid data (#2612) 2021-04-24 22:32:40 -07:00
Christopher
d0649fb574
change default buffer size to 3389 (#2320) 2021-04-24 14:56:19 -07:00
Chida82
79ecc40d15
Add max files in rotation (#2502) 2021-04-24 02:17:36 -07:00
An Long
560074dc2c add more type annotations 2021-04-23 21:26:19 -07:00
Yostra
788b630487
More accurate fork point (#2428) 2021-04-23 14:08:15 -07:00
Yostra
4af65c328c avoid rollback when just advancing 2021-04-23 00:54:09 -07:00
Yostra
b3cc6bfe93 retry 2021-04-23 00:53:08 -07:00
Rostislav
933736be92 Add logging about replacing SpendBundles in mempool 2021-04-22 10:45:22 -07:00
Mariano Sorgente
b37305e85e
Fix adding double signage points (#2340) 2021-04-21 22:43:00 -07:00
Yostra
328e4cd276
Blockchain timestamps fix (#2302)
* incomplete push for debugging

* block timestamp in mempool

* rename

* farm tx block

Co-authored-by: matt <matt@chia.net>
2021-04-21 16:43:02 -07:00
Arvid Norberg
572110b7df
delay 5 seconds after connecting the introducer to give it a chance to add any peers we got from it (#2299) 2021-04-21 12:17:08 -07:00
Arvid Norberg
e55988479b
More tests (#2295)
Co-authored-by: Mariano <sorgente711@gmail.com>
2021-04-21 11:17:21 -07:00
Mariano Sorgente
c5595e280c
New puzzle hashes were not being created (#2270) 2021-04-21 10:45:43 -07:00
Almog De Paz
6af86811e5
fix unconfirmed tx race (#2266)
* add tx lock

* init lock

* call with async
2021-04-21 10:41:18 -07:00
Arvid Norberg
8c24306f88
exponentially back-off contacting the introducer (#2250)
* exponentially back-off contacting the introducer (until reaching 5 minute delay)

* bump introducer connection timeout from 10 to 30 seconds
2021-04-21 03:48:44 -07:00
Mariano
111edd71bc Also lock in removals 2021-04-21 18:17:40 +09:00
Mariano
9c11d41984 Remove blockchain lock 2021-04-21 18:06:43 +09:00
Yostra
eb86104139 introducers 2021-04-21 00:29:33 -04:00
Yostra
1e42b5596b ports 2021-04-21 00:27:21 -04:00
Yostra
207aed704f mainnet now 2021-04-21 00:26:18 -04:00
Yostra
b674f19203 fee part 2021-04-20 21:11:25 -07:00
Yostra
eb57fa7a77 remove 2021-04-20 21:11:13 -07:00
Yostra
7dcea45926
Pass correct blocks (#2229)
* Pass correct blocks

* Fix `mypy` lint.

Co-authored-by: Richard Kiss <him@richardkiss.com>
2021-04-20 19:19:15 -07:00
Mariano Sorgente
9fce41cfb7
Assert small messages (#2213)
* Assert small messages

* Update condition_tools.py

Add `TODO`.

Co-authored-by: Richard Kiss <him@richardkiss.com>
2021-04-20 17:51:48 -07:00
Adam Kelly
bc5efbbee9 Test passing multiple arguments as arguments to block generators 2021-04-20 17:07:36 -07:00
Arvid Norberg
f074f517e6
ping the introducer at least once on startup (#2214) 2021-04-20 15:20:09 -07:00
Mariano Sorgente
e62be6c422
Ms.block body tests (#2203)
* Start block body tests

* More tests

* More tests

* Improvements and security fixes to block body validation

* Revert bad test changes

* Fix check for ref list size
2021-04-20 12:18:16 -07:00
Gene Hoffman
1c62b1e4d7 Move Add rem to INFO log level, update GUI 2021-04-19 16:50:01 -07:00
Yostra
827af0b3dc
Testnet5 (#2153)
* testnet5

* testent5
2021-04-19 17:14:30 -04:00
Richard Kiss
170d451b7c
ROM now outputs (coin-spends . block-level-extras) (#2149)
* Change input to ROM to `(coin-solution-inputs . extras)`.

* Add `deserializer` to `generator_for_single_coin`.

* Fix last test.

* ROM now outputs `(coin-spends . block-level-extras)`
2021-04-19 14:04:55 -07:00
Lipa
3313edd7b4
Did for merge (#2144)
* rebase DID off main

* fix indentation and imports

* lint fixes

* fix test_compilation paths for new puzzles

* added _init__.py for did_wallet

* mypy typing fixes

* included did_wallet in setup.py module list

* stored pubkey & puzhash so that recovery_spend can choose not take them

* black missing comma

* add wallet id to return in get recovery info

* remove bad try statement

* fix DID recovery

* lint formatting, blacked

* use theirs for macos installer

Co-authored-by: matt <matt@chia.net>
2021-04-19 16:16:31 -04:00
Almog De Paz
e2459dae54
wp timeout from config (#2119) 2021-04-19 12:48:30 -07:00
Arvid Norberg
dca9936f1d
fix typo in condition opcode calculation (#2142) 2021-04-19 12:47:37 -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
e04b1eec7c
Don't run clvm twice for each block (#2135) 2021-04-19 12:46:23 -07:00
Richard Kiss
c3ebafdd31 Remove some obsolete comments. 2021-04-19 02:28:01 -07:00
Richard Kiss
212f5c7a61 Pass through spend_level_extras. 2021-04-19 02:28:01 -07:00
Richard Kiss
08b1dd3135 Improve format of COIN_SPEND output from ROM. 2021-04-18 23:40:06 -07:00
Richard Kiss
b3880d7ea7 Simplify CSE input format.
It was `((parent amount) (puzzle solution))`.
It is now `(parent puzzle amount solution . *spend_level_extras)`
2021-04-18 22:57:00 -07:00
Florin Chirica
17ff9166da Blank line. 2021-04-18 20:36:22 -07:00
Florin Chirica
68a11e5161 Initial commit cherry-pick #1398. 2021-04-18 20:36:22 -07:00
Richard Kiss
166ab7c99a Remove the tree abomination. 2021-04-18 18:58:56 -07:00
Richard Kiss
44ba53550d Rewrite "ROM" in clvm, including deserialization. 2021-04-18 16:02:53 -07:00
Yostra
03304d22dc timestamp 2021-04-18 15:43:34 -04:00
Mariano Sorgente
ee3dfb9eb1
Fix wallet performance if have many coins (#2047) 2021-04-18 10:52:07 -07:00
Mariano Sorgente
bca75b2859
Fix freeze RPC (#2053) 2021-04-18 10:51:30 -07:00
Mariano Sorgente
ad8847618a
Fix wallet reorgs, add cache for efficiency (#2022)
* Fix wallet reorgs, add cache for efficiency

* Fix lint
2021-04-18 18:30:22 +09: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
ceerRep
5335222ce9
Fix typo (#1997) 2021-04-17 23:59:30 -07:00
Yostra
9878eb5588
not callable (#2015) 2021-04-17 23:58:48 -07: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
615d8af00d
Add limit for AGG_SIG condition message of 1024 bytes. Catch any exception thrown in mempool block creation, and catch any excepction making a block, then make an empty block. (#2013) 2021-04-17 23:57:07 -07:00
Richard Kiss
f1be1714dc
Get rl_wallet clvm hex files loading. (#1999) 2021-04-17 12:02:08 -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
Arvid Norberg
dc7071f459
attempt to save time hashing PeerInfo objects in introducer (#1990)
* attempt to save time hashing PeerInfo objects in introducer, by moving attributes from hash tables into the peer object itself, where it belongs

* only remove peers after a few failures in a row, not immediately. Ensure we don't check peers too frequently.
2021-04-17 09:25:40 -07:00
Mariano Sorgente
5039a09ce6
Testnet3 (#1985) 2021-04-17 16:40:51 +09: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
Richard Kiss
9872525f80 Remove message from (x). 2021-04-16 21:22:46 -07:00
Rostislav Skudnov
f9ac890090
Change mempool rules for replacing conflicting SpendBundles (#1971)
Require that a conflicting SpendBundle must not only have higher fee per
cost, but also increase the total fee by at least 0.00001 XCH and spend
all coins that were spent in the set of conflicting SpendBundles.

Refactor and update tests of conflicting spends (aka double spends) in
mempool.

Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
2021-04-16 18:20:21 -07:00
matt-o-how
1d6bc440c7
Deleted blockchain_check_conditions (#1966)
* deleted blockchain_check_conditions and added optional timestamp to mempool_check_conditions

* removed unnecessary code

* change back to < for block height

* time now passes on equal to condition value
2021-04-16 14:02:06 -07:00
Florin Chirica
ae911f53c4
Wallet sleep before finding connections. (#1968) 2021-04-16 13:31:36 -07:00
Bill Blanke
3629b071b2 adding prefix for testnet2 2021-04-15 21:14:03 -07:00
Yostra
64b63f4ed5
lower freeze time (#1941) 2021-04-15 19:28:55 -07:00
Andrew Martin
add5b3bbc9
fix typo in keys documentation (#1933) 2021-04-15 13:03:51 -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
24fdd378a7
Transaction matching (#1932)
Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-04-16 03:23:40 +09:00
Arvid Norberg
cab78c43a6
update cost and max cost according to new plan (#1864)
* update cost and max cost according to new plan
of even split between (1) generator program size (2) generator program CPU and
memory costs (3) CREATE_COIN conditions for and archetype block with 1000
vanilla transactions, 2 inputs and 2 outputs each.

update costs of conditions to use the same unit (as CLVM). Remove CLVM_COST_RATIO_CONSTANT

Add COST_PER_BYTE constant, defining the cost for each byte of generator program.

* bump clvm and clvm_rs versions

* fix typo in setup.py
2021-04-15 20:16:52 +09:00
Adam Kelly
82876587ca Generator Block Decompression 2021-04-14 20:03:37 -07:00
Adam Kelly
e7627c567f Change generator ref error message name 2021-04-14 20:02:10 -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
Mariano Sorgente
cbbf365dc9
Smoother netspace (#1894)
* Smoother netspace

* Change cli as well
2021-04-14 11:52:39 -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
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
49219ea950
Improve get_name_puzzle_conditions, add typing, avoid re-implementing… (#1846)
* Improve get_name_puzzle_conditions, add typing, avoid re-implementing sensitive serialization logic

* Lint
2021-04-14 14:03:33 +09:00
Mariano Sorgente
a2ca057b49
Ms.aggsig me challenge (#1843)
* Start aggsig me

* Pass in genesis challenge

* Update DID, and remove useless functions from coinbase.py

* Unused imports

* Revert GUI

* Use a different constant so forks of chia can easily change it
2021-04-14 14:03:14 +09:00
Mariano Sorgente
0d8cfa1cff
Plot tools fixes (#1848)
* Reduce chance of race conditions, and don't throw when we don't have plots

* use cleaner initial value
2021-04-14 13:21:14 +09: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
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
almog
e9ca611a85 get_block_records_at get only blocks that are part of the chain 2021-04-12 10:21:05 -07:00
Jesús Espino
181f2fefa3
Add --offset flag to the wallet get_transactions command (#1802)
* Add --offset flag to the wallet get_transactions command

* Running black
2021-04-11 22:23:49 -07:00
Yostra
a142f10cfd
Init as None (#1814)
* init as None

* lint

* fix import from asyncio

Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
2021-04-11 20:35:51 -07:00
Yostra
06e871c5d5 cancel safely 2021-04-11 18:42:13 -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
Will Bendick
7d6ea6a39d removes shared dict 2021-04-09 10:06:45 -07:00
Will Bendick
4c45451864 appease mypy 2021-04-09 10:06:45 -07:00
Will Bendick
232454f2cd returns total size instead of updating non local variable 2021-04-09 10:06:45 -07:00
Will Bendick
b350065ebb lint 2021-04-09 10:06:45 -07:00
Will Bendick
c62f1cea68 lint 2021-04-09 10:06:45 -07:00
Will Bendick
9d715b9a74 loads plots concurrently 2021-04-09 10:06:45 -07:00
Richard Kiss
8c96651a78 Revert erroneous type change in CostResult. 2021-04-08 21:16:30 -07:00
Richard Kiss
7506f64c35 Rename to ConditionWithArgs. 2021-04-08 11:35:50 -07:00
Richard Kiss
7472d74799 Remove as_python; add some types. 2021-04-08 11:35:50 -07:00
Adam Kelly
8b97545455 Use the new 2 argument form of substr from clvm 0.9.5 for a smaller deserializer 2021-04-07 19:04:11 -07:00
Mariano Sorgente
bee0a42714
Ms.double count (#1734)
* Found the source of the counting issue. An overflow block which is not the first
2021-04-08 00:31:58 +09:00
Mariano Sorgente
07a6ba5274
Retrieve transaction using bytes tx_id, and add comment (#1729) 2021-04-08 00:31:33 +09:00
Mariano Sorgente
876692631a
Fix issue with error handling in timelord. Show infusion rate for all… (#1716)
* Fix issue with error handling in timelord. Show infusion rate for all timelords (even slow ones), and fix logging for rate limiting

* Fix another issue

* Further improvements in crashes, and better counting

* Don't error if we cannot infuse

* flake8

* more flake8

* Improvements for not the fastest timelord

* Don't double count

* Don't double count (again)
2021-04-06 19:48:46 -07:00
matt-o-how
5e1bf6d5f3
Merge DID into main (#1720)
* rebase DID off main

* fix indentation and imports

* lint fixes

* fix test_compilation paths for new puzzles

* added _init__.py for did_wallet

* mypy typing fixes

* included did_wallet in setup.py module list

* stored pubkey & puzhash so that recovery_spend can choose not take them

* black missing comma
2021-04-06 19:31:44 -07:00
Yostra
43c02e513a use wal and full sync mode 2021-04-06 18:22:01 -07:00
Yostra
a69abb1717 don't start with api requests before ready 2021-04-06 17:50:25 -04:00
Richard Kiss
7906d02990 Simplify pyinstaller.spec. Solve daemon/chia name collision. 2021-04-06 13:29:41 -07:00
Yostra
660970f53f reduce by 100x 2021-04-05 21:12:09 -06:00
Gene Hoffman
f9487f576d Fix various lgtm.com issues 2021-04-05 02:10:29 -07: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
b9b3368866 Put data files in subdirectory due to name collision. 2021-04-04 21:41:39 -07:00
Richard Kiss
f2b577dda1 git mv src chia 2021-04-04 21:41:39 -07:00