erigontech / erigontech/erigon

rpc: graphql and otterscan clean-ups from the #23969 review

Open
#23,991 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3.6k
Forks
1.5k
Avg merge
1d 16h
Merged PRs (30d)
465

Description

Pre-existing items found in the review of #23969 (line numbers at its head acd1650066). None changes behaviour on its own; each is a small separate fix.

- **graphql map helpers are mostly dead.** After #23969, the map-based helpers in `cmd/rpcdaemon/graphql/graph/helpers.go` are only used for withdrawals, and the comment at `helpers_test.go:69` still describes the old receipt flow.
- **graphql fee fields duplicate `ethapi.NewRPCTransaction`.** The type list at `rpc/jsonrpc/graphql_api.go:77` repeats the type switch in `ethapi.NewRPCTransaction`, and the two already disagree for `AccountAbstractionTxType`: `eth_getTransactionByHash` shows the fee caps, graphql omits them.
- **`ots_getBlockTransactions` marshals every receipt before cropping the page.** At `rpc/jsonrpc/otterscan_api.go:418`, moving the `pageEnd > len(receipts)` check up and marshalling only `receipts[pageStart:pageEnd]` gives the same result.
- **Lower-cased addresses pay for the EIP-55 checksum.** `strings.ToLower(addr.String())` at `cmd/rpcdaemon/graphql/graph/resolver_helpers.go:190` (and for log and access-list addresses) computes the checksum and discards it; `hexutil.Encode(addr[:])` gives the same string.

Contributor guide

Open the contributing guide

Research direction

Start with the locations named in the issue: cmd/rpcdaemon/graphql/graph/helpers.go and helpers_test.go, rpc/jsonrpc/graphql_api.go, rpc/jsonrpc/otterscan_api.go, and resolver_helpers.go. Read the related code and tests before separating the cleanup into a focused change. Done means the obsolete helper/comment, duplicated fee mapping, receipt pagination work, and lower-case address formatting each match the stated review findings without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, graphql
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.