Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pkg/storagechallenge/deterministic/deterministic.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ func EpochID(height int64, epochZeroHeight uint64, epochLengthBlocks uint64) (ui
return uint64(height-int64(epochZeroHeight)) / epochLengthBlocks, true
}

func EpochStartHeight(epochID uint64, epochZeroHeight uint64, epochLengthBlocks uint64) int64 {
return int64(epochZeroHeight) + int64(epochID)*int64(epochLengthBlocks)
}

func ComparisonTargetForChallengers(seed []byte, epochID uint64) string {
return "sc:challengers:" + hex.EncodeToString(seed) + ":" + strconv.FormatUint(epochID, 10)
}
Expand Down
14 changes: 0 additions & 14 deletions pkg/types/healthcheck_challenge.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package types

import (
"encoding/json"
"time"

"github.com/LumeraProtocol/supernode/v2/pkg/utils"
)

// HealthCheckMessageType represents the type of message sent in the health-check process
Expand Down Expand Up @@ -151,14 +148,3 @@ type ProcessBroadcastHealthCheckChallengeMetricsRequest struct {
Data []byte `json:"data"`
SenderID string `json:"sender_id"`
}

// HealthCheckChallengeMessages represents an array of health-check message
type HealthCheckChallengeMessages []HealthCheckMessage

// Hash returns the hash of the health-check-challenge challenge log data
func (mdl HealthCheckChallengeMessages) Hash() string {
data, _ := json.Marshal(mdl)
hash, _ := utils.Blake3Hash(data)

return string(hash)
}
39 changes: 0 additions & 39 deletions pkg/types/storage_challenge.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package types

import (
"encoding/json"
"time"

"github.com/LumeraProtocol/supernode/v2/pkg/errors"
"github.com/LumeraProtocol/supernode/v2/pkg/utils"
)

// MessageType represents the type of message
Expand Down Expand Up @@ -40,22 +36,6 @@ func (m MessageType) String() string {
}
}

// MessageTypeFromString returns the message type from string
func MessageTypeFromString(str string) (MessageType, error) {
switch str {
case "challenge":
return ChallengeMessageType, nil
case "response":
return ResponseMessageType, nil
case "evaluation":
return EvaluationMessageType, nil
case "affirmation":
return AffirmationMessageType, nil
default:
return 0, errors.New("invalid message type string")
}
}

// StorageChallengeSignatures represents the signature struct for broadcasting
type StorageChallengeSignatures struct {
Challenger map[string]string `json:"challenger,omitempty"`
Expand Down Expand Up @@ -185,16 +165,6 @@ type ProcessBroadcastChallengeMetricsRequest struct {
SenderID string `json:"sender_id"`
}

type StorageChallengeMessages []Message

// Hash returns the hash of the storage-challenge challenge log data
func (mdl StorageChallengeMessages) Hash() string {
data, _ := json.Marshal(mdl)
hash, _ := utils.Blake3Hash(data)

return string(hash)
}

// NScMetric gets the latest challenge IDs from the DB
type NScMetric struct {
Count int
Expand Down Expand Up @@ -232,15 +202,6 @@ type AggregatedScore struct {
UpdatedAt time.Time
}

type AggregatedScoreList []AggregatedScore

func (asl AggregatedScoreList) Hash() string {
data, _ := json.Marshal(asl)
hash, _ := utils.Blake3Hash(data)

return string(hash)
}

type ScoreAggregationEvent struct {
ChallengeID string `db:"challenge_id"`
IsAggregated bool `db:"is_aggregated"`
Expand Down
30 changes: 0 additions & 30 deletions pkg/utils/healthcheckchallenge/health_check_challenge.go

This file was deleted.

30 changes: 0 additions & 30 deletions pkg/utils/storagechallenge/storage_challenge.go

This file was deleted.