Skip to content

Commit 4884049

Browse files
committed
refactor(rpc)!: replace in-tree JSON-RPC with cosmos/evm/rpc
Delete moca's ~16k-LOC forked rpc/ tree and serve the EVM JSON-RPC from github.com/cosmos/evm/rpc (v0.6.0): backend, namespaces, and the newHeads/logs/pendingTx subscriptions now come from cosmos/evm, fed by an in-process CometBFT event stream and an ante PendingTxListener hook on *Moca. The indexer moves to cosmos/evm's server/types.TxResult. The only retained moca RPC code is a thin server/websockets.go shim: a copy of cosmos/evm's WS server with newHeads emitting the canonical CometBFT block hash (moca #232 / issue #229) instead of the derived eth-header hash, completing the half-fix in cosmos/evm#725 (the canonical hash is carried on the stream but unused in newHeads upstream). Removable once that lands and we bump. Also drop now-unused config keys (query-timeout, getlogs-rate-limit, getlogs-burst-limit, fix-revert-gas-refund-height) and the dead ethermint.types.v1.TxResult / EVMTxIndexer types; add json-rpc.ws-origins. Depends on #292 (WS/getFilterChanges e2e gate); merge after #292. Verified: go build ./... green; e2e RPC suite 10/10 (incl. eth_subscribe logs). Signed-off-by: puneetmahajan <59960662+puneet2019@users.noreply.github.com>
1 parent 2ee07c4 commit 4884049

74 files changed

Lines changed: 374 additions & 17081 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,17 @@ Ref: https://keepachangelog.com/en/1.0.0/
5555
`markdown-lint.yml` comments; remove obsolete `deployment/localup/README.md` and
5656
`deployment/dockerup/README.md` (legacy Node dev.js docs)
5757
- (docs) [#66](https://github.com/mocachain/moca/pull/66) Update RELEASE_GUIDE.md security notes for GITHUB_TOKEN
58+
- (rpc) [#309](https://github.com/mocachain/moca/pull/309) Replace the in-tree JSON-RPC server (`rpc/`, ~16k LOC forked from ethermint/evmos) with `github.com/cosmos/evm/rpc`: the backend, namespaces, and the newHeads/logs/pendingTx subscriptions now come from cosmos/evm (fed by an in-process CometBFT event stream and an ante `PendingTxListener` hook on `*Moca`), and the indexer moves to cosmos/evm's `server/types.TxResult`. Gains `safe`/`finalized` block tags, `eth_getBlockReceipts`, `eth_getHeaderBy*`, `eth_createAccessList`, `debug_traceBlock`, EIP-4844/7702 tx fields, and upstream tracking. A thin `server/websockets.go` shim is retained so `newHeads` emits the canonical CometBFT block hash (completes `cosmos/evm#725`); removable once that lands upstream and we bump.
5859

5960
### State Machine Breaking
6061

6162
- (erc20) [#221](https://github.com/mocachain/moca/pull/221) Remove the dormant `x/erc20` module and the erc20 precompile; register the `erc20` store for deletion in the `v2.0.0` store upgrade
6263
- (deps) [#240](https://github.com/mocachain/moca/pull/240) Bump `moca-cosmos-sdk` to the upstream gas meter (remove greenfield RW metering): store writes/deletes now consume tx gas (reads stay free under `KVGasConfigAfterNagqu`), and the `GasInfo.rw_used` / `TxMsgData.extra_data` fields are removed
6364

65+
### Client Breaking
66+
67+
- (rpc) [#309](https://github.com/mocachain/moca/pull/309) The EVM JSON-RPC is now served by `cosmos/evm`: the non-standard `eth_coinbase`, `eth_mining`, `eth_hashrate`, `eth_getPendingTransactions`, and `debug_seedHash` endpoints are removed; `eth_subscribe("newPendingTransactions")` now streams from the local mempool (CheckTx) rather than committed-tx events; the `json-rpc.query-timeout`, `json-rpc.getlogs-rate-limit`, `json-rpc.getlogs-burst-limit`, and `json-rpc.fix-revert-gas-refund-height` `app.toml` keys are removed; and WebSocket (`eth_subscribe`) connections now honor a `json-rpc.ws-origins` allow-list (default `["127.0.0.1", "localhost"]`). Standard ethers/viem polling and transaction submission are unaffected.
68+
6469
### Bug Fixes
6570

6671
- (virtualgroup,storage) [#306](https://github.com/mocachain/moca/pull/306) Tighten storage provider exit preconditions and make discontinued-resource cleanup resolve its primary SP defensively.

0 commit comments

Comments
 (0)