diff --git a/chia/types/condition_opcodes.py b/chia/types/condition_opcodes.py index 3ac77e610f9f..d689a561fc93 100644 --- a/chia/types/condition_opcodes.py +++ b/chia/types/condition_opcodes.py @@ -55,6 +55,10 @@ class ConditionOpcode(bytes, enum.Enum): ASSERT_BEFORE_HEIGHT_RELATIVE = bytes([86]) ASSERT_BEFORE_HEIGHT_ABSOLUTE = bytes([87]) + # to be activated with the 2.0 hard fork. + # the first parameter is always the cost of the condition + SOFTFORK = bytes([90]) + # A condition that is always true and always ignore all arguments REMARK = bytes([1]) diff --git a/chia/util/errors.py b/chia/util/errors.py index e9bf2c5c8488..c93e06cfa2f9 100644 --- a/chia/util/errors.py +++ b/chia/util/errors.py @@ -175,6 +175,15 @@ class Err(Enum): ASSERT_EPHEMERAL_FAILED = 140 EPHEMERAL_RELATIVE_CONDITION = 141 + # raised if a SOFTFORK condition invokes an unknown extension in mempool + # mode + INVALID_SOFTFORK_CONDITION = 142 + # raised if the first argument to the SOFTFORK condition is not a valid + # cost. e.g. negative or > UINT64 MAX + INVALID_SOFTFORK_COST = 143 + # raised if a spend issues too many assert spend, assert puzzle, + # assert announcement or create announcement + TOO_MANY_ANNOUNCEMENTS = 144 class ValidationError(Exception): diff --git a/chia/wallet/puzzles/condition_codes.clib b/chia/wallet/puzzles/condition_codes.clib index ba4ff615b133..386036fb62a6 100644 --- a/chia/wallet/puzzles/condition_codes.clib +++ b/chia/wallet/puzzles/condition_codes.clib @@ -56,4 +56,8 @@ ; A condition that is always true and always ignore all arguments (defconstant REMARK 1) + + ; A condition whose first argument specifies its cost, but is unkown otherwise + ; It's a place-holder for soft-forking in new conditions + (defconstant SOFTFORK 90) )