Commit Graph

194 Commits

Author SHA1 Message Date
dustinface
17b061d1d7
farmer: Update payout_instructions on the pool if changed (#7161)
* farmer: Refactor `update_pool_farmer_info`

Return the actual `GetFarmerResponse` object and a flag if the farmer is
known on the pool or not.

* farmer: Call `PUT /farmer` if the `payout_instructions` changed

* farmer: Force farmer update, don't directly call `update_pool_state`

Let the periodical task handle the update.

* farmer: Temporary fix for `Streamable` not supporting JSON `Optional`

* tests: Call `update_pool_state` after `set_payout_instructions`
2021-07-07 09:37:23 -07:00
dustinface
af30ce78a2
farmer|cmds: Improve remote harvester info (#6979)
* farmer|cmds: List harvester by IP/peer_node_id instead of IP/port

* farmer: Cache harvester responses

* test: Trigger `update_cached_plots` and adjust `get_plots` format

* farmer|cmds|test: Adjust RPC output of `get_plots`

* rename: Farmer RPC `get_plots` to `get_harvesters` + rename related code

* farmer: Fix remove loop indentation

* farmer: Catch exceptions in `_periodically_clear_cache_and_refresh_task`

* cmds: Distinguish between local and remote harvesters

* cmds: Explicitly check against 0

* cmds: Rename `print_harvesters` -> `process_harvesters`
2021-07-06 20:20:21 -07:00
Earle Lowe
46395374ae
Improves error handling for unknown protocol types (#7073)
* Improves error handling for unknown protocol types

* Add test for invalid protocol
2021-07-01 21:20:21 -07:00
Arvid Norberg
3b71210a9c
in strict/safe mode, require integers to use the minimal/canonical encoding (#7071) 2021-07-01 21:19:47 -07:00
Adam Kelly
89f7a4b3d6
Pools mainnet (#7047)
* added clarifying comments

* WIP test

* added WIP test

* Refine genesis challenge. Remove unnecessary pool_puzzle function

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

* Rename create_member_spend to create_travel_spend

* Add singleton id logging

* Enhance logging for debugging

* renaming

* rephrase inside the puzzle

* fixed signing and added some support functions

* Fix issue with announcement

* Progress spending the singleton

* Fix arguments to pool_state_to_inner_puzzle call

* Fix arguments to pool_state_to_inner_puzzle

* Improve error message when wallet is not running

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

* Fix parent coin info bug

* Multiple state transitions in one block

* Lint

* Remove assert

* Fix incorrect p2_singleton_ph calculation (thanks nil00)

* Update waiting room puzzle to accept genesis_challenge

* Update calls to create_waiting

* Go to waiting state from committed state

* Augment debug_spend_bundle

* fix 2 bugs in wallet

* Fix lint

* fix bad_agg_sig bug

* Tests and lint

* remove breakpoint

* fix clvm tests for new hexs and hashs

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

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

* The exception doesn't need to be there

* CI Lint fix

* Added lifecycle tests for pooling drivers (#6610)

* Ms.poolabsorb (#6615)

* Support for absorbing rewards in pools (untested)

* Style improvements

* More work on absorb

* Revert default root and remove log

* Revert small plots

* Use real sub slot iters

* Update types

* debug1

* Fix bugs

* fix output of agg sig log messages

* Make fewer calls to pw_status in test

* remove old comment

* logging and state management

* logging

* small bug fix & rename for accuracy

* format

* Fix types for uncurry function

* lint

* Update test to use exceptions

* Change assumptions about self-pooling in lifecycle test

* Install types for mypy

* Revert "Install types for mypy"

This reverts commit a82dcb712a.

* install types for mypy

* install types for mypy

* More keys

* Remove flags requiring interactive prompts

* Change initial spend to waiting room if self-pooling

* lint

* lint

* linting

* Refactor test

* Use correct value in log message

* update p2_singleton_or_delated_puzhash

* initial version of pool wallet with p2_singleton_or_delay

* run black formatting

* fix rebase wonkiness

* fix announcement code in p2_singleton_or_delayed

* removed redundant defaulting
standardised hexstr handling

* lint fixes

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

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

* Lint fix

* Fixed plotnft show and linting errors

* fixed failing farmer/harvester rpc test

* lint fix

* Commenting out some outdated tests

* Updated test coverage

* lint fix

* Some minor P2singleton improvements (#6325)

* Improve some debugging tools.

* Tidy pool clvm.

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

* Use better name `SINGLETON_MOD_HASH`.

* Finish lifecycle test suite.

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

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

* Default delay time was being set incorrectly

* Extracted get_delayed_puz_info_from_launcher_spend to driver code

* Ms.taproot plot2 (#6692)

* Start work on adding taproot to new plots

* Fix issue in block_tools

* new test-cache

* Lint

* DID fixexs

* Fix other tests

* Python black

* Fix full node store test

* Ensure block index <= 128 bits.

* fix test_pool_config test

* fix comments in pool_config and in chialisp files

* self_pool -> pool -> self_pool

* Implement leaving pools

* Fix conflicts with main via mini-rebase

* Fixup rebase mistakes

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

* Fix adapters - Thanks Richard

* build tests

* Add pools tests

* Disable DID tests

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

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

* protocol|farmer: Introduce and use `PoolErrorCode`

* rename: `pool_payout_instructions` -> `payout_instructions`

* refactor: `AuthenticationKeyInfo` -> `authentication_key`

* refactor: Move `launcher_id` up

* rename: Some variable name changes

* rename: `points_balance` -> `points`

* format: Squash aggregation into one line

* farmer: Make `update_pool_state` public

* farmer: Print traceback if `update_pool_state` fails

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

* farmer: Add `authentication_token_timeout` to `pool_state`

Fetch it from `GET /pool_info`

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

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

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

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

* farmer: Hash messages before signing

* pools: Drop unused code

* farmer: Fix aggregation of partial signatures

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

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

* pool: add error code for delay time too short

* farmer: cleaner logging when no connection to pool

* farmer: add harvester node id to pool protocol

* Rename method (test fix) and lint fix

* Change errors to warnings (pool communication)

* Remove pool callbacks on a reorg

* farmer: Continue earlier when no pool URL is provided

* farmer: Print method in log

* farmer: Handle exceptions for all pool endpoint calls

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

* farmer: Fix typo which caused issue with pooling

* wallet: simplify solution_to_extra_data

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

* Remove DID Wallet test workflows

* Return launcher_id when creating Pool Wallet

* Name p2_singleton_puzzle_hash correctly

* Improve 'test_singleton_lifecycle_fast.py'.

* Make test more robust in the face of asynchronous adversity

* Add commandline cmds for joining and leaving pools

* Fix poolnft leave params

* Remove redundant assignment brought in from main

* Remove unneeded code

* Style and parsimony

* pool_puzzles: Check was wrong, and bad naming

* format: Fix linting

* format: Remove log and rename variable

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

* gui: Use pools branch

* format: fix lint

* Remove ununsed code, improve initial_pool_state_from_dict

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

* format: Speed up loading of the authentication key

* logging: less annoying logging

* Test pool NFT creation directly to pool

* Test switching pools without self-farming in between

* lint

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

* pooling: Use integer for protocol version

* pooling: Fix import

* Update GUI commit

* Ms.login2 (#6804)

* pooling: Login WIP

* pooling: add RPC for get_link

* dont use timeout

* pooling: rename to get_login_link

* format: remove logging

* Fix SES test

* Required cli argument

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

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

* Fix to farm summary

* Use target_puzzlehash param name in RPC call

* Pool test coverage (#6782)

* Improvement in test coverage and typing

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

* Added new drivers for the p2_singleton puzzles

* Added new tests and test coverage for singletons

* organize pools testing directory

* black formatting

* black formatting in venv

* lint fix

* Update CI tests

* Fixing tests post rebase

* lint fix

* Minor readability fix

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

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

* Allow creation of PlotNFTs in self-farming state

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

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

* print units in non-standard wallets correctly

* Fix farmer import

* Make syncing message in CLI more intuitive like the GUI

* Fix linting and show header hash instead of height

* gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c

* Revert "Merge"

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

* Revert "Revert "Merge""

This reverts commit 680331859f.

* Treat tx_record as Dict. Refactor tx submission

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

* Test utilities had moved

* Fix import of moved block_tools

* Potentially fix yaml

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

* Add -y flag, improve commandline plotnft handling

* Fix typo

* Add -y flag to plotnft create

* pool_wallet: Restore from DB properly

* wallet: ignore bad pool configs

* Reduce memory

* pool_wallet: Add claim command

* pool_wallet: Set transaction records to confirmed

* wallet: Fix bug in transaction cache

* Formatting and remove log

* pool_wallet: CLI balance and improvements to plotnft_funcs.py

* pool_wallet: Simplify, and fix issue with double submission

* pool_wallet: Fix tests

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

* update gui

* change to 3000 mem

* Correct sense of -y flag for self-pooling

* cli: Display payout instructions for pool

* pool_wallet: Don't create massive transactions

* cli: Improvements to plotnft

* pool_wallet: Get correct pool state

* pool_wallet: Use last transaction block to prevent condition failure

* Add block height for current state

* Add outstanding unconfirmed transactions to pw_status

* Refine command line plotnft show pending transactions

* Fix tests by using the correct output from pw_status

* Try to fix windows build

* Print expected leave height

* label pool urls

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

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

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

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

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

* tests: Clean up pool test logging

* tests: Fix lint

* Changed the pool innerpuzzes (#6802)

* overload solutions for pool_innerpuz parameters

* Fix tests for reduced size puzzles

* deleted messy deprecated test

* Fix lint.

* fix bug where spend types were the wrong way around

* merge with richard's lint fix

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

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

* fix if statement for cons box p1

* remove unnecessary solution arg

* quick innerpuz fix to make tests pass

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

* fix singleton lifecycle test

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

* lint fix

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

* no need to keep looping if `p` found

* lint fix

* Removed unecessary defun-inline and changed hyphens to underscores

* Changed created_coin_value_or_0 to an inline function

* Changed morph_condition to an inline function

* Added a comment for odd_cons_m113

* Rename output_odd and odd_output_found

* Add inline functions to document the lineage proof values

* Stager two rewrite

* Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed

* Extract truth functionality to singleton_truths.clib

* Fix tree hashes

* Changed truths to a struct rather than a list.

* fix test_singletons
update did_innerpuz

* recompile did_innerpuz

* fix a log error

* Renamed variable and factored out code per @richardkiss

* lint fix

* switch launcher extra_data to key_value pairs

* fix parsing of new format of extra_data in launcher solution

* fix broken test for new launcher solution format

* remove bare raise

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

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

Co-authored-by: Adam Kelly <aqk>

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

* Moved debug_spend_bundle and added it to the SpendBundle object

* Remove problematic typing

* Add testnet config

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

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

* wallet: Use block_record

* wallet: Add records in a full fork too

* wallet: remove unnecessary arguments in CC and DID

* add to cache, revert if transaction fails

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

* Improve comment

* pool_wallet: Fix driver bug

* wallet: Fix memory corruption

* gui: Update to latest

* Increase memory size

* tests: Add test for absorbing from pool

* small fix in solution_to_extra_data

* Fixed incorrect function name

* pooling: Fix EOS handling in full node

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

* Update farmer.py

add post header

* Update farmer_api.py

add post header

* Update chia/farmer/farmer.py

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

* Update chia/farmer/farmer_api.py

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

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

* Fix lint and cleanup farmer.py

* farmer: Fix linting issues (#7010)

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

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

* Fix lint in pool_puzzles

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

* pooling: Clear target state on `delete_unconfirmed_transactions`

* Lint

* Fix non-deterministic test

* Slight cleanup clvm driver code (#7028)

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

* lint

Co-authored-by: Adam Kelly <aqk>

* Revert "Add testnet config"

This reverts commit 9812442724.

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

* more tests

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

* put condition parser tests in its own test class

* capitalize module-scope variable

* abbreviate enum names in parse_condition_args

* use a more realistic cost per byte in test_rom

* merge parse_coin_id and parse_hash, since they are identical
2021-06-23 09:49:23 -07:00
Arvid Norberg
b1e7d45e9b
factor out common test boilerplate from mempool tests (#6815) 2021-06-18 05:22:27 -07:00
Arvid Norberg
f46bfd6197
don't use wall-clock time in mempool test for absolute time condition. The validation does not use wall-clock, but expected time based on the peak timestamp (#6801) 2021-06-16 14:39:57 -07:00
Almog De Paz
867fd09d70
fix flaky cc test (#6800)
* fix flaky cc test

* lint

* add assert

* lower test times

* dont use timeout

* lint
2021-06-16 11:15:06 -07:00
Arvid Norberg
42fde9a8d4
move chia.util.block_tools and chia.util.wallet_tools into tests (#6799)
* move chia.util.block_tools and chia.util.wallet_tools into tests

* only depend on block_tools when we actually run the wallet in test mode
2021-06-16 11:12:26 -07:00
Arvid Norberg
662286cc1a
extend and improve Mempool tests (#6781)
* make sure mempool condition tests fail for the right reason

* use int_to_bytes

* add more mempool condition tests

* simplify one mempool test
2021-06-16 11:10:46 -07:00
Almog De Paz
b99ae594b7
Validate summaries while syncing (#5284)
* block pre process check se matches wp

* test

* test

* test

* lint

* merge

* lint
2021-06-15 07:50:41 -07:00
Arvid Norberg
3fd8f681dd
factor out common parts of mempool condition tests (#6770) 2021-06-15 07:10:42 -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
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
Arvid Norberg
d3a71c3e19
make the serialization of Coin follow the normal protocol of implementing stream() (#4074) 2021-05-12 10:40:26 -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
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
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
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
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
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
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
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
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
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
arvidn
6b4d060758 pass through max cost all the way down to where we execute the CLVM code 2021-04-17 10:34:13 -07:00
Mariano Sorgente
a6874bd2fe
Block compression and decompression (#1959)
* squash

* rebase cleanup

* cost

* Combine adam's and straya's PRs

* Fix cost test

* Fix another test

* Improve safety in reorgs

* Improve wallet in reorgs

* Improve wallet in reorgs

* Bug in reorg handling

* Bug in reorg handling, and fix test

* Band aid

* Comment out to pass test

* Comment out test

* rebase clean

* USe a list of reference generators

* create

* Integrate Block Compression

* Fix generator argument creation

* improve test

* update block tools

* Separate CompressorArg and GeneratorArg, improve type hints

* First crack at `list_to_tree`.

* Integrate generator arguments as tree

* End to end test for generators

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

* tidy GeneratorArg test

* Get compression and decompression working in full node

* Fix fetching block generator from DB in multiprocess

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

* reduce max number of generators refs allowed in a block

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

* typos

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

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

* Fix merge conflict

* Fix test

* Fix full node tests

* Don't make full blocks

* fix lint

Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: Adam Kelly <aqk@aqk.im>
Co-authored-by: Richard Kiss <him@richardkiss.com>
2021-04-16 23:13:22 -07:00
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