Skip to content

Commit d550ec0

Browse files
authored
chore: remove eth_hashrate and eth_mining json rpc methods (#694)
1 parent acd760e commit d550ec0

File tree

3 files changed

+1
-38
lines changed

3 files changed

+1
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4141
* (evm) [#689](https://github.com/crypto-org-chain/ethermint/pull/689) Enable CancunTime and PragueTime in chain config migration.
4242
* (evm) [#691](https://github.com/crypto-org-chain/ethermint/pull/691) Remove active precompiles from VMContext
4343
* (app) [#692](https://github.com/crypto-org-chain/ethermint/pull/692) Enforce app creator returning application implement AppWithPendingTxStream in build time.
44+
* (evm) [#694](https://github.com/crypto-org-chain/ethermint/pull/694) Remove miner(eth_hashrate and eth_mining) json rpc methods
4445

4546
### Features
4647

rpc/apis.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"github.com/evmos/ethermint/rpc/namespaces/ethereum/debug"
2828
"github.com/evmos/ethermint/rpc/namespaces/ethereum/eth"
2929
"github.com/evmos/ethermint/rpc/namespaces/ethereum/eth/filters"
30-
"github.com/evmos/ethermint/rpc/namespaces/ethereum/miner"
3130
"github.com/evmos/ethermint/rpc/namespaces/ethereum/net"
3231
"github.com/evmos/ethermint/rpc/namespaces/ethereum/personal"
3332
"github.com/evmos/ethermint/rpc/namespaces/ethereum/txpool"
@@ -50,7 +49,6 @@ const (
5049
NetNamespace = "net"
5150
TxPoolNamespace = "txpool"
5251
DebugNamespace = "debug"
53-
MinerNamespace = "miner"
5452

5553
apiVersion = "1.0"
5654
)
@@ -153,22 +151,6 @@ func init() {
153151
},
154152
}
155153
},
156-
MinerNamespace: func(ctx *server.Context,
157-
clientCtx client.Context,
158-
_ *stream.RPCStream,
159-
allowUnprotectedTxs bool,
160-
indexer ethermint.EVMTxIndexer,
161-
) []rpc.API {
162-
evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer)
163-
return []rpc.API{
164-
{
165-
Namespace: MinerNamespace,
166-
Version: apiVersion,
167-
Service: miner.NewPrivateAPI(ctx, evmBackend),
168-
Public: false,
169-
},
170-
}
171-
},
172154
}
173155
}
174156

rpc/namespaces/ethereum/eth/api.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ type EthereumAPI interface {
106106
GetUncleCountByBlockHash(hash common.Hash) hexutil.Uint
107107
GetUncleCountByBlockNumber(blockNum rpctypes.BlockNumber) hexutil.Uint
108108

109-
// Proof of Work
110-
Hashrate() hexutil.Uint64
111-
Mining() bool
112-
113109
// Other
114110
Syncing() (interface{}, error)
115111
Coinbase() (string, error)
@@ -383,22 +379,6 @@ func (e *PublicAPI) GetUncleCountByBlockNumber(_ rpctypes.BlockNumber) hexutil.U
383379
return 0
384380
}
385381

386-
///////////////////////////////////////////////////////////////////////////////
387-
/// Proof of Work ///
388-
///////////////////////////////////////////////////////////////////////////////
389-
390-
// Hashrate returns the current node's hashrate. Always 0.
391-
func (e *PublicAPI) Hashrate() hexutil.Uint64 {
392-
e.logger.Debug("eth_hashrate")
393-
return 0
394-
}
395-
396-
// Mining returns whether or not this node is currently mining. Always false.
397-
func (e *PublicAPI) Mining() bool {
398-
e.logger.Debug("eth_mining")
399-
return false
400-
}
401-
402382
///////////////////////////////////////////////////////////////////////////////
403383
/// Other ///
404384
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)