Background
Two E2E tests in tests/e2e/tests/api/rpc_test.go are currently hard-skipped:
TestRPC_GetBlockByNumber
TestRPC_GetBlockByHash
Both are skipped with the same reason:
t.Skip("api-server /eth facade returns blocks without uncle metadata; ethclient uncle-list validation fails")
Root Cause
The api-server's /eth JSON-RPC facade returns synthetic blocks assembled from Canton ledger state. The block struct (ethrpc.RPCBlock) populates:
Sha3Uncles: common.Hash{} — the zero hash
Uncles: []common.Hash{} — empty slice
The go-ethereum ethclient deserialises the raw JSON response and validates that sha3Uncles matches the actual SHA3 of the uncle list. The zero hash (0x000...) does not match the SHA3 of an empty uncle list (0x1dcc4de8dec75d7aab85b567b6ccd41a... — the well-known empty uncle hash). This causes ethclient.BlockByNumber / ethclient.BlockByHash to return an error, failing the test.
The fix is in pkg/ethrpc/service/service.go GetBlockByNumber: set Sha3Uncles to the correct empty-uncle SHA3 constant rather than the zero hash:
// types.EmptyUncleHash is keccak256(rlp([]))
Sha3Uncles: types.EmptyUncleHash,
Once that change is made, the two test t.Skip calls can be removed and the tests should pass against the live devstack.
Acceptance Criteria
Background
Two E2E tests in
tests/e2e/tests/api/rpc_test.goare currently hard-skipped:TestRPC_GetBlockByNumberTestRPC_GetBlockByHashBoth are skipped with the same reason:
Root Cause
The api-server's
/ethJSON-RPC facade returns synthetic blocks assembled from Canton ledger state. The block struct (ethrpc.RPCBlock) populates:Sha3Uncles: common.Hash{}— the zero hashUncles: []common.Hash{}— empty sliceThe go-ethereum
ethclientdeserialises the raw JSON response and validates thatsha3Unclesmatches the actual SHA3 of the uncle list. The zero hash (0x000...) does not match the SHA3 of an empty uncle list (0x1dcc4de8dec75d7aab85b567b6ccd41a...— the well-known empty uncle hash). This causesethclient.BlockByNumber/ethclient.BlockByHashto return an error, failing the test.The fix is in
pkg/ethrpc/service/service.goGetBlockByNumber: setSha3Unclesto the correct empty-uncle SHA3 constant rather than the zero hash:Once that change is made, the two test
t.Skipcalls can be removed and the tests should pass against the live devstack.Acceptance Criteria
pkg/ethrpc/service/service.go:Sha3Unclesset totypes.EmptyUncleHash(notcommon.Hash{})TestRPC_GetBlockByNumberunskipped and passing in CITestRPC_GetBlockByHashunskipped and passing in CIpkg/ethrpc/service/eth_api_test.goupdated to assert the correctSha3Unclesvalue