Skip to content

Commit cbc859f

Browse files
tac0turtleclaude
andcommitted
chore: remove dead code
Remove code unreachable from any binary, test (including integration-tagged tests), or known downstream consumer: - apps/evm/cmd/post_tx_cmd.go: PostTxCmd was added in #2888 but never registered in the CLI; ev-abci carries its own copy - apps/evm/server: handleChainID was never routed; eth_chainId falls through to the execution RPC proxy - apps/testapp/kv: HTTPServer.Stop is redundant, Start already shuts down via context cancellation - node: MockTester has no users - pkg/da/types: SplitID duplicates pkg/da/jsonrpc.SplitID, which is the copy in use - pkg/store: GetPrefixEntries has no callers Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent dd99033 commit cbc859f

6 files changed

Lines changed: 0 additions & 289 deletions

File tree

apps/evm/cmd/post_tx_cmd.go

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

apps/evm/server/force_inclusion.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"fmt"
99
"io"
1010
"net/http"
11-
"strconv"
1211
"strings"
1312
"time"
1413

@@ -175,19 +174,6 @@ func (s *ForceInclusionServer) handleJSONRPC(w http.ResponseWriter, r *http.Requ
175174
}
176175
}
177176

178-
// handleChainID handles eth_chainId requests
179-
func (s *ForceInclusionServer) handleChainID(w http.ResponseWriter, req *JSONRPCRequest) {
180-
// Convert chain ID string to integer
181-
chainIDInt, err := strconv.ParseUint(s.genesis.ChainID, 10, 64)
182-
if err != nil {
183-
s.writeError(w, req.ID, InternalError, fmt.Sprintf("invalid chain ID: %v", err))
184-
return
185-
}
186-
// Return the chain ID as a hex string prefixed with 0x
187-
chainID := fmt.Sprintf("0x%x", chainIDInt)
188-
s.writeSuccess(w, req.ID, chainID)
189-
}
190-
191177
// proxyToExecutionRPC forwards unknown RPC methods to the execution RPC endpoint
192178
func (s *ForceInclusionServer) proxyToExecutionRPC(w http.ResponseWriter, req *JSONRPCRequest, body []byte) {
193179
if s.executionRPCURL == "" {

apps/testapp/kv/http_server.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ func (hs *HTTPServer) Start(ctx context.Context) error {
7676
}
7777
}
7878

79-
// Stop shuts down the HTTP server
80-
func (hs *HTTPServer) Stop() error {
81-
return hs.server.Close()
82-
}
83-
8479
// handleTx handles transaction submissions
8580
// POST /tx with raw binary data or text in request body
8681
// It is recommended to use transactions in the format "key=value" to be consistent

node/helpers.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@ const (
2323
Store
2424
)
2525

26-
// MockTester is a mock testing.T
27-
type MockTester struct {
28-
}
29-
30-
// Fail is used to fail the test
31-
func (m MockTester) Fail() {}
32-
33-
// FailNow is used to fail the test immediately
34-
func (m MockTester) FailNow() {}
35-
36-
// Logf is used to log a message to the test logger
37-
func (m MockTester) Logf(format string, args ...any) {}
38-
39-
// Errorf is used to log an error to the test logger
40-
func (m MockTester) Errorf(format string, args ...any) {}
41-
4226
func waitForFirstBlock(node Node, source Source) error {
4327
return waitForAtLeastNBlocks(node, 1, source)
4428
}

pkg/da/types/types.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package da
22

33
import (
4-
"encoding/binary"
5-
"fmt"
64
"time"
75
)
86

@@ -73,16 +71,6 @@ type BaseResult struct {
7371
Timestamp time.Time
7472
}
7573

76-
// SplitID splits an ID into a height and a commitment.
77-
// if len(id) <= 8, it returns 0 and nil.
78-
func SplitID(id []byte) (uint64, []byte, error) {
79-
if len(id) <= 8 {
80-
return 0, nil, fmt.Errorf("invalid ID length: %d", len(id))
81-
}
82-
commitment := id[8:]
83-
return binary.LittleEndian.Uint64(id[:8]), commitment, nil
84-
}
85-
8674
// SubscriptionEvent is a namespace-agnostic signal that a blob was finalized at
8775
// Height on the DA layer. Produced by Subscribe and consumed by DA followers.
8876
type SubscriptionEvent struct {

pkg/store/kv.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package store
22

33
import (
4-
"context"
54
"path/filepath"
65
"strings"
76

87
ds "github.com/ipfs/go-datastore"
98
ktds "github.com/ipfs/go-datastore/keytransform"
10-
dsq "github.com/ipfs/go-datastore/query"
119
badger4 "github.com/ipfs/go-ds-badger4"
1210
)
1311

@@ -30,15 +28,6 @@ func NewEvNodeKVStore(kvStore ds.Batching) ds.Batching {
3028
return NewPrefixKVStore(kvStore, EvPrefix)
3129
}
3230

33-
// GetPrefixEntries retrieves all entries in the datastore whose keys have the supplied prefix
34-
func GetPrefixEntries(ctx context.Context, store ds.Datastore, prefix string) (dsq.Results, error) {
35-
results, err := store.Query(ctx, dsq.Query{Prefix: prefix})
36-
if err != nil {
37-
return nil, err
38-
}
39-
return results, nil
40-
}
41-
4231
// GenerateKey creates a key from a slice of string fields, joining them with slashes.
4332
func GenerateKey(fields []string) string {
4433
// Pre-calculate total size to avoid re-allocation.

0 commit comments

Comments
 (0)