Skip to content

feat: split audit service and tighten contract safeguards - #1192

Merged
Xoulomon merged 1 commit into
Xoulomon:mainfrom
meetdarc-tech:feature/issue-1084-1111
Aug 30, 2026
Merged

feat: split audit service and tighten contract safeguards#1192
Xoulomon merged 1 commit into
Xoulomon:mainfrom
meetdarc-tech:feature/issue-1084-1111

Conversation

@meetdarc-tech

Copy link
Copy Markdown

Summary

This PR addresses the backend and smart-contract issues identified in the audit service split, admin access-control review, type utility cleanup, and contract upgrade/versioning documentation work.

What changed

Backend audit separation

  • Split the audit service into read-oriented and write-oriented responsibilities to keep query/export/report flows separate from log mutation logic.
  • Kept the shared in-memory store behind a single backing state so read-side and write-side access remain consistent without mixing responsibilities.
  • Clarified the append-only behavior and retention/alert bookkeeping in the write-only layer.

Smart-contract admin safeguards

  • Reviewed privileged function access control and documented the invariant that all admin-only mutations must pass a pre-write admin check.
  • Added explicit non-admin rejection coverage for privileged operations so the contract enforces role boundaries before mutation.

Type utility cleanup

  • Centralized enum conversion helper logic in the utility module and kept the type definitions focused on the actual type declarations.
  • Reduced overlap between conversion helpers and enum definitions while preserving the intended API surface.

Upgrade/versioning clarity

  • Documented the supported upgrade path and state-preserving migration model.
  • Clarified that contract version transitions should preserve existing stored state and reject unsupported or unsafe version changes before applying new implementation metadata.

Why

These changes reduce accidental coupling between read and write concerns, make the admin control model easier to reason about, eliminate duplicated conversion logic, and document the safe upgrade path so future contract changes stay compatible with persisted state.

Scope

This PR is intentionally scoped to the issue areas above and does not widen the project surface beyond the relevant backend and contract modules.

closes #1084
closes #1109
closes #1110
closes #1111

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@meetdarc-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Xoulomon
Xoulomon merged commit 723f11e into Xoulomon:main Aug 30, 2026
1 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants