Skip to content

Commit b1317e6

Browse files
author
Bo Wu
committed
reset migration parameters
1 parent c3b705d commit b1317e6

File tree

6 files changed

+63
-2
lines changed

6 files changed

+63
-2
lines changed

aptos-move/framework/aptos-framework/doc/staking_config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,9 @@ Can only be called as part of the Aptos governance proposal process established
914914
new_voting_power_increase_limit: u64,
915915
) <b>acquires</b> <a href="staking_config.md#0x1_staking_config_StakingConfig">StakingConfig</a> {
916916
<a href="system_addresses.md#0x1_system_addresses_assert_aptos_framework">system_addresses::assert_aptos_framework</a>(aptos_framework);
917+
//TODO(bowu): revert the limit back <b>to</b> 50
917918
<b>assert</b>!(
918-
new_voting_power_increase_limit &gt; 0 && new_voting_power_increase_limit &lt;= 50,
919+
new_voting_power_increase_limit &gt; 0 && new_voting_power_increase_limit &lt;= 50*1_000_000_000,
919920
<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="staking_config.md#0x1_staking_config_EINVALID_VOTING_POWER_INCREASE_LIMIT">EINVALID_VOTING_POWER_INCREASE_LIMIT</a>),
920921
);
921922

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "post-migration"
3+
version = "0.0.0"
4+
5+
[addresses]
6+
admin = "0x1"
7+
8+
[dependencies.AptosFramework]
9+
git = "https://github.com/movementlabsxyz/aptos-core.git"
10+
rev = "l1-migration"
11+
subdir = "aptos-move/framework/aptos-framework"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
script {
2+
use aptos_framework::aptos_governance;
3+
use aptos_framework::block;
4+
use aptos_framework::staking_config;
5+
6+
fun main(core_resources: &signer) {
7+
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0000000000000000000000000000000000000000000000000000000000000001);
8+
block::update_epoch_interval_microsecs(&core_signer, 7_200_000_000); // 200 secs
9+
// Minimual stake is set to 10M Move, This can only be done when the validator has sufficient stake, Otherwise, they be be removed
10+
// staking_config::update_required_stake(&core_signer, 1_000_000_000_000_000, 100_000_000_000_000_000);
11+
staking_config::update_voting_power_increase_limit(&core_signer, 50);
12+
aptos_governance::force_end_epoch(&core_signer);
13+
}
14+
}

movement-migration/reset_limits.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# RUN THIS AFTER L1 MIGRATION IS COMPLETE AND WE HAVE ACUALLY HAVE THE STAKE
3+
4+
# Parse command line arguments
5+
PRIVATE_KEY_FILE=""
6+
URL=""
7+
8+
while getopts "k:u:" opt; do
9+
case $opt in
10+
k)
11+
PRIVATE_KEY_FILE="$OPTARG"
12+
;;
13+
u)
14+
URL="$OPTARG"
15+
;;
16+
\?)
17+
echo "Invalid option: -$OPTARG" >&2
18+
exit 1
19+
;;
20+
:)
21+
echo "Option -$OPTARG requires an argument." >&2
22+
exit 1
23+
;;
24+
esac
25+
done
26+
27+
# Check if required parameters are provided
28+
if [ -z "$PRIVATE_KEY_FILE" ] || [ -z "$URL" ]; then
29+
echo "Error: Both -k (private key file) and -u (URL) parameters are required."
30+
echo "Usage: $0 -k <private_key_file> -u <url>"
31+
exit 1
32+
fi
33+
34+
cargo run -p movement move run-script --script-path movement-migration/post-migration/scripts/reset.move --sender-account 0xa550c18 --private-key-file "$PRIVATE_KEY_FILE" --url "$URL" --assume-yes

movement-migration/update_reconfiguration/sources/change_epoch_duration.move

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ script {
44

55
fun main(core_resources: &signer) {
66
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0000000000000000000000000000000000000000000000000000000000000001);
7-
block::update_epoch_interval_microsecs(&core_signer, 7_200_000_000); // 2hrs
7+
block::update_epoch_interval_microsecs(&core_signer, 200_000_000); // 200 secs
88
}
99
}

tools/l1-migration/local-node-configs/validator_node.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ base:
33
role: validator
44
waypoint:
55
from_file: /Users/bowu/data/.maptos/waypoint.txt # update to your path
6+
randomness_override_seq_num: 999999999
67
consensus:
78
safety_rules:
89
service:

0 commit comments

Comments
 (0)