Skip to content

Audit Module#99

Open
mateeullahmalik wants to merge 19 commits intomasterfrom
audit-v1
Open

Audit Module#99
mateeullahmalik wants to merge 19 commits intomasterfrom
audit-v1

Conversation

@mateeullahmalik
Copy link
Contributor

No description provided.

@roomote
Copy link

roomote bot commented Feb 4, 2026

Rooviewer Clock   See task

Reviewed commit 04a0235 (since last review at 2861200). Changes are variable renames for clarity (expectedFinalizerAddresses -> top10ValidatorAddresses) and removal of unused parameters from recordFinalizationEvidence. No logic changes.

Summary:

  • No issues found
Previous reviews

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

roomote[bot]
roomote bot previously approved these changes Feb 4, 2026
roomote[bot]
roomote bot previously approved these changes Feb 6, 2026
roomote[bot]
roomote bot previously approved these changes Feb 9, 2026
roomote[bot]
roomote bot previously approved these changes Feb 11, 2026
@mateeullahmalik mateeullahmalik changed the title Audit v1 Audit Module Feb 11, 2026
roomote[bot]
roomote bot previously approved these changes Feb 11, 2026
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thorough re-review of the full audit module implementation. Code is well-structured, follows Cosmos SDK conventions, and includes proper defensive programming throughout. Epoch math, enforcement logic, evidence system, pruning, genesis handling, upgrade handler, and action module integration all look solid. No issues found.

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

Introduces a new x/audit/v1 Cosmos-SDK module to anchor epochs, accept per-epoch supernode reports, store/query evidence, and enforce epoch-end postponement/recovery—while wiring it into the app (depinject + upgrade) and integrating audit evidence emission from the action module.

Changes:

  • Add x/audit/v1 module (types, keeper, ABCI hooks, queries/msgs, pruning, simulation, docs, tests).
  • Extend supernode state transitions to support POSTPONED/recovery and start recording postponement reasons in state records.
  • Integrate the action module with the audit keeper to emit evidence on finalization rejections and action expiration; add v1.11.0 upgrade wiring for the new store/module.

Reviewed changes

