Skip to content

Commit

Permalink
Remove 3 unused parameters from ConsensusConstants (#691)
Browse files Browse the repository at this point in the history
* initial commit
* update type stubs
* remove unused constants from python default_constants
  • Loading branch information
matt-o-how authored Aug 29, 2024
1 parent 86e60a6 commit 0c97565
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 27 deletions.
11 changes: 0 additions & 11 deletions crates/chia-consensus/src/consensus_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,13 @@ pub struct ConsensusConstants {

pool_sub_slot_iters: u64,

/// Soft fork initiated in 1.8.0 release.
soft_fork2_height: u32,

/// Soft fork initiated in 2.3.0 release.
soft_fork4_height: u32,

/// Soft fork initiated in 2.4.0 release.
soft_fork5_height: u32,

/// The hard fork planned with the 2.0 release.
/// This is the block with the first plot filter adjustment.
hard_fork_height: u32,

hard_fork_fix_height: u32,

/// The 128 plot filter adjustment height.
plot_filter_128_height: u32,

Expand Down Expand Up @@ -206,11 +198,8 @@ pub const TEST_CONSTANTS: ConsensusConstants = ConsensusConstants {
max_generator_size: 1_000_000,
max_generator_ref_list_size: 512,
pool_sub_slot_iters: 37_600_000_000,
soft_fork2_height: 0,
soft_fork4_height: 5_716_000,
soft_fork5_height: 5_940_000,
hard_fork_height: 5_496_000,
hard_fork_fix_height: 5_496_000,
plot_filter_128_height: 10_542_000,
plot_filter_64_height: 15_592_000,
plot_filter_32_height: 20_643_000,
Expand Down
2 changes: 1 addition & 1 deletion crates/chia-consensus/src/spendbundle_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ mod tests {
#[rstest]
#[case(0, ENABLE_FIXED_DIV)]
#[case(TEST_CONSTANTS.hard_fork_height, ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS)]
#[case(TEST_CONSTANTS.soft_fork4_height, ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS)]
#[case(5_716_000, ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS)]
#[case(TEST_CONSTANTS.soft_fork5_height, ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS | DISALLOW_INFINITY_G1)]
fn test_get_flags(#[case] height: u32, #[case] expected_value: u32) {
assert_eq!(
Expand Down
3 changes: 0 additions & 3 deletions tests/run_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@
MAX_GENERATOR_SIZE=uint32(1000000),
MAX_GENERATOR_REF_LIST_SIZE=uint32(512),
POOL_SUB_SLOT_ITERS=uint64(37600000000),
SOFT_FORK2_HEIGHT=uint32(0),
SOFT_FORK4_HEIGHT=uint32(5716000),
SOFT_FORK5_HEIGHT=uint32(0),
HARD_FORK_HEIGHT=uint32(5496000),
HARD_FORK_FIX_HEIGHT=uint32(5496000),
PLOT_FILTER_128_HEIGHT=uint32(10542000),
PLOT_FILTER_64_HEIGHT=uint32(15592000),
PLOT_FILTER_32_HEIGHT=uint32(20643000),
Expand Down
3 changes: 0 additions & 3 deletions tests/test_blscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@
MAX_GENERATOR_SIZE=uint32(1000000),
MAX_GENERATOR_REF_LIST_SIZE=uint32(512),
POOL_SUB_SLOT_ITERS=uint64(37600000000),
SOFT_FORK2_HEIGHT=uint32(0),
SOFT_FORK4_HEIGHT=uint32(5716000),
SOFT_FORK5_HEIGHT=uint32(0),
HARD_FORK_HEIGHT=uint32(5496000),
HARD_FORK_FIX_HEIGHT=uint32(5496000),
PLOT_FILTER_128_HEIGHT=uint32(10542000),
PLOT_FILTER_64_HEIGHT=uint32(15592000),
PLOT_FILTER_32_HEIGHT=uint32(20643000),
Expand Down
9 changes: 0 additions & 9 deletions wheel/python/chia_rs/chia_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4176,11 +4176,8 @@ class ConsensusConstants:
MAX_GENERATOR_SIZE: uint32
MAX_GENERATOR_REF_LIST_SIZE: uint32
POOL_SUB_SLOT_ITERS: uint64
SOFT_FORK2_HEIGHT: uint32
SOFT_FORK4_HEIGHT: uint32
SOFT_FORK5_HEIGHT: uint32
HARD_FORK_HEIGHT: uint32
HARD_FORK_FIX_HEIGHT: uint32
PLOT_FILTER_128_HEIGHT: uint32
PLOT_FILTER_64_HEIGHT: uint32
PLOT_FILTER_32_HEIGHT: uint32
Expand Down Expand Up @@ -4227,11 +4224,8 @@ class ConsensusConstants:
MAX_GENERATOR_SIZE: uint32,
MAX_GENERATOR_REF_LIST_SIZE: uint32,
POOL_SUB_SLOT_ITERS: uint64,
SOFT_FORK2_HEIGHT: uint32,
SOFT_FORK4_HEIGHT: uint32,
SOFT_FORK5_HEIGHT: uint32,
HARD_FORK_HEIGHT: uint32,
HARD_FORK_FIX_HEIGHT: uint32,
PLOT_FILTER_128_HEIGHT: uint32,
PLOT_FILTER_64_HEIGHT: uint32,
PLOT_FILTER_32_HEIGHT: uint32
Expand Down Expand Up @@ -4295,11 +4289,8 @@ class ConsensusConstants:
MAX_GENERATOR_SIZE: Union[ uint32, _Unspec] = _Unspec(),
MAX_GENERATOR_REF_LIST_SIZE: Union[ uint32, _Unspec] = _Unspec(),
POOL_SUB_SLOT_ITERS: Union[ uint64, _Unspec] = _Unspec(),
SOFT_FORK2_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
SOFT_FORK4_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
SOFT_FORK5_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
HARD_FORK_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
HARD_FORK_FIX_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
PLOT_FILTER_128_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
PLOT_FILTER_64_HEIGHT: Union[ uint32, _Unspec] = _Unspec(),
PLOT_FILTER_32_HEIGHT: Union[ uint32, _Unspec] = _Unspec()) -> ConsensusConstants: ...

0 comments on commit 0c97565

Please sign in to comment.