Skip to main content

MAX_SCRIPT_OPCODES

Constant MAX_SCRIPT_OPCODES 

Source
pub const MAX_SCRIPT_OPCODES: usize = 128;
Expand description

The maximum number of opcodes in a script, the bound of ScriptOpcodes.

Like MAX_SCRIPT_BYTES this is applied by every decoder, since they all go through TariScript::from_bytes or TariScript::new. The smallest opcode encodes to a single byte, so a script of max_script_byte_size bytes could hold more opcodes than this; the opcode cap is therefore the binding limit on short-opcode scripts and is itself a consensus rule. Changing it is a flag-day (hard) fork.