Skip to content

Reduce gas usage of SafetyChecker #209

@geohot

Description

@geohot
  • 30% -- Remove the ops array, replace with (ops <<= 8; ops |= op)
  • 10% -- Replace opBit = 2 ** op; with opBit = 1 << op;
  • ?? -- Replace if (op == 0x00 || op == 0xfd || op == 0xfe || op == 0xf3) with a mask
  • ?? -- Potentially gate the whole entry into the if logics on a mask, this is a big win!
  • ?? -- Cache reads from _bytecode, 1 MLOAD per 32 bytes. Complex and annoying
  • ?? -- Replace complex call logic with a simple AND thanks to new compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions