From user's feedback, we have found that there is a difference between Erigon and zkevm-node when querying events with eth_getFilterLogs RPC method. When the RPC cannot find the filter ID from user in its own memory, Erigon will return a [] while the zkevm-node will return null. But null leads to a NullPointerException (NPE) in web3j and thus causes a crash on user's program. So maybe zkevm-node should change its return from null to an empty slice when nothing returns and no error occors, and the RPC query response will be like the following:
{
"jsonrpc": "2.0",
"id": 73,
"result": []
}
Implementation
We modified jsonrpc/endpoints_eth.go Line 493 & 499 into return []types.Log{}, nil, and it works.
Rationale
From user's feedback, we have found that there is a difference between Erigon and zkevm-node when querying events with
eth_getFilterLogs
RPC method. When the RPC cannot find the filter ID from user in its own memory, Erigon will return a[]
while the zkevm-node will returnnull
. Butnull
leads to a NullPointerException (NPE) in web3j and thus causes a crash on user's program. So maybe zkevm-node should change its return from null to an empty slice when nothing returns and no error occors, and the RPC query response will be like the following:Implementation
We modified
jsonrpc/endpoints_eth.go
Line 493 & 499 intoreturn []types.Log{}, nil
, and it works.