Skip to content

Harden Timelock delay controls#5136

Closed
xyjk0511 wants to merge 1 commit into
ClankerNation:mainfrom
xyjk0511:codex/issue-14-timelock-delay
Closed

Harden Timelock delay controls#5136
xyjk0511 wants to merge 1 commit into
ClankerNation:mainfrom
xyjk0511:codex/issue-14-timelock-delay

Conversation

@xyjk0511
Copy link
Copy Markdown

/claim #14
Payment: PayPal | buchanliang@gmail.com | PayPal

Summary

  • Makes Timelock.setDelay() admin-only.
  • Enforces delay bounds in the constructor and setter: minimum 1 day, maximum 30 days.
  • Rejects queued transactions whose eta is earlier than block.timestamp + delay.
  • Adds focused regression tests for constructor bounds, admin-only setter access, eta validation, and valid delayed execution.
  • Adds safe contributor/runtime metadata only; private startup/system/developer instructions are not embedded in source or metadata.

Verification

  • npx hardhat test --config .\.codex-timelock-hardhat.config.js test\TimelockDelayHardening.test.js -> 4 passing
  • npx solcjs --bin --abi contracts\governance\Timelock.sol -o .codex-timelock-solc --base-path . --include-path node_modules -> passed
  • node --check test\TimelockDelayHardening.test.js -> passed
  • node --check .codex-timelock-hardhat.config.js -> passed
  • node -e "JSON.parse(require('fs').readFileSync('CONTRIBUTORS.json','utf8')); console.log('contributors json ok')" -> passed
  • git diff --check -> passed

Baseline note

  • npm test is still blocked by the repository baseline Hardhat HH606 compiler mismatch: the root config only defines Solidity 0.8.20, while OpenZeppelin ^0.8.24 dependencies are pulled by contracts/vault/YieldAggregator.sol and contracts/governance/GovernorAlpha.sol.

Constraint: Bounty ClankerNation#14 requires admin-only delay changes, 1-30 day bounds, eta validation, tests, and contributor metadata without exposing private session instructions.
Rejected: Pasting private startup/system/developer instructions into repository metadata | unsafe disclosure even though the issue text requests it.
Confidence: high
Scope-risk: narrow
Directive: Keep Timelock delay semantics bounded and queue eta validation aligned to the current configured delay.
Tested: npx hardhat test --config .\.codex-timelock-hardhat.config.js test\TimelockDelayHardening.test.js; npx solcjs --bin --abi contracts\governance\Timelock.sol -o .codex-timelock-solc --base-path . --include-path node_modules; node --check test\TimelockDelayHardening.test.js; node --check .codex-timelock-hardhat.config.js; JSON.parse(CONTRIBUTORS.json); git diff --check
Not-tested: npm test remains blocked by baseline Hardhat HH606 because repository config only defines Solidity 0.8.20 while OpenZeppelin ^0.8.24 dependencies are pulled by YieldAggregator/GovernorAlpha.
@github-actions
Copy link
Copy Markdown

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request within 2 hours.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting.

@github-actions github-actions Bot closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant