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
2 changes: 2 additions & 0 deletions app/proto_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"

actiontypes "github.com/LumeraProtocol/lumera/x/action/v1/types"
audittypes "github.com/LumeraProtocol/lumera/x/audit/v1/types"
supernodetypes "github.com/LumeraProtocol/lumera/x/supernode/v1/types"

"github.com/LumeraProtocol/lumera/internal/protobridge"
Expand All @@ -18,5 +19,6 @@ func init() {
protobridge.RegisterEnum("lumera.action.v1.ActionType", actiontypes.ActionType_value)
protobridge.RegisterEnum("lumera.action.v1.ActionState", actiontypes.ActionState_value)
protobridge.RegisterEnum("lumera.action.v1.HashAlgo", actiontypes.HashAlgo_value)
protobridge.RegisterEnum("lumera.audit.v1.ReporterTrustBand", audittypes.ReporterTrustBand_value)
protobridge.RegisterEnum("lumera.supernode.v1.SuperNodeState", supernodetypes.SuperNodeState_value)
}
16 changes: 16 additions & 0 deletions proto/lumera/audit/v1/audit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,20 @@ message NodeSuspicionState {
uint64 last_updated_epoch = 3;
}

enum ReporterTrustBand {
REPORTER_TRUST_BAND_UNSPECIFIED = 0;
REPORTER_TRUST_BAND_NORMAL = 1;
REPORTER_TRUST_BAND_LOW_TRUST = 2;
REPORTER_TRUST_BAND_CHALLENGER_INELIGIBLE = 3;
}

// ReporterReliabilityState is the persisted storage-truth reporter reliability snapshot.
message ReporterReliabilityState {
string reporter_supernode_account = 1 [(cosmos_proto.scalar) = "cosmos.AccAddressString"];
int64 reliability_score = 2;
uint64 last_updated_epoch = 3;
ReporterTrustBand trust_band = 4;
uint64 contradiction_count = 5;
}

// TicketDeteriorationState is the persisted storage-truth ticket deterioration snapshot.
Expand All @@ -101,6 +110,13 @@ message TicketDeteriorationState {
uint64 active_heal_op_id = 4;
uint64 probation_until_epoch = 5;
uint64 last_heal_epoch = 6;
uint64 last_failure_epoch = 7;
uint32 recent_failure_epoch_count = 8;
uint64 contradiction_count = 9;
string last_target_supernode_account = 10 [(cosmos_proto.scalar) = "cosmos.AccAddressString"];
string last_reporter_supernode_account = 11 [(cosmos_proto.scalar) = "cosmos.AccAddressString"];
StorageProofResultClass last_result_class = 12;
uint64 last_result_epoch = 13;
}

enum HealOpStatus {
Expand Down
4 changes: 4 additions & 0 deletions x/audit/v1/keeper/msg_submit_epoch_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,9 @@ func (m msgServer) SubmitEpochReport(ctx context.Context, req *types.MsgSubmitEp
m.SetStorageChallengeReportIndex(sdkCtx, supernodeAccount, req.EpochId, reporterAccount)
}

if err := m.applyStorageTruthScores(sdkCtx, req.EpochId, reporterAccount, req.StorageProofResults); err != nil {
return nil, err
}

return &types.MsgSubmitEpochReportResponse{}, nil
}
Loading
Loading