Commit Graph
36 Commits
Author SHA1 Message Date
Arvid NorbergandGitHub b5d51c38f8 run tests in parallel in CI (#10499) 2022-03-22 15:04:07 -07:00
Richard KissandGene Hoffman 569ca16f50 Use sed to change imports from src to chia. 2021-04-04 21:41:39 -07:00
Mariano SorgenteandGitHub 4d15f86715 Ms.rate limits (#1204)
Implements rate limiting for full node.
2021-03-10 15:48:34 +09:00
Gene HoffmanandGitHub b5ce8c9e66 Isort take 3 (#1213)
* isort in a black friendly way

* isort but debug superlinter later
2021-03-09 18:27:27 -08:00
YostraandGene Hoffman 714597b04f fix tests 2021-03-03 19:13:27 -08:00
5a265994b6 WP Blue box integration (#1131)
* Initial commit weight proof bluebox.

* More verification, fix linting.

* Checkpoint testing.

* Checkpoint verify compact proofs.

* First attempt already seen compact proofs.

* Try bigger timeouts.

* Try passing first without ICC EOS.

* Try to uniformly sanitize by field_vdf.

* Try to fix vdf.py

* Temporary change: check if simulation is slow or stalled.

* Try fixing VDFProof erros in tests.

* Checkpoint: address some comments.

* temporarily lower number of sub epoch samples

* Checkpoint is_fully_compactified.

* First attempt compact blocks fixture.

* Add tests.

* Test simulation should eventually pass.

* Test full node store passing.

* Use the proper fixture.

* handle compact challenge blocks

* logs

* bluebox basic tests passing

* Try lighter test_simulation.

* refactor

* Bump chiavdf, use correct fixture db, try test cache.

* Update fixtures.py

* dont add redundant vdfs if blue boxed

* partial blue boxed chain test

* validate sampling

* logs

* Try bigger timeouts.

* logs

* First attempt split tests.

* Rename workflow files.

* Relax test simulation since it's still failing.

* Update test cache.

* merge fix

* change test dataset

* conflicts

Co-authored-by: fchirica <fchirica96@gmail.com>
2021-03-03 14:39:23 -08:00
Florin ChiricaandGitHub bac6e36c05 Bluebox weight proof. (#1028)
* Initial commit weight proof bluebox.

* More verification, fix linting.

* Checkpoint testing.

* Checkpoint verify compact proofs.

* First attempt already seen compact proofs.

* Try bigger timeouts.

* Try passing first without ICC EOS.

* Try to uniformly sanitize by field_vdf.

* Try to fix vdf.py

* Temporary change: check if simulation is slow or stalled.

* Try fixing VDFProof erros in tests.

* Checkpoint: address some comments.

* Checkpoint is_fully_compactified.

* First attempt compact blocks fixture.

* Add tests.

* Test simulation should eventually pass.

* Test full node store passing.

* Use the proper fixture.

* Try lighter test_simulation.

* Bump chiavdf, use correct fixture db, try test cache.

* Update fixtures.py

* Try bigger timeouts.

* First attempt split tests.

* Rename workflow files.

* Relax test simulation since it's still failing.

* Update test cache.
2021-03-03 13:13:08 -08:00
Adam KellyandGene Hoffman 948d03ed34 Do not include code from tests in production (src/consensus/block_creation.py) 2021-02-25 12:06:26 -08:00
almogandGene Hoffman c442225b77 add empty genesis slots test and test dataset 2021-02-25 09:04:32 -08:00
almogandGene Hoffman 16d4f166a5 fix overflow challenge block in start of sub epoch 2021-02-24 15:56:23 -08:00
Almog De PazandGitHub 1bb7572d52 weight proof (#926)
wp validations
wp multi processing
2021-02-24 00:39:48 +02:00
Mariano SorgenteandMariano Sorgente 65a8c153e6 Prevalidate results from validate_unfinished, and fix prevalidation batch 2021-02-21 21:13:47 +09:00
Mariano SorgenteandGitHub 71ccc8f47b Ms.slot catch up (#947)
* Slot catch-up, windows migrate, higher sub_slot_iters in the beginning

* Fix typo in filename

* reverse directory names

* comment flaky test

* Dont migrate addresses for now
2021-02-18 11:09:56 -08:00
Mariano SorgenteandGitHub e05e5f9d8c Ms.config changes2 (#941)
* This allows configuring a new testnet  only by changing the config file, no code changes required. 
* We can theoretically join either testnet1 (beta27) or testnet2 (rc) with this codebase
* There is a new constant: DIFFICULTY_CONSTANT_FACTOR, this number is a constant multiplied by the difficulty. It is set to 2**65 now, to make difficulty smaller (we can start the mainnet with a difficulty of 5 for example). 
* If you want to run a new testnet, you can change DIFFICULTY_CONSTANT_FACTOR in the config, and create a new entry for it
* Also, the databases now contain the GENESIS_CHALLENGE in them, so that if you run on two testnets, the DBs will be different
* Don't double load duplicate plots
 
 
 
Sample config:
 ```
 network_overrides: &network_overrides
  testnet4:
    DIFFICULTY_CONSTANT_FACTOR: 33554432
    DIFFICULTY_STARTING: 16777216
    GENESIS_CHALLENGE: "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b"  # std_hash(b"1")
    GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "23b039a829f3ed14a260355b9fc55d9ccc4539f05bd4bf529fd2630de1751d52"
    GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "23b039a829f3ed14a260355b9fc55d9ccc4539f05bd4bf529fd2630de1751d52"
  mainnet:
    GENESIS_CHALLENGE: "d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35" # std_hash(b"2")

selected_network: &selected_network "testne4"
 ```
2021-02-19 02:00:25 +09:00
Mariano SorgenteandGene Hoffman 6f5fbfc071 Fix validation of overflow subblocks 2021-02-17 09:38:21 -08:00
Mariano SorgenteandGitHub 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
RostislavandGene Hoffman 0877ed7be0 Catch errors when attempting to verify a VDF proof with a bad form
Remove .get_bad_element() method from ClassgroupElement, do it in
test_blockchain as it's only needed there.
2021-02-15 20:16:34 -08:00
Mariano SorgenteandGitHub 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
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
RostislavandGene Hoffman 65dcae570e Change to compressed quadratic forms for VDFs
Using compressed representation of quadratic forms reduces their
serialized size from 130 to 100 bytes (for forms with 1024-bit
discriminant). This shrinks the size of VDF outputs and VDF proofs, and
it's a breaking change as compressed representation is not compatible
with older uncompressed (a, b) representation.

Compressed forms are also used in calls to chiavdf and in timelord's
communication with VDF client.

Update to version 0.14.0 of chiavdf and version 0.2.0 of test-cache.
Older versions of these do not support compressed forms.
2021-02-10 17:11:49 -08:00
dabdce5df0 Ms.remove height (#880)
* First pass at removing height

* Fix test

* Remove useless files

* Rename sub_block_height to block_height everywhere

* A few more replaces. Don't migrate old addresses. Don't replace addresses

* lru cache for blocks

* cc fixes rebased

* race

* close check full node task

* lint

* more race

Co-authored-by: Yostra <straya@chia.net>
2021-02-09 20:49:47 -08:00
YostraandGene Hoffman 3d27a7d660 Use TLS Certificate hash as node id ssl id (#740)
* create CA

* create CA chain, pin public, private, auth

* build scripts

* refactor rpc

* test logging
2021-02-04 01:27:59 -08:00
Almog De PazandGene Hoffman 2d99aa4224 fix double sub_epoch_summary append (#818)
* fix double sub_epoch_summary append
2021-02-04 01:27:59 -08:00
Mariano SorgenteandGene Hoffman efc6156fdf Rename some methods 2021-02-04 01:27:59 -08:00
Almog De PazandGitHub 96d682179a Persist sub epoch segments (#745)
* add fields to sub_records
dont keep all sub_blocks in mem
dont load all known sub_blocks on strat

* add fields to sub_records
dont keep all sub_blocks in mem
dont load all known sub_blocks on strat

* add sub_epoch_summary column to db

* fix bug on warmup

* weight proof, fetch old blocks from db

* naming

* correct warmup

* merge fixes

* wallet changes

* merge fixes, wallet tests passing

* clean redundant var

* weight proof cache fix

* wallet api merge fix

* fix tests failing do to merge

* merge dev

* fix full node store merge

* merge dev

* wallet merge fix

* extend test timeout

* remove redundant code after merge

* add peak height to log

* remove field from sub_block

* fix and add extend proof test,rebase

* fix lint issues

* remove redundant test

* pr fixes

* persist sub epoch segments

* handle blockcache

* create segments

* refactor

* fix warmup bug, clean after each sync batch

* switch to assert

* refactor

* create segments as we go

* increase max samples

* fix stores,refactor

* fix merge

* remove duplicate code

* change logs to debug

* remove logs

* Revert "remove duplicate code"

This reverts commit aef0f20a

* remove code from interface

* fix wallet sql
2021-01-26 12:08:10 -08:00
Almog De PazandGitHub 4aa8028472 Refactor sub blocks (#663)
dont keep all sub blocks in mem, dont load all known sub blocks on start
2021-01-25 20:31:24 +02:00
Almog De PazandGitHub d360dd084a fix extend (#736)
* fix extend

* lint
2021-01-22 11:38:22 -06:00
Mariano SorgenteandGene Hoffman 76426b3e32 Speed up tests 2021-01-19 22:25:45 -08:00
Mariano SorgenteandGene Hoffman 927e0d6913 Fix prevalidation and optimize some tests 2021-01-19 10:53:04 -08:00
Mariano SorgenteandGene Hoffman eed61d0dbf Prevalidate transactions 2021-01-19 10:53:04 -08:00
YostraandGene Hoffman 4a9254a213 cleanup 2021-01-18 14:01:25 -08:00
Mariano SorgenteandGene Hoffman bb4c6c2f69 Fix test 2021-01-16 20:32:42 -08:00
Mariano SorgenteandYostra fcc4d119b8 Fix double spend issue in reorgs 2021-01-13 14:57:51 -05:00
YostraandYostra 7cf0ed0ac6 black 2021-01-12 17:02:22 -05:00
YostraandYostra e4cc0caf5c mypy weight proof 2021-01-12 17:02:22 -05:00
YostraandYostra 0572cccb43 split tests 2021-01-12 17:02:22 -05:00