Commit Graph

1068 Commits

Author SHA1 Message Date
almog b1bdc3dc56 switch log level back 2021-05-27 18:51:09 +03:00
almog 149e16403b switch log for fixing ci 2021-05-27 18:31:16 +03:00
Nikolaj Kuntner 0b3124821f
bytes formatting simplify (#6021)
* init

* Add dash in README

* add more test cases

* whitespace around ==

* explicit return

* add another large test case
2021-05-26 11:11:44 -07:00
Ruslan Skorb 9e21716965
Add format_bytes(bytes:) function to convert bytes to human readable string. (#5449) 2021-05-24 22:14:29 -07:00
Arvid Norberg 2ddc48d0b9
remove unused get_block_records() function (#5016)
* remove unused get_block_records() function

it's only used by one test. It's also a dangerous function since the whole chain may become very large, and may not fit in memory

* fixup tests

* fixup test
2021-05-24 12:02:54 -07:00
elliottback 6f06f047a5
Add an explicit error message (#4758)
* Add an explicit error message when mnemonic words are not in the dictionary; should help users self-service issues like #3425 faster.

* fix lint

* fix lint x2
2021-05-21 18:14:49 -07:00
Mariano Sorgente a76446eba9
Speedup normal sync and wallet sync (#5590)
* Correctly return from bytes without parsing

* Huge speedup for wallet sync

* Lint

* Only construct CoinRecord when necessary

* Punt on creation of coin

* Removing warning log

* Flaky test

* Finally fix flaky test
2021-05-20 10:42:22 -07:00
Adam Kelly 15d4938a8c
Please add comments (#5565)
* Please add comments

* Fix issue

* More blocks

Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Mariano <sorgente711@gmail.com>
2021-05-20 11:40:36 +09:00
Adam Kelly c9f942b5fe
Improve time_out_assert messages (#5561)
Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-05-19 16:41:38 -07:00
Bill Blanke 207c83eabb tweak timeouts 2021-05-19 16:25:58 -07:00
Bill Blanke 18ccda9310 wait after farm_new_transaction_block 2021-05-19 13:44:09 -07:00
Bill Blanke 50ff07e687 wait after farm_new_transaction_block 2021-05-19 13:40:36 -07:00
Bill Blanke a0927402ac wait after farm_new_transaction_block 2021-05-19 13:30:42 -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
Mariano Sorgente 92282fb954
Performance benchmark test (#4942)
* Performance benchmark

* dump profiles for the full node benchmarks

Co-authored-by: arvidn <arvid@libtorrent.org>
2021-05-14 14:08:18 -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 07f8ed198f Make sure we don't call dns in tests. 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
Nikolaj Kuntner 2faab1ea83
Improve style consistency in root directory docs files (#4493)
* Improve style consistency

* black python required blank

Co-authored-by: Nikolaj Kuntner <>
2021-05-12 13:12:30 -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
Nikolaj Kuntner cbc9141689
add all none's (#4503)
Co-authored-by: Nikolaj Kuntner <>
2021-05-10 22:05:45 -07: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
Mariano Sorgente c72d065f6b
Fix test (#3350) 2021-05-04 09:34:48 -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
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
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 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 8aed3645be
1,2,3 mojo attack prevention (#3017) 2021-04-28 10:52:22 -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 92cd23cbaf
Filter test (#2980)
* reenable

* lint
2021-04-28 17:17:09 +09: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
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
Mariano Sorgente cdf9e1aaaa
Add tests for LRU and coin store (#2925) 2021-04-27 10:58:59 -07:00
Arvid Norberg 8717ca4b02
Leave programs in SpendBundle serialized (#2380) 2021-04-27 10:52:21 -07:00
Yostra 4c98dd2b71
decorator (#2221) 2021-04-26 23:21:04 -07:00
Rostislav Skudnov 1f16bca87f
Update and re-enable Merkle set test (#2824)
Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
2021-04-26 11:20:08 -07:00
Mariano Sorgente cc1aba8c3b
Ms.ph scan (#2808)
* Work on offline signing

* Fix lint
2021-04-26 11:18:29 -07:00
Rostislav 33c4529f61 Add extra tests for replacing conflicting 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 e55988479b
More tests (#2295)
Co-authored-by: Mariano <sorgente711@gmail.com>
2021-04-21 11:17:21 -07:00
matt 1b81c2f14f fix broken test 2021-04-20 18:18:24 -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
Richard Kiss 50f9d8b4c2 Add some ROM tests. 2021-04-20 17:08:27 -07:00
Adam Kelly bc5efbbee9 Test passing multiple arguments as arguments to block generators 2021-04-20 17:07:36 -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
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