Skip to content

audit: module#268

Merged
mateeullahmalik merged 11 commits intomasterfrom
audit-module
Mar 5, 2026
Merged

audit: module#268
mateeullahmalik merged 11 commits intomasterfrom
audit-module

Conversation

@j-rafique
Copy link
Contributor

No description provided.

@roomote-v0
Copy link

roomote-v0 bot commented Feb 6, 2026

Rooviewer Clock   See task

Reviewed latest changes (069f0c3). This commit is a merge of master into audit-module. The merged-in changes (recovery admin endpoints, DHT batch store error handling, PeersCount guardrail, reseed flow, sn-manager dep cleanup) are already on master and not part of this PR's diff. All previously flagged issues remain resolved. No new issues found in the PR-scoped changes.

  • Case-sensitive proof hash comparison in VerifySliceProof handler could cause false negatives if hex characters arrive in uppercase
  • latestHeight only checks SdkBlock while estimateEpochDuration falls back to Block -- should use the same pattern
  • Synchronous chain transaction (SubmitEvidence) in the supernode retry loop adds latency per failed attempt and could consume the parent context's deadline
  • Mixed indentation in TestHandshakerConcurrentHandshakes -- the for loop header and first few body lines are one tab deeper than the rest of the loop body (gofmt violation)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

roomote-v0[bot]
roomote-v0 bot previously approved these changes Feb 11, 2026
roomote-v0[bot]
roomote-v0 bot previously approved these changes Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates the audit module from the Lumera blockchain (v1.11.0-rc) into the Supernode, introducing epoch-based storage challenge functionality and host reporting capabilities. The changes replace the legacy metrics reporting system with a new audit-driven architecture that submits evidence and epoch reports on-chain.

Changes:

  • Upgraded Lumera dependency from v1.10.0 to v1.11.0-rc across all modules
  • Added audit module integration (query and message modules) to the Lumera client
  • Implemented storage challenge service with deterministic selection, gRPC handlers, and evidence submission
  • Added host reporter service for epoch-scoped reporting (replacing legacy metrics collector)
  • Introduced cascade client failure evidence submission in the SDK

Reviewed changes

Copilot reviewed 46 out of 50 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
go.mod, tests/system/go.mod, sn-manager/go.mod, cmd/sncli/go.mod Bumped lumera dependency to v1.11.0-rc
go.sum, tests/system/go.sum, sn-manager/go.sum, cmd/sncli/go.sum Updated checksums for new lumera version
pkg/lumera/interface.go, pkg/lumera/client.go Added Audit() and AuditMsg() module accessors
pkg/lumera/modules/audit/*.go New audit query module implementation
pkg/lumera/modules/audit_msg/*.go New audit transaction module with evidence/report submission
supernode/storage_challenge/service.go Core storage challenge service with epoch-driven execution
supernode/storage_challenge/README.md Documentation for storage challenge protocol
supernode/transport/grpc/storage_challenge/handler.go gRPC handlers for GetSliceProof and VerifySliceProof
supernode/host_reporter/service.go Epoch report submission with port probing
pkg/storagechallenge/deterministic/*.go Deterministic selection algorithms for challengers/files
supernode/config/*.go, supernode/config.yml Added StorageChallengeConfig with defaults
supernode/cmd/start.go Replaced metrics collector with host reporter and storage challenge services
sdk/task/evidence.go, sdk/adapters/lumera/adapter.go Cascade failure evidence submission
proto/supernode/storage_challenge.proto Protobuf definitions for storage challenge service
gen/supernode/storage_challenge*.go Generated gRPC and protobuf code
pkg/testutil/lumera.go Added mock audit modules to test utilities
tests/integration/securegrpc/secure_connection_test.go Fixed test isolation by moving keyring creation into loop
.github/workflows/*.yml, .github/actions/setup-env/action.yml Commented out bust_lumera_retag parameter
Makefile Added storage_challenge.proto to generation targets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

roomote-v0[bot]
roomote-v0 bot previously approved these changes Feb 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 50 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to +53
start := req.RequestedStart
end := req.RequestedEnd
if end <= start {
start = 0
end = uint64(len(data))
}
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetSliceProof treats an invalid/empty range (requested_end <= requested_start) as a request for the entire file (start=0, end=len(data)). This can unintentionally exfiltrate full file contents and can be abused for large responses/DoS. Consider rejecting invalid ranges (return ok=false + error) or always enforcing a maximum slice length server-side (e.g., clamp to configured max) instead of defaulting to the whole file.

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +127
challenge := types.MessageData{
ChallengerID: req.ChallengerId,
RecipientID: req.RecipientId,
Observers: append([]string(nil), req.ObserverIds...),
Challenge: types.ChallengeData{
FileHash: req.FileKey,
StartIndex: int(req.RequestedStart),
EndIndex: int(req.RequestedEnd),
Timestamp: time.Now().UTC(),
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

persistRecipientProof records RecipientID from the request (req.RecipientId) and stores RequestedStart/RequestedEnd rather than the effective resp.Start/resp.End. Since request fields are caller-controlled, this can lead to spoofed/incorrect persisted records. Prefer using s.identity for the recipient and persisting the actual served range from the response.

Copilot uses AI. Check for mistakes.
roomote-v0[bot]
roomote-v0 bot previously approved these changes Mar 3, 2026
Copy link

@roomote-v0 roomote-v0 bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All previously flagged issues have been resolved. The latest commit (069f0c3) is a merge of master into audit-module with no net new issues in the PR-scoped changes. Approving.

@mateeullahmalik mateeullahmalik merged commit 5517a57 into master Mar 5, 2026
7 checks passed
@mateeullahmalik mateeullahmalik deleted the audit-module branch March 5, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants