Skip to content

chore(types,utils): delete dead ethermint-era helpers#320

Merged
puneet2019 merged 1 commit into
mainfrom
chore/drop-dead-types-utils
Jul 9, 2026
Merged

chore(types,utils): delete dead ethermint-era helpers#320
puneet2019 merged 1 commit into
mainfrom
chore/drop-dead-types-utils

Conversation

@puneet2019

@puneet2019 puneet2019 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Part of the shrink-to-upstream campaign (#309#316). PR A of the dead-code series from the five-folder symbol-level sweep.

Summary

Deletes 10 dead files (−494 LOC) — 8 Go sources, 1 test, 1 template — orphaned by the rpc/ (#309), in-tree x/evm, and x/erc20 (#221) removals:

File What it was
types/block.go BlockGasLimit — rpc-era helper
types/gasmeter.go ethermint infinite gas meter
types/int.go SafeInt64/SafeUint64 (the latter added for #292's rpc tests — re-orphaned when #309 deleted them)
types/protocol.go ProtocolVersion — served the deleted rpc
types/validation.go + test address validators, test-only and self-referential
types/constant.go unused DefaultDenom
types/openapiutil/ unreferenced API-console template
utils/eth/eth.go DeriveChainID/RawSignatureValues — live copies ship in cosmos/evm utils/

Safety

  • Symbol-level verification (not package-level): all 17 exported symbols in the deleted files (funcs, types, vars, and consts — incl. IsEmptyHash, IsZeroAddress, ErrorGasOverflow, ErrorNegativeGasConsumed, openapiutil.Handler beyond the originally listed 13) confirmed zero references across the repo — and, per the consumer sweep, across the three known external consumers (moca-storage-provider, moca-go-sdk, moca-challenger).
  • The consumer check is what scoped this PR: e.g. types/chain_id.go looks test-only in-repo but ParseChainID is production code in the storage provider's signer — it, grn.go, s3util, resource, common, and the state-critical account.* are untouched.
  • go build ./..., go test ./types/... ./utils/..., full test-binary compile sweep (go test -run='^$' ./...), and go vet ./e2e/... (outside CI's unit scope) — green locally and on an amd64 box.

Next in the series: dead client/testnet.go (PR B), two fork-neutral swaps (PR C), dead-symbol trims (PR D).

🤖 Generated with Claude Code

These files were orphaned by the rpc/, in-tree x/evm, and x/erc20 removals:
block.go (BlockGasLimit), gasmeter.go (infinite gas meter), int.go
(SafeInt64/SafeUint64 — the latter re-orphaned when #309 deleted the rpc
tests that used it), protocol.go, validation.go(+test), constant.go,
openapiutil/, and utils/eth (DeriveChainID/RawSignatureValues, live copies of
which ship in cosmos/evm's utils).

Every exported symbol was verified to have zero references across the repo
AND the three known external consumers (moca-storage-provider, moca-go-sdk,
moca-challenger). Files those consumers do use — chain_id.go (ParseChainID is
production code in the storage provider's signer), grn.go, s3util, resource,
common — are untouched.

Signed-off-by: puneetmahajan <59960662+puneet2019@users.noreply.github.com>
@puneet2019 puneet2019 force-pushed the chore/drop-dead-types-utils branch from a8ccd8d to a448eb6 Compare July 9, 2026 05:44
@phenix3443

Copy link
Copy Markdown
Contributor

I think this should be treated as a breaking Go API change, not just dead-code deletion.

The symbols removed here are exported from the published github.com/mocachain/moca/v2 module surface, for example:

  • types.SafeInt64 / SafeUint64 / SafeNewIntFromBigInt / IsValidInt256
  • types.ValidateAddress / ValidateNonZeroAddress / IsEmptyHash / IsZeroAddress
  • utils/eth.DeriveChainID / RawSignatureValues
  • types/openapiutil.Handler

The repo-wide zero-reference check is enough to prove they are dead internally, but it does not prove they are safe to delete for downstream Go consumers. Any external code importing these packages will fail to compile after upgrading to this PR.

If the intent is a non-breaking cleanup, I think these need compat shims / deprecation first. If the intent is to break the module API, that should be called out explicitly as a breaking change rather than a routine chore cleanup.

@puneet2019

Copy link
Copy Markdown
Contributor Author

acknowledged, i am ok with breaking changes here

@puneet2019 puneet2019 merged commit a8dd359 into main Jul 9, 2026
25 checks passed
@puneet2019 puneet2019 deleted the chore/drop-dead-types-utils branch July 9, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants