Running more than 20 production blockchains, SKALED is Ethereum-compatible, high performance C++ Proof-of-Stake client, tools and libraries. Uses SKALE consensus as a blockchain consensus core. Includes dynamic Oracle. Implements file storage and retrieval as an EVM extension.
Hello, with go-ethereum, I'm unable to parse any logs does not conform to EIP-1474: logIndex and transactionIndex returns 0 instead 0x0.
go-ethereum parses JSON logs in this file. By using hexutil.Uint, go-ethereum parse the hex string of logIndex, transactionIndex and blockNumber JSON to a uint.
This is because, according to EIP-1474, logIndex, transactionIndex and blockNumber follows the rules of a Quantity:
A Quantity value MUST be hex-encoded.
A Quantity value MUST be "0x"-prefixed.
A Quantity value MUST be expressed using the fewest possible hex digits per byte.
A Quantity value MUST express zero as "0x0".
go-ethereum fails to parse logs on SKALE because SKALE (or at least the Titan AI Hub testnet) returns a payload where zero is 0 instead of "0x0". The returned error is json: cannot unmarshal non-string into Go struct field Log.logIndex of type hexutil.Uint
Describe the bug
Hello, with go-ethereum, I'm unable to parse any logs does not conform to EIP-1474:
logIndex
andtransactionIndex
returns0
instead0x0
.go-ethereum
parses JSON logs in this file. By usinghexutil.Uint
,go-ethereum
parse the hex string oflogIndex
,transactionIndex
andblockNumber
JSON to auint
.This is because, according to EIP-1474,
logIndex
,transactionIndex
andblockNumber
follows the rules of aQuantity
:go-ethereum
fails to parse logs on SKALE because SKALE (or at least the Titan AI Hub testnet) returns a payload where zero is0
instead of"0x0"
. The returned error isjson: cannot unmarshal non-string into Go struct field Log.logIndex of type hexutil.Uint
To Reproduce PoC: https://github.com/Darkness4/skale-log-failure-poc
Steps to reproduce the behavior: Run
SubscribeFilterLogs
with achan types.Log
:Expected behavior Got JSON:
Expected JSON:
SKALE should return an hexadecimal string for
logIndex
andtransactionIndex
.