Skip to content

Commit f21adaf

Browse files
authored
consensus: remove clique RPC APIs (#31875)
1 parent a53fdf1 commit f21adaf

File tree

6 files changed

+0
-265
lines changed

6 files changed

+0
-265
lines changed

consensus/beacon/consensus.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/ethereum/go-ethereum/core/types"
3131
"github.com/ethereum/go-ethereum/core/vm"
3232
"github.com/ethereum/go-ethereum/params"
33-
"github.com/ethereum/go-ethereum/rpc"
3433
"github.com/ethereum/go-ethereum/trie"
3534
"github.com/holiman/uint256"
3635
)
@@ -445,11 +444,6 @@ func (beacon *Beacon) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
445444
return beaconDifficulty
446445
}
447446

448-
// APIs implements consensus.Engine, returning the user facing RPC APIs.
449-
func (beacon *Beacon) APIs(chain consensus.ChainHeaderReader) []rpc.API {
450-
return beacon.ethone.APIs(chain)
451-
}
452-
453447
// Close shutdowns the consensus engine
454448
func (beacon *Beacon) Close() error {
455449
return beacon.ethone.Close()

consensus/clique/api.go

Lines changed: 0 additions & 235 deletions
This file was deleted.

consensus/clique/clique.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import (
4141
"github.com/ethereum/go-ethereum/log"
4242
"github.com/ethereum/go-ethereum/params"
4343
"github.com/ethereum/go-ethereum/rlp"
44-
"github.com/ethereum/go-ethereum/rpc"
4544
"github.com/ethereum/go-ethereum/trie"
4645
"golang.org/x/crypto/sha3"
4746
)
@@ -641,15 +640,6 @@ func (c *Clique) Close() error {
641640
return nil
642641
}
643642

644-
// APIs implements consensus.Engine, returning the user facing RPC API to allow
645-
// controlling the signer voting.
646-
func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API {
647-
return []rpc.API{{
648-
Namespace: "clique",
649-
Service: &API{chain: chain, clique: c},
650-
}}
651-
}
652-
653643
// SealHash returns the hash of a block prior to it being sealed.
654644
func SealHash(header *types.Header) (hash common.Hash) {
655645
hasher := sha3.NewLegacyKeccak256()

consensus/consensus.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"github.com/ethereum/go-ethereum/core/types"
2626
"github.com/ethereum/go-ethereum/core/vm"
2727
"github.com/ethereum/go-ethereum/params"
28-
"github.com/ethereum/go-ethereum/rpc"
2928
)
3029

3130
// ChainHeaderReader defines a small collection of methods needed to access the local
@@ -109,9 +108,6 @@ type Engine interface {
109108
// that a new block should have.
110109
CalcDifficulty(chain ChainHeaderReader, time uint64, parent *types.Header) *big.Int
111110

112-
// APIs returns the RPC APIs this consensus engine provides.
113-
APIs(chain ChainHeaderReader) []rpc.API
114-
115111
// Close terminates any background threads maintained by the consensus engine.
116112
Close() error
117113
}

consensus/ethash/ethash.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
"github.com/ethereum/go-ethereum/consensus"
2424
"github.com/ethereum/go-ethereum/core/types"
25-
"github.com/ethereum/go-ethereum/rpc"
2625
)
2726

2827
// Ethash is a consensus engine based on proof-of-work implementing the ethash
@@ -71,12 +70,6 @@ func (ethash *Ethash) Close() error {
7170
return nil
7271
}
7372

74-
// APIs implements consensus.Engine, returning no APIs as ethash is an empty
75-
// shell in the post-merge world.
76-
func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API {
77-
return []rpc.API{}
78-
}
79-
8073
// Seal generates a new sealing request for the given input block and pushes
8174
// the result into the given channel. For the ethash engine, this method will
8275
// just panic as sealing is not supported anymore.

eth/backend.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,6 @@ func makeExtraData(extra []byte) []byte {
337337
func (s *Ethereum) APIs() []rpc.API {
338338
apis := ethapi.GetAPIs(s.APIBackend)
339339

340-
// Append any APIs exposed explicitly by the consensus engine
341-
apis = append(apis, s.engine.APIs(s.BlockChain())...)
342-
343340
// Append all the local APIs and return
344341
return append(apis, []rpc.API{
345342
{

0 commit comments

Comments
 (0)