Skip to content

Rewrite of delete_records_batch and is_record_locked functions#263

Merged
chrisgitiota merged 5 commits into
chore/security-auditfrom
chore/security-audit-new-delete-records-batch
May 21, 2026
Merged

Rewrite of delete_records_batch and is_record_locked functions#263
chrisgitiota merged 5 commits into
chore/security-auditfrom
chore/security-audit-new-delete-records-batch

Conversation

@chrisgitiota
Copy link
Copy Markdown
Contributor

@chrisgitiota chrisgitiota commented May 19, 2026

  • Rewrite of the delete_records_batch() and is_record_locked() functions.
  • window_count_based(0) is now forbidden in favor of using window_none() instead to prevent silently misconfigured trails.
  • Client-relevant asserts in Move locking are validated in the AT Rust libraries public surface

window_count_based(0) is now forbidden in favor of using window_none() instead to prevent silently misconfigured trails.
@chrisgitiota chrisgitiota requested a review from itsyaasir May 20, 2026 07:32
Comment thread audit-trail-move/sources/locking.move
…surface

New validation added:
  - TimeLock::validate_as_delete_trail_lock() rejects UntilDestroyed.
  - LockingConfig::validate() now also calls the above on delete_trail_lock.
  - TrailLocking::update_delete_trail_lock now returns Result<TransactionBuilder<UpdateDeleteTrailLock>, Error> and validates up front.
  - WASM update_delete_trail_lock propagates the error to JS.
  - Call sites in audit-trail-rs/tests/e2e/locking.rs, examples/audit-trail/04_configure_locking.rs, and examples/audit-trail/real-world/02_clinical_trial.rs updated with ?.

AuditTrailBuilder::finish() and TrailLocking::update(LockingConfig) automatically pick up the new check via LockingConfig::validate() — no signature change needed on those.

The tf_components::timelock module also asserts EPastTimestamp on unlock_at/unlock_at_ms when the timestamp is in the past. I did not mirror that: it depends on the on-chain clock at execution time, so a client-side check
would either be redundant (if the user picks a far-future timestamp) or wrong (if the transaction is built well before submission and a borderline timestamp lapses).
…records-batch' into chore/security-audit-new-delete-records-batch
@chrisgitiota chrisgitiota requested a review from itsyaasir May 20, 2026 15:41
@chrisgitiota chrisgitiota merged commit 901dae0 into chore/security-audit May 21, 2026
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