Skip to content

Commit 93a5fdd

Browse files
authored
Remove unused variables, functions and more (#15264)
1 parent 0251fd7 commit 93a5fdd

File tree

13 files changed

+8
-568
lines changed

13 files changed

+8
-568
lines changed

api/client/event/event_stream.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@ import (
1414
)
1515

1616
const (
17-
EventHead = "head"
18-
EventBlock = "block"
19-
EventAttestation = "attestation"
20-
EventVoluntaryExit = "voluntary_exit"
21-
EventBlsToExecutionChange = "bls_to_execution_change"
22-
EventProposerSlashing = "proposer_slashing"
23-
EventAttesterSlashing = "attester_slashing"
24-
EventFinalizedCheckpoint = "finalized_checkpoint"
25-
EventChainReorg = "chain_reorg"
26-
EventContributionAndProof = "contribution_and_proof"
27-
EventLightClientFinalityUpdate = "light_client_finality_update"
28-
EventLightClientOptimisticUpdate = "light_client_optimistic_update"
29-
EventPayloadAttributes = "payload_attributes"
30-
EventBlobSidecar = "blob_sidecar"
31-
EventError = "error"
32-
EventConnectionError = "connection_error"
17+
EventHead = "head"
18+
19+
EventError = "error"
20+
EventConnectionError = "connection_error"
3321
)
3422

3523
var (

beacon-chain/core/blocks/payload.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
1313
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
1414
"github.com/OffchainLabs/prysm/v6/consensus-types/primitives"
15-
"github.com/OffchainLabs/prysm/v6/encoding/bytesutil"
1615
"github.com/OffchainLabs/prysm/v6/runtime/version"
1716
"github.com/OffchainLabs/prysm/v6/time/slots"
1817
"github.com/pkg/errors"
@@ -240,16 +239,3 @@ func verifyBlobCommitmentCount(slot primitives.Slot, body interfaces.ReadOnlyBea
240239
}
241240
return nil
242241
}
243-
244-
// GetBlockPayloadHash returns the hash of the execution payload of the block
245-
func GetBlockPayloadHash(blk interfaces.ReadOnlyBeaconBlock) ([32]byte, error) {
246-
var payloadHash [32]byte
247-
if IsPreBellatrixVersion(blk.Version()) {
248-
return payloadHash, nil
249-
}
250-
payload, err := blk.Body().Execution()
251-
if err != nil {
252-
return payloadHash, err
253-
}
254-
return bytesutil.ToBytes32(payload.BlockHash()), nil
255-
}

beacon-chain/db/kv/error.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ var ErrNotFoundOriginBlockRoot = errors.Wrap(ErrNotFound, "OriginBlockRoot")
1616
// ErrNotFoundGenesisBlockRoot means no genesis block root was found, indicating the db was not initialized with genesis
1717
var ErrNotFoundGenesisBlockRoot = errors.Wrap(ErrNotFound, "OriginGenesisRoot")
1818

19-
// ErrNotFoundBackfillBlockRoot is an error specifically for the origin block root getter
20-
var ErrNotFoundBackfillBlockRoot = errors.Wrap(ErrNotFound, "BackfillBlockRoot")
21-
2219
// ErrNotFoundFeeRecipient is a not found error specifically for the fee recipient getter
2320
var ErrNotFoundFeeRecipient = errors.Wrap(ErrNotFound, "fee recipient")
2421

beacon-chain/rpc/eth/shared/testing/json.go

Lines changed: 1 addition & 383 deletions
Large diffs are not rendered by default.

changelog/tt_sandwich.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Ignored
2+
3+
- Remove unused.

consensus-types/blocks/proofs.go

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

1919
const (
2020
payloadFieldIndex = 9
21-
bodyFieldIndex = 4
2221
)
2322

2423
func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) {
@@ -196,45 +195,6 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody)
196195
return fieldRoots, nil
197196
}
198197

