Skip to main content

Try it Live

Run Hardfork examples in the interactive playground

    Range Direction

    Forward Range (start < end)

    Returns hardforks in chronological order:

    Reverse Range (start > end)

    Returns hardforks in reverse chronological order:

    Single Hardfork (start === end)

    Returns array with single element:

    Usage Patterns

    Upgrade Path

    Get hardforks to upgrade through:

    Feature Changes

    List features introduced in range:

    Migration Planning

    Plan network upgrade:

    Version Range Validation

    Check if fork is in supported range:

    Breaking Changes Detection

    Find breaking changes in range:

    Network Configuration

    Generate network upgrade timeline:

    Edge Cases

    Empty Range

    When start > end but reverse=false not supported, returns empty or throws:

    Invalid Hardforks

    If hardforks don’t exist in order, an InvalidFormatError is thrown:

    Error Handling

    The range function throws InvalidFormatError when given invalid hardfork values:

    Performance

    Time Complexity: O(n) where n = range size Typical Time: ~100ns + (50ns × range size) Example Ranges:
    • BERLIN → LONDON: 2 hardforks (~150ns)
    • BERLIN → CANCUN: 7 hardforks (~450ns)
    • FRONTIER → OSAKA: 19 hardforks (~1050ns)

    See Also