Repository navigation
Open
Labels
enhancementNew feature or requestNew feature or requestneeds-triageMaintainer needs to evaluate this issueMaintainer needs to evaluate this issue
Description
Summary
About 3750 lines of cleanup candidates remain after the privacy package. They are not all the same kind, and they cannot be deleted as one batch.
Not wired at all (806 lines remain of the original 957):
beacon/-- still 806 lines. geth's PoS light client, never wired; the whole tree (Makefile / cicd / build / internal / tests) has zero references, andXDPoSChain/beacon/...is imported only from withinbeacon/itself.- DONE:
cmd/XDC/bugcmd.go(was 105 lines) andcmd/internal/browser/(was 46 lines) -- deleted by PR refactor(cmd,consensus,core,eth,internal,XDCx,contracts): clear the unused linter debt #2896 (commit4d5f019b7b); no references remain anywhere in the tree.
The remaining item can go independently.
Still wired (needs a decision and rewiring):
consensus/ethash/-- 684 lines. Four production references:eth/backend.go:535(NewFakerfallback for non-XDPoS configs),miner/remote_agent.go:120(SeedHash),ethclient/simulated/backend.go:230, and the reward constants incmd/puppeth/genesis.go.tests/adds two non-test helper files (tests/difficulty_test_util.go:25,59,tests/block_test_util.go:31,115). Delete only after those call sites are rewritten.
Already tracked elsewhere:
- Privacy precompiles 0x1e/0x28 and
core/vm/privacy/are tracked in core/vm: remove unused privacy precompiles and the privacy package #2895 (PR refactor(core/vm): remove unused privacy precompiles and the privacy package, close #2895 #2898). They are historical consensus code, not dead code: they were active precompiles on mainnet from block 4 to 80,369,999 and on testnet from block 4 to 61,289,999. Removing them needs a historical replay from the Byzantium block, so that work is deliberately separate. Current shape: the package is 2795 lines (bulletproof.go1372 +ringct.go621 + 802 of tests); 0x1e/0x28 are written ascommon.BytesToAddress([]byte{30})/([]byte{40})and registered only in the Byzantium (core/vm/contracts.go:72-73) and Istanbul (:90-91) tables -- the XDCv2, EIP1559, Prague and Osaka buckets do not contain them, andactivePrecompiledContracts(:223-240) has no London branch. core/vm/XDCx_price.go(79 lines) is not a removal candidate: 0x29/0x2a are registered and wired (core/vm/contracts.go:74-75,92-93,:276-279callsSetTradingState) with four tests (contracts_test.go:74-75,688-712).
Suggested fix
Delete beacon/ in one PR (bugcmd.go and cmd/internal/browser/ are already gone via PR #2896). Treat ethash separately with its call-site rewrites. Keep the privacy decision with #2895.
Impact if unfixed
About 800 lines of unreachable code keep getting read, reviewed and maintained.
Audit item 18 (Nice to have); line numbers are on dev-upgrade at 1f445511fc (re-verified 2026-11-04).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds-triageMaintainer needs to evaluate this issueMaintainer needs to evaluate this issue
Activity