Commit Graph

31 Commits

Author SHA1 Message Date
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
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
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
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
Richard Kiss 569ca16f50 Use `sed` to change imports from `src` to `chia`. 2021-04-04 21:41:39 -07:00
Adam Kelly 68c1493e54
Change coin ids (#1225)
* change to coin ID calculation

* Generator_for_single_coin uses coin info to generate coin IDs live

* update sha256tree of generator for single coin

* Update changelog for more stringent coin ID calculation

Co-authored-by: matt <matt@chia.net>
Co-authored-by: Adam Kelly <aqk@aqk.im>
2021-03-11 18:58:16 -08:00
Mariano 530056039b Fix test 2021-03-11 17:43:00 +09:00
Gene Hoffman b5ce8c9e66
Isort take 3 (#1213)
* isort in a black friendly way

* isort but debug superlinter later
2021-03-09 18:27:27 -08:00
Richard Kiss 56aadf687d Redo some tests using block generator and puzzle utils. 2021-02-26 11:41:58 -08:00
Gene Hoffman abd5f8f466 Update test-cache to 0.13.0 2021-02-24 15:38:06 -08:00
Richard Kiss ce2d901768 Fix big block test. 2021-02-23 11:20:55 -08:00
Adam Kelly 18fe80a7b4 lint 2021-02-18 21:23:55 +09:00
Adam Kelly 707a38d4ba lint 2021-02-18 21:23:55 +09:00
Adam Kelly e2c1ff07f3 Convert tests 2021-02-18 21:23:55 +09:00
Arvid Norberg b6ab86201e fix test_clvm_strict_mode 2021-02-17 23:37:58 +09:00
Mariano Sorgente 5cc3407b65
Support for plots with pool address (#920)
* Updated gui with sub block changes

* Move some files, validate fees in mempool

* Support for plots with pool address

* Fix test and new blocks

* chia-blockchain-gui good commit

* changelof

* Fix edge cases with unfinished blocks

* Update gui

* Add test fixtures
2021-02-16 01:15:24 -08:00
Mariano Sorgente a3684dc8eb
Remove sub blocks and chia wallet cli fixes (#913)
* Remove sub block start

* Intermediate commit, many replacements

* Fix wallet table name

* Fix tests

* chia wallet cli fixes
2021-02-12 12:24:33 -08:00
Mariano Sorgente 2c9f93fdaa
Ms.block rewards (#890)
- Real block reward schedule:
Prefarm 21,000,000
0-3 years 2 chia per block
3-6 years 1 chia per block
6-9 years 0.5 chia per block
9-12 years 0.25 chia per block
after that 0.125 chia per block
- Fixed proof of space estimation formula (type). network space was overestimated by 2x
- Consolidated all genesis hashes into one GENESIS_CHALLENGE value
- Tables sub_block_record renamed into block_record, in anticipation of renaming of sub blocks to blocks
- Coin amounts stored as bytes since sqlite 3 does not fit 64 bit unsigned integers as ints
- Fix a bug with chia show and chia netspace
- Adds validation of end of sub slots
- RPC renames:
get_sub_block -> get_block
-parameter sub_block -> block
get_sub_block_record_by_height -> get_block_record_by_height
-parameter sub_block_record -> block_record
get_sub_block_record -> get_block_record
-parameter sub_block_record to block_record
get_sub_block_records -> get_block_records
-parameter sub_block_records -> block_records
get_unfinished_sub_block_headers -> get_unfinished_block_headers

Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
Co-authored-by: almog <almogdepaz@gmail.com>
2021-02-11 11:42:49 +09:00
Arvid Norberg d9bb9bf12c honor safe-mode setting in CLVM when validating mempool conditions 2021-02-09 16:02:43 -08:00
Yostra d81dd150e4 cc and program 2021-02-09 13:07:24 -05:00
arvidn eb1da3f8cc make the mempool cost calculation use serialized programs (and arguments) correctly. Add asserts to test that otherwise would fail 2021-02-07 08:21:52 -08:00
Mariano Sorgente 46de03f4d0 Increase timeout slightly 2021-02-07 20:13:01 +09:00
Arvid Norberg be7e2356d6 introduce SerializedProgram to use in the FullNode. Instead of parsing block programs in python, maintain them in serialized form to save time when executing them in rust 2021-02-04 18:26:26 -08:00
Mariano Sorgente 63924f8188 Improve mempool performance 2021-02-04 01:27:59 -08:00
Yostra fe3437d0a4 out 2021-01-19 21:40:13 -08:00
Yostra 3cdae1b8df test standard tx * 1000 2021-01-19 21:40:13 -08:00
Mariano Sorgente eed61d0dbf Prevalidate transactions 2021-01-19 10:53:04 -08:00
Mariano Sorgente 42871be6b4 Cache npc list and cost results 2021-01-19 10:53:04 -08:00
Yostra d146278a51 test with generator that stalled the chain 2021-01-17 02:11:18 -08:00
Yostra 0572cccb43 split tests 2021-01-12 17:02:22 -05:00