Chia-Network / chia_rs

Rust crate & wheel with consensus code
Apache License 2.0
20 stars 25 forks source link

Simplify hard fork logic #597

Closed arvidn closed 3 months ago

arvidn commented 3 months ago

This PR is best reviewed one commit at a time, as the flags are fairly independent.

Now that the hard fork has activated, some feature flags are no longer necessary (as they are always enabled).

ENABLE_SOFTFORK_CONDITION, AGG_SIG_ARGS and COND_ARGS_NIL - these features are always-on now.

The change around AGG_SIG_ARGS and COND_ARGS_NIL is probably the least obvious. Before the hard fork, AGG_SIG_ME and AGG_SIG_UNSAFE required exactly two arguments (as opposed to all other conditions, that allow unknown arguments). When AGG_SIG_ARGS is set (as it is after the hard fork activation), the AGG_SIG_ME and AGG_SIG_UNSAFE conditions behave like the others. This is why the special cases can be removed in conditions.rs, here.

coveralls-official[bot] commented 3 months ago

Pull Request Test Coverage Report for Build 9836286700

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
crates/chia-consensus/src/gen/conditions.rs 2 99.45%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 9785517758: 1.9%
Covered Lines: 11554
Relevant Lines: 13973

💛 - Coveralls