199-
func ComputeBlockFieldRoots(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]byte, error) {
200-
_, span := trace.StartSpan(ctx, "blocks.ComputeBlockFieldRoots")
201-
defer span.End()
202-
203-
if block == nil {
204-
return nil, errNilBlock
205-
}
206-
207-
fieldRoots := make([][]byte, 5)
208-
for i := range fieldRoots {
209-
fieldRoots[i] = make([]byte, 32)
210-
}
211-
212-
// Slot
213-
slotRoot := ssz.Uint64Root(uint64(block.Slot()))
214-
copy(fieldRoots[0], slotRoot[:])
215-
216-
// Proposer Index
217-
proposerRoot := ssz.Uint64Root(uint64(block.ProposerIndex()))
218-
copy(fieldRoots[1], proposerRoot[:])
219-
220-
// Parent Root
221-
parentRoot := block.ParentRoot()
222-
copy(fieldRoots[2], parentRoot[:])
223-
224-
// State Root
225-
stateRoot := block.StateRoot()
226-
copy(fieldRoots[3], stateRoot[:])
227-
228-
// block body Root
229-
blockBodyRoot, err := block.Body().HashTreeRoot()
230-
if err != nil {
231-
return nil, err
232-
}
233-
copy(fieldRoots[4], blockBodyRoot[:])
234-
235-
return fieldRoots, nil
236-
}
237-
238198
func PayloadProof(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]byte, error) {
239199
i := block.Body()
240200
blockBody, ok := i.(*BeaconBlockBody)

encoding/ssz/htrutils.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ func WithdrawalRequestsSliceRoot(withdrawalRequests []*enginev1.WithdrawalReques
153153
return SliceRoot(withdrawalRequests, limit)
154154
}
155155

156-
// ConsolidationRequestsSliceRoot computes the HTR of a slice of consolidation requests from the EL.
157-
// The limit parameter is used as input to the bitwise merkleization algorithm.
158-
159-
func ConsolidationRequestsSliceRoot(consolidationRequests []*enginev1.ConsolidationRequest, limit uint64) ([32]byte, error) {
160-
return SliceRoot(consolidationRequests, limit)
161-
}
162-
163156
// ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N]
164157
// this func runs Chunkify + MerkleizeVector
165158
// max length is dividable by 32 ( root length )

proto/migration/v1alpha1_to_v1.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,6 @@ import (
55
ethpbalpha "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
66
)
77

8-
// V1Alpha1SignedHeaderToV1 converts a v1alpha1 signed beacon block header to v1.
9-
func V1Alpha1SignedHeaderToV1(v1alpha1Hdr *ethpbalpha.SignedBeaconBlockHeader) *ethpbv1.SignedBeaconBlockHeader {
10-
if v1alpha1Hdr == nil || v1alpha1Hdr.Header == nil {
11-
return &ethpbv1.SignedBeaconBlockHeader{}
12-
}
13-
return &ethpbv1.SignedBeaconBlockHeader{
14-
Message: V1Alpha1HeaderToV1(v1alpha1Hdr.Header),
15-
Signature: v1alpha1Hdr.Signature,
16-
}
17-
}
18-
19-
// V1Alpha1HeaderToV1 converts a v1alpha1 beacon block header to v1.
20-
func V1Alpha1HeaderToV1(v1alpha1Hdr *ethpbalpha.BeaconBlockHeader) *ethpbv1.BeaconBlockHeader {
21-
if v1alpha1Hdr == nil {
22-
return &ethpbv1.BeaconBlockHeader{}
23-
}
24-
25-
return &ethpbv1.BeaconBlockHeader{
26-
Slot: v1alpha1Hdr.Slot,
27-
ProposerIndex: v1alpha1Hdr.ProposerIndex,
28-
ParentRoot: v1alpha1Hdr.ParentRoot,
29-
StateRoot: v1alpha1Hdr.StateRoot,
30-
BodyRoot: v1alpha1Hdr.BodyRoot,
31-
}
32-
}
33-
34-
// V1HeaderToV1Alpha1 converts a v1 beacon block header to v1alpha1.
35-
func V1HeaderToV1Alpha1(v1Header *ethpbv1.BeaconBlockHeader) *ethpbalpha.BeaconBlockHeader {
36-
if v1Header == nil {
37-
return &ethpbalpha.BeaconBlockHeader{}
38-
}
39-
return &ethpbalpha.BeaconBlockHeader{
40-
Slot: v1Header.Slot,
41-
ProposerIndex: v1Header.ProposerIndex,
42-
ParentRoot: v1Header.ParentRoot,
43-
StateRoot: v1Header.StateRoot,
44-
BodyRoot: v1Header.BodyRoot,
45-
}
46-
}
47-
488
// V1ValidatorToV1Alpha1 converts a v1 validator to v1alpha1.
499
func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator {
5010
if v1Validator == nil {

proto/prysm/v1alpha1/cloners_test.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -886,25 +886,6 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb {
886886

887887
var genPayloadElectra = genPayloadDeneb
888888

889-
func genPayloadHeader() *enginev1.ExecutionPayloadHeader {
890-
return &enginev1.ExecutionPayloadHeader{
891-
ParentHash: bytes(32),
892-
FeeRecipient: bytes(32),
893-
StateRoot: bytes(32),
894-
ReceiptsRoot: bytes(32),
895-
LogsBloom: bytes(32),
896-
PrevRandao: bytes(32),
897-
BlockNumber: 1,
898-
GasLimit: 2,
899-
GasUsed: 3,
900-
Timestamp: 4,
901-
ExtraData: bytes(32),
902-
BaseFeePerGas: bytes(32),
903-
BlockHash: bytes(32),
904-
TransactionsRoot: bytes(32),
905-
}
906-
}
907-
908889
func genPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella {
909890
return &enginev1.ExecutionPayloadHeaderCapella{
910891
ParentHash: bytes(32),
@@ -949,14 +930,6 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb {
949930

950931
var genPayloadHeaderElectra = genPayloadHeaderDeneb
951932

952-
func genWithdrawals(num int) []*enginev1.Withdrawal {
953-
ws := make([]*enginev1.Withdrawal, num)
954-
for i := 0; i < num; i++ {
955-
ws[i] = genWithdrawal()
956-
}
957-
return ws
958-
}
959-
960933
func genWithdrawal() *enginev1.Withdrawal {
961934
return &enginev1.Withdrawal{
962935
Index: 123456,

runtime/interop/genesis.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ var DefaultDepositContractStorage = map[string]string{
6767
var bigz = big.NewInt(0)
6868
var minerBalance = big.NewInt(0)
6969

70-
// DefaultCliqueSigner is the testnet miner (clique signer) address encoded in the special way EIP-225 requires.
71-
// EIP-225 assigns a special meaning to the `extra-data` field in the block header for clique chains.
72-
// In a clique chain, this field contains one secp256k1 "miner" signature. This allows other nodes to
73-
// verify that the block was signed by an authorized signer, in place of the typical PoW verification.
74-
// Clique overloads the meaning of the `miner` and `nonce` fields to implement a voting protocol, whereby additional
75-
// signatures can be added to the list (for details see `Repurposing header fields for signing and voting` in EIP-225).
76-
// https://eips.ethereum.org/EIPS/eip-225
77-
// The following value is for the key used by the e2e test "miner" node.
78-
const DefaultCliqueSigner = "0x0000000000000000000000000000000000000000000000000000000000000000878705ba3f8bc32fcf7f4caa1a35e72af65cf7660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
79-
8070
// GethShanghaiTime calculates the absolute time of the shanghai (aka capella) fork block
8171
// by adding the relative time of the capella the fork epoch to the given genesis timestamp.
8272
func GethShanghaiTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 {

0 commit comments

Comments
 (0)