chik_consensus/flags.rs
1use klvmr::MEMPOOL_MODE as KLVM_MEMPOOL_MODE;
2
3// flags controlling the condition parsing
4// These flags are combined in the same fields as klvm_rs flags, controlling the
5// KLVM execution. To avoid clashes, KLVM flags are in the lower two bytes and
6// condition parsing and validation flags are in the top two bytes.
7
8/// unknown condition codes are disallowed. This is meant for mempool-mode
9pub const NO_UNKNOWN_CONDS: u32 = 0x2_0000;
10
11/// Conditions will require the exact number of arguments
12/// currently supported for those conditions. This is meant for mempool-mode
13pub const STRICT_ARGS_COUNT: u32 = 0x8_0000;
14
15/// By default, run_block_generator() and run_block_generator2() validates the
16/// signatures of any AGG_SIG / condition. By passing in this flag, the
17/// signatures are not validated (saving / time). This is useful when we've
18/// already validated a block but we need to / re-run it to compute additions and
19/// removals.
20pub const DONT_VALIDATE_SIGNATURE: u32 = 0x1_0000;
21
22/// This flag controls whether or not we add a flat cost to conditions when
23/// processing them in in chik_rs. It is set to activate after hard fork 2.
24pub const COST_CONDITIONS: u32 = 0x80_0000;
25
26/// A combination of flags suitable for mempool-mode, with stricter checking
27pub const MEMPOOL_MODE: u32 = KLVM_MEMPOOL_MODE | NO_UNKNOWN_CONDS | STRICT_ARGS_COUNT;