Created by: joshua-warburton
Previously, the enum value for each instruction was assigned at compile time in order after sorting alphabetically. This meant that every time a new instruction was added it would shuffle the existing enum values, leading to incompatibility between compiles.
This patch adds an enum field in codec.txt which allows us to preserve enum values regardless of instructions being added or removed. The existing codecsort.py manages the values of these enums and ensures that each of the instructions has a unique enum.
Gaps in the enum sequence are allowed when an instruction is moved or deleted. These gaps will resolve to OP_INVALID. Removing or moving opcodes to different enum values should only be done with the approval of active maintainers and with a good reason as it can break backward compatibility.