Skip to content

[Refactor] Improve fork from old block.#183

Closed
clement-ux wants to merge 2 commits intoclement/refactor-deploymentfrom
clement/improve-governance-tracking
Closed

[Refactor] Improve fork from old block.#183
clement-ux wants to merge 2 commits intoclement/refactor-deploymentfrom
clement/improve-governance-tracking

Conversation

@clement-ux
Copy link
Contributor

@clement-ux clement-ux commented Feb 2, 2026

Summary

Replaces the manual proposalExecuted boolean and maxDeploymentFiles sliding window with automatic, timestamp-based governance tracking in the deployment framework.

  • Split timestamp into timestampDep / timestampGov in the Execution struct and deployment JSON files. timestampGov == 0 means governance is still pending; once confirmed on-chain the timestamp is recorded automatically.
  • Remove proposalExecuted from all deployment scripts (~20 files). Governance completion is now derived from timestampGov instead of requiring a manual boolean flip per script.
  • Remove maxDeploymentFiles sliding window in DeployManager. Instead of only processing the last N scripts, all scripts are iterated and those fully executed (both timestamps set and <= block.timestamp) are skipped via a fast-path check on the filename.
  • Add UpdateGovernance.s.sol (make update-governance), a new CLI tool that forks mainnet, iterates executions with timestampGov == 0, rebuilds their governance proposals, computes proposal IDs, checks on-chain state via IGovernance.state(), and writes updated timestamps back to the deployment JSON.
  • Refactor Resolver: replace executionExists mapping with depTimestamp, govTimestamp, and executionIndex mappings. Add addGovernanceTimestamp() for updating governance state after the fact.
  • Normalize contract names to match filenames (e.g. $003_UpgradeLidoARMMainnetScript -> $003_UpgradeLidoARMScript), enabling the filename-based fast-path skip in DeployManager.
  • Add restoreBlockAndTimestamp modifier on GovHelper.simulate() so governance simulation doesn't permanently alter block.number / block.timestamp.
  • Extract _extractScriptName helper in Base.s.sol (shared by DeployManager and UpdateGovernance).
  • Update deployment JSONs: migrate all executions to the new timestampDep/timestampGov format, add missing contracts (MORPHO_MARKET_ORIGIN, MORPHO_MARKET_ORIGIN_IMPL), update OETH_ARM_IMPL address, delete stale deployments-17000.json (Holesky).

@clement-ux clement-ux changed the base branch from main to clement/refactor-deployment February 2, 2026 15:59
@clement-ux
Copy link
Contributor Author

I'll try something better.

@clement-ux clement-ux closed this Feb 5, 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.

1 participant