-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[CHIA-3649][CHIA-3657][CHIA-3732][CHIA-3666] proof-of-space v2 support #20296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1e6d6bc to
686e568
Compare
5513836 to
3410782
Compare
2dd5d58 to
e7ac280
Compare
38fbba8 to
efbdb8b
Compare
efbdb8b to
f6efe94
Compare
…changed. There is no quality proof scan filter
4b8663b to
48f48e5
Compare
48f48e5 to
f400a04
Compare
…the hard fork, with only the farm reward coin
… need more time to run all the tests, on CI.
f400a04 to
ce9248c
Compare
|
| PLAIN = 0 | ||
| HARD_FORK_2_0 = 1 | ||
| HARD_FORK_3_0 = 2 | ||
| HARD_FORK_3_0_AFTER_PHASE_OUT = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on what 2_0 and 3_0 refers to.
comment what AFTER_PHASE_OUT means
| # we don't have very much v2 space. We need a lower difficulty | ||
| # level to start with | ||
| DIFFICULTY_STARTING=uint64(7), | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this cover both activation and ending the phase out.
HARD_FORK2_HEIGHT=uint32(5),
PLOT_V1_PHASE_OUT_EPOCH_BITS=uint8(2),
| # once the hard fork activated, we no longer use this form of block | ||
| # compression anymore | ||
| assert len(block.transactions_generator_ref_list) == 0 | ||
| if consensus_mode < ConsensusMode.HARD_FORK_3_0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment to explain that this test won't work after the hard fork, because block refs
| for bl in blocks[-2:]: | ||
| for coin in bl.get_included_reward_coins(): | ||
| if coin.puzzle_hash == coinbase_puzzlehash: | ||
| spend_coin = coin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to break here
| 2, blocks, farmer_reward_puzzle_hash=coinbase_puzzlehash, guarantee_transaction_block=True | ||
| ) | ||
|
|
||
| spend_block = blocks[10] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this turns out to be a transaction block, but not after the hard fork.
|
|
||
| if proof_spent_time > 15000: | ||
| action = "Finding" if isinstance(pr, V1Prover) else "Solving" | ||
| log.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment that chiadog (or other log parser) may take not of this
Purpose:
This PR adds support for v2 plots to chia-blockchain, activating at the hard fork height (which is still set to a place-holder).
These changes are best reviewed one commit at a time.
A good starting point is for getting a sense of these changes is
chia/plotting/prover.py, which defines the interface to the "Prover". This reads plot files and finds proofs of space, used by the farmer.The main updates can be summarized as:
chiapos.BlockTools(the core of the simulator)ConsensusModeenum values to the test fixture. This will make many of our tests run two more times covering the v1 phase-out and v2-only chains.todo_v2_plotskeyword, to make them easy to find and identify.todo_v2_plotscomment.Current Behavior:
New Behavior:
Testing
Test chains
Since the test fixtures now have two more parameters, all of our test chains are generated in two more versions.
The test chains are generated by test fixtures, so automatically by running a test that references one of these fixtures. The test plots are cached in
~/.chia/blocksto be re-used across test runs. The longer chains can take quite a while to generate.Test plots
We also have new v2 test plots. v2 test plots are k-18 and about 700kB each. In order to have a somewhat even netspace compared to the existing v1 test plots, we have 150 v2 plots (vs. 20 v1 plots). These test plots are generated by running the tests that set up the
BlockToolssimulation. They are cached in~/.chia/test-plotsto be re-used across test runs.To run tests locally, you need the new test plots and chains. You can either generate them or download them from the
test-cacherepository.Generating them takes at least 1 hour on a fast machine. It can be quite CPU and memory intensive, so you may limit the number of parallel jobs to a few fewer than cores on the machine (using
-n).You can download them from the
test-cacherepository. Here: Chia-Network/test-cache#23Backwards compatibility
Some of our tests depend on exactly the test plots we use, and the number of them. So when you update your
~/.chia/plotsto include the new plots, you may need to clear and reset that directory if you want to move back tomain(until this PR lands).BlockToolswill check that the number of test plots it picked up is exactly the number we expect. This adds some friction to switching back and forth between this PR andmain, for testing.Note
Introduce PoS v2 plots end‑to‑end (prover/plotting→harvester/farmer/solver), add new consensus modes including HF3 and post phase‑out, and update simulator/tests, constants, CI, and deps accordingly.
V2ProverAPI (get_qualities_for_challenge()without filter),V2Qualitycarries partial proof, and updatedPartialProoffields.create_v2_plots()and generate v2 plots inBlockTools; include v2 in simulator startup.PLAIN,HARD_FORK_2_0,HARD_FORK_3_0,HARD_FORK_3_0_AFTER_PHASE_OUT) with per‑mode constants and difficulty tweaks; adjust filter bits and removeQUALITY_PROOF_SCAN_FILTERusage.PartialProofsData; Farmer requests solves; Solver produces full proofs; logs/messages usefragments.limit_consensus_modesmarks, adjust expectations (rewards, generator refs, pool keys), tweak parameters/timeouts, and regenerate per‑mode test chains/filenames.BLOCKS_AND_PLOTS_VERSIONto0.45.1; upgradechia_rsto0.36.0; increase various test job timeouts.Written by Cursor Bugbot for commit f06ebdf. This will update automatically on new commits. Configure here.