Skip to content

Bug: rollup_getZkEVMBlockNumber returns invalid response when state is empty #110

@jpnovais

Description

@jpnovais

Description

rollup_getZkEVMBlockNumber returns invalid hexadecimal number 0x when shomei has emopty state (did not get genesis block trie log). This causes client side caller code to break with deserialization errors. Instead and JSON-RPC error shall be returned.

Steps to Reproduce (Bug)

  1. Start Shomei with empty state
  2. call {"jsonrpc":"2.0","id":19,"method":"rollup_getZkEVMBlockNumber","params":[]}

Expected behavior:

{"jsonrpc":"2.0","id":19,"method":"rollup_getZkEVMBlockNumber","params":[]}
{"jsonrpc":"2.0","id":19,"error":{"code": -32605, "message": "Server has empty state: no blocks imported."}}

Actual behavior:

{"jsonrpc":"2.0","id":19,"method":"rollup_getZkEVMBlockNumber","params":[]}
{"jsonrpc":"2.0","id":19,"result":"0x"}

Frequency:
Always

Versions (Add all that apply)

  • Software version: 2.3.0

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