Skip to content

feat: implement atomic batch timelock queueing and execution - #1399

Open
ayomhide2-web wants to merge 1 commit into
JSE-ORG:mainfrom
ayomhide2-web:feat/batch-timelock-operations
Open

ayomhide2-web wants to merge 1 commit into
JSE-ORG:mainfrom
ayomhide2-web:feat/batch-timelock-operations

Conversation

@ayomhide2-web

Copy link
Copy Markdown

Summary

Implements batch timelock queueing and execution to allow administrators to perform multiple governance operations atomically within a single transaction.

Changes Made

  • Added the TimelockBatchProposal structure to store multiple timelock operations and their parameter hashes.
  • Added DataKey::TimelockBatchOp(u32) for batch proposal storage.
  • Implemented queue_timelock_batch to queue multiple governance operations.
  • Implemented execute_timelock_batch to execute queued operations sequentially.
  • Ensured all operations satisfy the required timelock delay.
  • Added atomic execution so that if any operation fails, the entire batch is reverted.
  • Added tests covering a fee update and allowlist toggle in a single batch.

Testing

  • cargo test --lib test_admin
  • Verified batch queueing and execution.
  • Confirmed all state updates take effect atomically.
  • Verified that partial failures revert the entire batch.
  • Checked gas limits with 5 batched operations.

Scope

Supports atomic multi-parameter governance updates without changing the existing timelock security requirements.

Closes #1241

Add queue_timelock_batch and execute_timelock_batch so an admin can stage
several privileged changes behind one 24h timelock and apply them atomically.
Each batched parameter set is hashed with the existing proposal-hash scheme and
re-verified at execution, and any failing sub-operation reverts the whole batch.

Closes JSE-ORG#1241

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

Add Batch Timelock Queueing and Execution Interface

2 participants