Skip to content

Commit 5dedd4b

Browse files
Bo Wuareshand
authored andcommitted
fix epoch duration
save progress
1 parent c236c51 commit 5dedd4b

File tree

18 files changed

+1036
-7
lines changed

18 files changed

+1036
-7
lines changed

aptos-move/aptos-release-builder/data/release.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,5 @@ proposals:
1010
description: "This includes changes in https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-vX.YY.Z"
1111
execution_mode: MultiStep
1212
update_sequence:
13-
- Gas:
14-
new: current
15-
# replace with below for actual release, above "current" is needed for compat tests:
16-
# old: https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/gas/vX.WW.Z.json
17-
# new: https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/gas/vX.YY.Z.json
1813
- Framework:
19-
bytecode_version: 7
20-
git_hash: ~
14+
bytecode_version: 6

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ to synchronize configuration changes for the validators.
1717
- [Function `enable_reconfiguration`](#0x1_reconfiguration_enable_reconfiguration)
1818
- [Function `reconfiguration_enabled`](#0x1_reconfiguration_reconfiguration_enabled)
1919
- [Function `reconfigure`](#0x1_reconfiguration_reconfigure)
20+
- [Function `update_configuration`](#0x1_reconfiguration_update_configuration)
2021
- [Function `last_reconfiguration_time`](#0x1_reconfiguration_last_reconfiguration_time)
2122
- [Function `current_epoch`](#0x1_reconfiguration_current_epoch)
2223
- [Function `emit_genesis_reconfiguration_event`](#0x1_reconfiguration_emit_genesis_reconfiguration_event)
@@ -426,6 +427,33 @@ Signal validators to start using new configuration. Must be called from friend c
426427

427428

428429

430+
</details>
431+
432+
<a id="0x1_reconfiguration_update_configuration"></a>
433+
434+
## Function `update_configuration`
435+
436+
437+
438+
<pre><code><b>public</b> <b>fun</b> <a href="reconfiguration.md#0x1_reconfiguration_update_configuration">update_configuration</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, epoch: u64, <a href="timestamp.md#0x1_timestamp">timestamp</a>: u64)
439+
</code></pre>
440+
441+
442+
443+
<details>
444+
<summary>Implementation</summary>
445+
446+
447+
<pre><code><b>public</b> <b>fun</b> <a href="reconfiguration.md#0x1_reconfiguration_update_configuration">update_configuration</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, epoch: u64, <a href="timestamp.md#0x1_timestamp">timestamp</a>: u64) <b>acquires</b> <a href="reconfiguration.md#0x1_reconfiguration_Configuration">Configuration</a> {
448+
<a href="system_addresses.md#0x1_system_addresses_assert_aptos_framework">system_addresses::assert_aptos_framework</a>(aptos_framework);
449+
<b>let</b> conf = <b>borrow_global_mut</b>&lt;<a href="reconfiguration.md#0x1_reconfiguration_Configuration">Configuration</a>&gt;(@aptos_framework);
450+
conf.epoch = epoch;
451+
conf.last_reconfiguration_time = <a href="timestamp.md#0x1_timestamp">timestamp</a>;
452+
}
453+
</code></pre>
454+
455+
456+
429457
</details>
430458

431459
<a id="0x1_reconfiguration_last_reconfiguration_time"></a>

aptos-move/framework/aptos-framework/sources/reconfiguration.move

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ module aptos_framework::reconfiguration {
158158
reconfiguration_state::on_reconfig_finish();
159159
}
160160

161+
public fun update_configuration(aptos_framework: &signer, epoch: u64, timestamp: u64) acquires Configuration {
162+
system_addresses::assert_aptos_framework(aptos_framework);
163+
let conf = borrow_global_mut<Configuration>(@aptos_framework);
164+
conf.epoch = epoch;
165+
conf.last_reconfiguration_time = timestamp;
166+
}
167+
161168
public fun last_reconfiguration_time(): u64 acquires Configuration {
162169
borrow_global<Configuration>(@aptos_framework).last_reconfiguration_time
163170
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "UpdateReconfiguration"
3+
version = "0.0.0"
4+
5+
[dependencies]
6+
AptosFramework = { local = "../../../framework/aptos-framework" }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"title": "Multi-step proposal to upgrade mainnet framework, version vX.YY.Z",
3+
"description": "This includes changes in https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-vX.YY.Z",
4+
"source_code_url": "https://github.com/aptos-labs/aptos-core",
5+
"discussion_url": "https://github.com/aptos-labs/aptos-core"
6+
}

aptos-move/move-examples/scripts/update_reconfiguration/clone_proposals/clone_proposals/sources/vX.YY.Z/proposal_1_upgrade_framework/0-move-stdlib.move

Lines changed: 51 additions & 0 deletions
Large diffs are not rendered by default.

aptos-move/move-examples/scripts/update_reconfiguration/clone_proposals/clone_proposals/sources/vX.YY.Z/proposal_1_upgrade_framework/1-aptos-stdlib.move

Lines changed: 123 additions & 0 deletions
Large diffs are not rendered by default.

aptos-move/move-examples/scripts/update_reconfiguration/clone_proposals/clone_proposals/sources/vX.YY.Z/proposal_1_upgrade_framework/2-aptos-framework.move

Lines changed: 235 additions & 0 deletions
Large diffs are not rendered by default.

aptos-move/move-examples/scripts/update_reconfiguration/clone_proposals/clone_proposals/sources/vX.YY.Z/proposal_1_upgrade_framework/3-aptos-token.move

Lines changed: 33 additions & 0 deletions
Large diffs are not rendered by default.

aptos-move/move-examples/scripts/update_reconfiguration/clone_proposals/clone_proposals/sources/vX.YY.Z/proposal_1_upgrade_framework/4-aptos-token-objects.move

Lines changed: 34 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)