Copilot reviewed 115 out of 117 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
x/supernode/v1/types/expected_keepers.go Extend Supernode keeper interface with postponed/recovery methods.
x/supernode/v1/mocks/expected_keepers_mock.go Regenerate mocks for new Supernode keeper methods.
x/supernode/v1/keeper/supernode.go Implement postponed + recovery transitions in supernode keeper.
x/supernode/v1/keeper/metrics_state.go Persist postponement reason in SuperNodeStateRecord.
x/supernode/v1/keeper/abci.go Remove metrics staleness enforcement from supernode EndBlocker.
x/audit/v1/types/keys.go Define audit module store keys/prefix layout.
x/audit/v1/types/genesis.go Define audit consensus version + default genesis helpers.
x/audit/v1/types/expected_keepers.go Add expected keepers for simulation (auth/bank).
x/audit/v1/types/errors.go Register audit module error codes.
x/audit/v1/types/codec.go Register audit Msg interfaces + service desc.
x/audit/v1/simulation/submit_evidence.go Simulation no-op for evidence submission.
x/audit/v1/module/simulation.go Wire module simulation ops/genesis.
x/audit/v1/module/module.pb.go Generated module config protobuf output.
x/audit/v1/module/module.go AppModule wiring (services, genesis, begin/end blockers).
x/audit/v1/module/genesis.go Module-level Init/Export genesis glue.
x/audit/v1/module/depinject.go Depinject provider wiring for audit keeper/module.
x/audit/v1/module/autocli.go AutoCLI descriptors for audit queries/txs.
x/audit/v1/keeper/store.go Helper to open audit KV store.
x/audit/v1/keeper/storage_challenge_evidence_test.go Tests for SC challenger authorization rules.
x/audit/v1/keeper/storage_challenge_deterministic.go Deterministic SC challenger selection helpers.
x/audit/v1/keeper/state.go Report CRUD + indices setters.
x/audit/v1/keeper/query_storage_challenge_reports.go Query server for storage-challenge reports.
x/audit/v1/keeper/query_params_test.go Params query test.
x/audit/v1/keeper/query_params.go Query params handler.
x/audit/v1/keeper/query_host_reports.go Query server for host reports.
x/audit/v1/keeper/query_evidence.go Queries for evidence by id/subject/action.
x/audit/v1/keeper/query_epoch_reports_by_reporter.go Query reports-by-reporter with pagination/filtering.
x/audit/v1/keeper/query_epoch_report.go Query single epoch report.
x/audit/v1/keeper/query_epoch_anchor.go Query epoch anchor by id.
x/audit/v1/keeper/query_current_epoch_anchor.go Query current epoch anchor.
x/audit/v1/keeper/query_current_epoch.go Query current derived epoch boundaries.
x/audit/v1/keeper/query_assigned_targets.go Query deterministic assigned targets for a reporter.
x/audit/v1/keeper/query.go Query server scaffold.
x/audit/v1/keeper/prune.go Prune epoch-scoped state by epoch window.
x/audit/v1/keeper/params.go Store/get audit params with defaults applied.
x/audit/v1/keeper/msg_update_params_test.go Test governance param update constraints.
x/audit/v1/keeper/msg_update_params.go MsgUpdateParams handler + immutability checks.
x/audit/v1/keeper/msg_submit_evidence.go MsgSubmitEvidence handler (reject reserved types).
x/audit/v1/keeper/msg_submit_epoch_report_test.go Tests for epoch report validation rules.
x/audit/v1/keeper/msg_submit_epoch_report.go MsgSubmitEpochReport validation + persistence + indices.
x/audit/v1/keeper/msg_server.go Msg server scaffold.
x/audit/v1/keeper/keeper.go Audit keeper definition + authority/logger.
x/audit/v1/keeper/genesis_test.go Genesis round-trip tests.
x/audit/v1/keeper/genesis.go Keeper Init/Export genesis implementation.
x/audit/v1/keeper/fixture_test.go Test fixture wiring with mock supernode keeper.
x/audit/v1/keeper/evidence_test.go Evidence creation + query tests.
x/audit/v1/keeper/evidence_state.go Evidence storage, indices, next-id management.
x/audit/v1/keeper/evidence_epoch_count.go Per-epoch evidence counters for enforcement.
x/audit/v1/keeper/evidence.go Evidence creation/validation + metadata JSON->proto.
x/audit/v1/keeper/epoch_params_snapshot.go Per-epoch params snapshot storage.
x/audit/v1/keeper/epoch_math.go Deterministic height<->epoch math helpers.
x/audit/v1/keeper/epoch_anchor.go Epoch anchor creation + seed/commitments.
x/audit/v1/keeper/enforcement_test.go Tests for epoch-end peer port threshold logic.
x/audit/v1/keeper/audit_peer_assignment.go Deterministic peer-target assignment algorithm.
x/audit/v1/keeper/action_finalization_postponement_state.go Store action-finalization postponement state.
x/audit/v1/keeper/abci.go Audit Begin/EndBlocker: anchoring + enforcement + pruning.
x/audit/v1/README.md Audit module spec/documentation.
x/audit/v1/POSTPONEMENT_RULES.md Detailed postpone/recovery rules documentation.
x/action/v1/types/expected_keepers.go Add AuditKeeper expected interface for action module.
x/action/v1/types/events.go Add finalization-rejected event + attributes (finalizer/evidence_id).
x/action/v1/module/depinject.go Wire audit keeper dependency into action module.
x/action/v1/keeper/msg_server_test.go Adjust cascade finalization test helper semantics.
x/action/v1/keeper/msg_server_finalize_test.go Update tests for non-fatal cascade finalization rejections.
x/action/v1/keeper/keeper_test.go Track injected mock audit keeper in tests.
x/action/v1/keeper/keeper.go Store audit keeper on action keeper + accessor.
x/action/v1/keeper/expiration_test.go Fix gomock controller lifecycle + expectation counts.
x/action/v1/keeper/audit_evidence.go Add action->audit evidence emission helpers + rejection event emission.
x/action/v1/keeper/action_test.go Extend finalize tests to assert evidence emission behaviors.
x/action/v1/keeper/action_cascade.go Treat invalid cascade IDs as rejection (evidence + no error).
x/action/v1/keeper/action.go Replace validateSupernode with checkFinalizerEligibility; emit audit evidence on expiration.
x/action/v1/keeper/abci_test.go Update EndBlocker test expectations due to audit integration.
testutil/keeper/action.go Add MockAuditKeeper and inject it into action keeper tests.
tests/systemtests/supernode_utils.go Import ordering cleanup.
tests/systemtests/supernode_params_test.go Narrow system test build tag.
tests/systemtests/supernode_metrics_test.go Narrow system test build tag.
tests/systemtests/supernode_metrics_staleness_test.go Narrow system test build tag.
tests/systemtests/register_supernode_test.go Narrow system test build tag + import ordering/formatting.
tests/systemtests/get_top_supernodes_test.go Narrow system test build tag.
tests/systemtests/audit_submit_and_query_test.go New system test: submit epoch report + query.
tests/systemtests/audit_recovery_enforcement_test.go New system test: postponed->active recovery path.
tests/systemtests/audit_postponed_reporter_self_only_test.go New system test: postponed reporter host-only restriction.
tests/systemtests/audit_peer_ports_enforcement_test.go New system test: peer ports postponement via consecutive windows.
tests/systemtests/audit_peer_observation_completeness_test.go New system test: prober must submit all observations.
tests/systemtests/audit_missing_report_enforcement_test.go New system test: missing-report postponement.
tests/systemtests/audit_host_requirements_enforcement_test.go New system test: host requirements with thresholds disabled.
tests/systemtests/audit_host_requirements_bypass_test.go New system test: usage=0 bypasses host minimums.
proto/lumera/supernode/v1/supernode_state.proto Add reason field to state record proto.
proto/lumera/audit/v1/tx.proto Add audit tx service + messages.
proto/lumera/audit/v1/query.proto Add audit query service + request/response messages.
proto/lumera/audit/v1/params.proto Define audit module params proto.
proto/lumera/audit/v1/genesis.proto Define audit genesis state proto.
proto/lumera/audit/v1/evidence_metadata.proto Define evidence metadata protos (action + SC + cascade failure).
proto/lumera/audit/v1/evidence.proto Define evidence record + type enum.
proto/lumera/audit/v1/epoch.proto Define epoch anchor proto.
proto/lumera/audit/v1/audit.proto Define host report + observations + epoch report protos.
proto/lumera/audit/module/v1/module.proto Add app module config proto for audit module.
config.yml Adjust claim total_claimable_amount.
app/upgrades/v1_11_0/upgrade.go New upgrade handler to add audit store + initialize params/anchor.
app/upgrades/upgrades_test.go Register v1.11.0 upgrade + store upgrade expectations.
app/upgrades/upgrades.go Register v1.11.0 upgrade config.
app/upgrades/params/params.go Add audit keeper to upgrade params struct.
app/app_config.go Add audit module to init/genesis/begin/end ordering and module list.
app/app.go Declare audit keeper on app, wire depinject + upgrades params.

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

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.

2 participants

Comments