feat: post merge upgrade#1214
Conversation
Co-authored-by: Andy Golay <andygolay@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new release module for pre-L1-merge along with associated migrations and tooling for upgrading the Aptos framework. Key changes include:
- The addition of the pre-L1-merge release module with gas upgrade and MRB build script generation.
- New migration modules to transition between release versions, including biarritz-rc1-to-pre-l1-merge and pre-l1-merge-to-post-l1-merge.
- Updates to the Cargo.toml file and process-compose files to integrate the new release and migration workflows.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| protocol-units/execution/maptos/framework/releases/pre-l1-merge/src/lib.rs | Introduces gas upgrade module generation and commit hash-based build script generation. |
| protocol-units/execution/maptos/framework/releases/pre-l1-merge/src/cached.rs | Adds MRB release handling and gas upgrade configuration with an additional macro usage. |
| protocol-units/execution/maptos/framework/releases/pre-l1-merge/build.rs | Provides a build script for generating Elsa’s build assets. |
| protocol-units/execution/maptos/framework/migrations/pre-l1-merge-to-post-l1-merge/ | Creates migration utilities to transition from pre-L1-merge to post-L1-merge modules. |
| protocol-units/execution/maptos/framework/migrations/biarritz-rc1-to-pre-l1-merge/ | Adds migration code to facilitate the upgrade from biarritz-rc1 to pre-L1-merge. |
| process-compose/movement-full-node/process-compose.test-migrate-biarritz-rc1-to-pre-l1-merge.yml | Updates process compose configuration for testing the new migration flow. |
| Cargo.toml | Integrates the new pre-L1-merge release into the workspace dependencies. |
Comments suppressed due to low confidence (3)
protocol-units/execution/maptos/framework/releases/pre-l1-merge/src/cached.rs:4
- [nitpick] The identifier 'BIARRTIZ_RC1' appears to be misspelled. Consider renaming it to 'BiarritzRc1' for consistency with other references.
mrb_release!(PreL1Merge, BIARRTIZ_RC1, "d00f5e5ef3179919b3fc8245ac774f8509ed6a3e-biarritz-rc1.mrb");
protocol-units/execution/maptos/framework/migrations/pre-l1-merge-to-post-l1-merge/src/dot_movement.rs:40
- [nitpick] The comment references a migration from Elsa to Biarritz RC1, which is inconsistent with the pre-L1-merge to post-L1-merge migration context. Please update the comment to accurately reflect the intended migration path.
// migrate the framework from Elsa to Biarritz RC1
protocol-units/execution/maptos/framework/migrations/biarritz-rc1-to-pre-l1-merge/src/lib.rs:19
- [nitpick] The TODO comment mentions validating that the current release is Elsa, which may be outdated or incorrect in this context. Consider updating the comment to clarify the correct release criteria.
// todo: validate that the current release is Elsa
…m/movementlabsxyz/movement into andygolay/framework-upgrade-tests
…to andygolay/framework-upgrade-tests
|
@0xmovses locally I got
and see the same in CI as well. |
|
@andygolay ah sorry still im draft. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a full on-chain governance flow for the Post-L1-Merge feature flags (notably DECOMMISSION_CORE_RESOURCES), adds support for a partial-voting feature, and wires up CI to run the post-merge migration.
- Introduces
propose_post_l1_merge_with_full_governanceandPROPOSAL_SCRIPTSfor on-chain feature-flag proposals. - Adds
execution_hashto the feature-flags release bundle to ensure proposal immutability. - Updates migration modules and CI configuration to support end-to-end Post-L1-Merge upgrades.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| protocol-units/execution/maptos/framework/releases/post-l1-merge/src/vote.rs | Adds governance proposal builder, partial/full voting functions, and tests |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/src/tests/vote.data/enable_partial_governance_voting/sources/main.move | Move script to enable partial governance voting |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/src/tests/vote.data/enable_partial_governance_voting/Move.toml | Defines the Move package for partial voting script |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/src/lib.rs | Registers cached and vote modules and commit-hash macros |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/src/cached.rs | Sets up MRB release and empty script stub |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/build.rs | Adds commit_hash_with_script! for the release tool |
| protocol-units/execution/maptos/framework/releases/post-l1-merge/Cargo.toml | Introduces the post-l1-merge release crate |
| protocol-units/execution/maptos/framework/releases/feature-flags/src/lib.rs | Implements execution_hash for feature-flag proposals |
| protocol-units/execution/maptos/framework/migrations/pre-l1-merge-to-post-l1-merge/src/lib.rs | Defines the Post-L1-Merge migration struct and errors |
| protocol-units/execution/maptos/framework/migrations/pre-l1-merge-to-post-l1-merge/src/dot_movement.rs | Integrates the migration into the DotMovement CLI |
| process-compose/movement-full-node/process-compose.test-migrate-post-l1-merge.yml | Adds a process for running the migration test |
| Cargo.toml | Adds aptos-framework-post-l1-merge-release to the workspace and updates Aptos dependency revisions |
Comments suppressed due to low confidence (3)
protocol-units/execution/maptos/framework/migrations/pre-l1-merge-to-post-l1-merge/src/lib.rs:41
- The method name suggests migrating from Biarritz RC1 to PreL1Merge, but the trait and doc comment indicate migrating from PreL1Merge to PostL1Merge; consider renaming to
migrate_framework_from_pre_l1_merge_to_post_l1_mergefor clarity.
fn migrate_framework_from_biarritza_rc1_to_pre_l1_merge(
process-compose/movement-full-node/process-compose.test-migrate-post-l1-merge.yml:11
- The process identifier
test-migrate-pre-to-post-l1-mergedoes not match the filenameprocess-compose.test-migrate-post-l1-merge.yml; aligning these names can reduce confusion.
test-migrate-pre-to-post-l1-merge:
protocol-units/execution/maptos/framework/releases/post-l1-merge/src/cached.rs:37
- [nitpick] The
mainfunction in the generated script is empty—consider adding a comment or a TODO explaining why it's intentionally blank or what should be implemented here.
fun main(core_resources: &signer) {
|
Shouldn't we call update_governance_config() with reasonable governance parameters? Or will this occur later? |
| Ok(vec![signed_transaction]) | ||
| } | ||
|
|
||
| pub fn execution_hash(&self) -> Result<Vec<u8>, ReleaseBundleError> { |
There was a problem hiding this comment.
Within Aptos governance, the means of computing and verifying the execution_hash are not quite so straightforward:
- https://github.com/movementlabsxyz/aptos-core/blob/1892d2017f4e31ed5bb18caf49ba282d5c9cbce8/crates/aptos/src/governance/mod.rs#L132
- https://github.com/movementlabsxyz/aptos-core/blob/1892d2017f4e31ed5bb18caf49ba282d5c9cbce8/crates/aptos/src/governance/mod.rs#L1035
- https://github.com/movementlabsxyz/aptos-core/blob/1892d2017f4e31ed5bb18caf49ba282d5c9cbce8/aptos-move/aptos-release-builder/src/components/mod.rs#L760

Summary
protocol-units,networks,scripts,util,cicd, ormisc.Description
This PR implements a full on-chain governance flow for the Post-L1-Merge feature flags (notably
DECOMMISSION_CORE_RESOURCES), adds support for a partial-voting feature, and wires up CI to run the post-merge migration.propose_post_l1_merge_with_full_governanceandPROPOSAL_SCRIPTSfor on-chain feature-flag proposals.execution_hashto the feature-flags release bundle to ensure proposal immutability.Changelog
Show a summary per file
cachedandvotemodules and commit-hash macroscommit_hash_with_script!for the release toolexecution_hashfor feature-flag proposalsaptos-framework-post-l1-merge-releaseto the workspace and updates Aptos dependency revisionsTesting
🧠 Overview
This PR introduces a fully on-chain governance flow to propose and activate feature flags — specifically targeting the
DECOMMISSION_CORE_RESOURCESfeature — without relying on the core_resources signer. This replaces the macro-based fast-path that usedcore_resourcesto directly sign proposals.🧱 Full Governance Flow
The flow implemented in
propose_post_l1_merge_with_full_governancedoes the following:Construct the Feature Flags Proposal
SetFeatureFlags<PostL1Merge>wrapper using the existing release logic.Featuresstruct with the desired feature flags (e.g.,DECOMMISSION_CORE_RESOURCES).execution_hashusingsha2::Sha256.Submit a Governance Proposal
create_proposal_v2transaction using a validator's stake pool address.Live Chain Integration
rest_client).LocalAccount) from themaptos_configto sign and submit the transaction.🗳 Why This Matters
core_resourcesis inactive, enabling governance upgrades on a live, decentralized network.✅ Example Usage
Partial Voting Mechanism test
This test verifies the behavior of the partial voting mechanism in the on-chain governance system.
It simulates the following:
Initial Setup
Proposal Creation & Pre-Upgrade Voting
proposal_id = 0).voting_powerargument is ignored, and validator 1 uses their full voting power.Enable Partial Voting
New Proposal & Edge Case Handling
proposal_id = 1).Partial Voting Behavior