Extension Points
Adding a New Opcode
- Add the opcode entry to
src/runtime/spec/opcodes.rswith hex code, name, and gas cost - Implement the execution logic in
src/runtime/execution/ - Add IR support in
src/ir/ir_types.rsif the opcode needs direct IR representation - Update the code generator in
src/cli/bytecode/to emit the new opcode
Adding a New Syscall
- Add the syscall name to the registry in
src/runtime/spec/syscalls.rs - Add the gas cost entry in
src/runtime/spec/gas.rs - Implement the syscall handler in
src/runtime/execution/ - Update
src/codegen.rsif the syscall needs a new interop ID computation
Adding a New Native Contract
- Add the contract hash to
src/runtime/spec/native_contracts.rs - Implement method handlers in the runtime execution engine
- Update the devpack with Solidity interface files in
devpack/contracts/
Adding a New Optimization Pass
- Create a new file in
src/optimizer/implementing the pass - Add the pass to
OptimizationPassesinsrc/optimizer/types.rs - Wire it into the dispatch logic in
src/optimizer/dispatch.rs - Assign it to the appropriate optimization level in
OptimizationPasses::for_level()
