Skip to content

Commit

Permalink
add new constants for soft-fork3, hard-fork and the other plot-filter…
Browse files Browse the repository at this point in the history
… adjustments
  • Loading branch information
arvidn committed May 16, 2023
1 parent 8286c9d commit 208e952
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions chia/consensus/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ class ConsensusConstants:
# soft fork initiated in 1.8.0 release
SOFT_FORK2_HEIGHT: uint32

# soft fork initiated in 2.0 release
SOFT_FORK3_HEIGHT: uint32

# the hard fork planned with the 2.0 release
# this is the block with the first plot filter adjustment
HARD_FORK_HEIGHT: uint32

# the plot filter adjustment heights
PLOT_FILTER_128_HEIGHT: uint32
PLOT_FILTER_64_HEIGHT: uint32
PLOT_FILTER_32_HEIGHT: uint32

def replace(self, **changes: object) -> "ConsensusConstants":
return dataclasses.replace(self, **changes)

Expand Down
9 changes: 9 additions & 0 deletions chia/consensus/default_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
"MAX_GENERATOR_REF_LIST_SIZE": 512, # Number of references allowed in the block generator ref list
"POOL_SUB_SLOT_ITERS": 37600000000, # iters limit * NUM_SPS
"SOFT_FORK2_HEIGHT": 3886635,
"SOFT_FORK3_HEIGHT": 4200000,
# June 2024
"HARD_FORK_HEIGHT": 5496000,
# June 2027
"PLOT_FILTER_128_HEIGHT": 10542000,
# June 2030
"PLOT_FILTER_64_HEIGHT": 15592000,
# June 2033
"PLOT_FILTER_32_HEIGHT": 20643000,
}


Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def db_version(request) -> int:
return request.param


@pytest.fixture(scope="function", params=[1000000, 3886635])
@pytest.fixture(scope="function", params=[1000000, 3886635, 4200000, 5600000])
def softfork_height(request) -> int:
return request.param

Expand Down

0 comments on commit 208e952

Please sign in to comment.