Skip to content

Commit 68c376c

Browse files
committed
fix: different governed gas pool starting point.
1 parent 1029155 commit 68c376c

File tree

3 files changed

+91
-23
lines changed

3 files changed

+91
-23
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Function `primary_fungible_store_address`](#0x1_governed_gas_pool_primary_fungible_store_address)
1111
- [Function `create_resource_account_seed`](#0x1_governed_gas_pool_create_resource_account_seed)
1212
- [Function `initialize`](#0x1_governed_gas_pool_initialize)
13+
- [Function `init_module`](#0x1_governed_gas_pool_init_module)
1314
- [Function `governed_gas_signer`](#0x1_governed_gas_pool_governed_gas_signer)
1415
- [Function `governed_gas_pool_address`](#0x1_governed_gas_pool_governed_gas_pool_address)
1516
- [Function `fund`](#0x1_governed_gas_pool_fund)
@@ -179,6 +180,34 @@ Initializes the governed gas pool around a resource account creation seed.
179180

180181

181182

183+
</details>
184+
185+
<a id="0x1_governed_gas_pool_init_module"></a>
186+
187+
## Function `init_module`
188+
189+
Initialize the governed gas pool as a module
190+
@param aptos_framework The signer of the aptos_framework module.
191+
192+
193+
<pre><code><b>fun</b> <a href="governed_gas_pool.md#0x1_governed_gas_pool_init_module">init_module</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>)
194+
</code></pre>
195+
196+
197+
198+
<details>
199+
<summary>Implementation</summary>
200+
201+
202+
<pre><code><b>fun</b> <a href="governed_gas_pool.md#0x1_governed_gas_pool_init_module">init_module</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>) {
203+
// Initialize the governed gas pool
204+
<b>let</b> seed : <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt; = b"aptos_framework::governed_gas_pool";
205+
<a href="governed_gas_pool.md#0x1_governed_gas_pool_initialize">initialize</a>(aptos_framework, seed);
206+
}
207+
</code></pre>
208+
209+
210+
182211
</details>
183212

184213
<a id="0x1_governed_gas_pool_governed_gas_signer"></a>

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

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,44 @@
55

66

77

8+
- [Struct `BridgeConfigRelayerUpdated`](#0x1_native_bridge_BridgeConfigRelayerUpdated)
9+
- [Struct `BridgeFeeChangedEvent`](#0x1_native_bridge_BridgeFeeChangedEvent)
10+
- [Struct `BridgeInsuranceBudgetDividerChangedEvent`](#0x1_native_bridge_BridgeInsuranceBudgetDividerChangedEvent)
11+
- [Struct `BridgeInsuranceFundChangedEvent`](#0x1_native_bridge_BridgeInsuranceFundChangedEvent)
12+
- [Struct `BridgeTransferInitiatedEvent`](#0x1_native_bridge_BridgeTransferInitiatedEvent)
13+
- [Struct `BridgeTransferCompletedEvent`](#0x1_native_bridge_BridgeTransferCompletedEvent)
14+
- [Resource `BridgeEvents`](#0x1_native_bridge_BridgeEvents)
815
- [Resource `AptosCoinBurnCapability`](#0x1_native_bridge_AptosCoinBurnCapability)
916
- [Resource `AptosCoinMintCapability`](#0x1_native_bridge_AptosCoinMintCapability)
1017
- [Resource `AptosFABurnCapabilities`](#0x1_native_bridge_AptosFABurnCapabilities)
1118
- [Resource `AptosFAMintCapabilities`](#0x1_native_bridge_AptosFAMintCapabilities)
12-
- [Struct `BridgeTransferInitiatedEvent`](#0x1_native_bridge_BridgeTransferInitiatedEvent)
13-
- [Struct `BridgeTransferCompletedEvent`](#0x1_native_bridge_BridgeTransferCompletedEvent)
14-
- [Resource `BridgeEvents`](#0x1_native_bridge_BridgeEvents)
1519
- [Resource `Nonce`](#0x1_native_bridge_Nonce)
20+
- [Resource `OutboundRateLimitBudget`](#0x1_native_bridge_OutboundRateLimitBudget)
21+
- [Resource `InboundRateLimitBudget`](#0x1_native_bridge_InboundRateLimitBudget)
1622
- [Resource `SmartTableWrapper`](#0x1_native_bridge_SmartTableWrapper)
1723
- [Struct `OutboundTransfer`](#0x1_native_bridge_OutboundTransfer)
1824
- [Resource `BridgeConfig`](#0x1_native_bridge_BridgeConfig)
19-
- [Struct `BridgeConfigRelayerUpdated`](#0x1_native_bridge_BridgeConfigRelayerUpdated)
20-
- [Struct `BridgeFeeChangedEvent`](#0x1_native_bridge_BridgeFeeChangedEvent)
2125
- [Constants](#@Constants_0)
26+
- [Function `initialize`](#0x1_native_bridge_initialize)
2227
- [Function `normalize_u64_to_32_bytes`](#0x1_native_bridge_normalize_u64_to_32_bytes)
2328
- [Function `is_inbound_nonce_set`](#0x1_native_bridge_is_inbound_nonce_set)
2429
- [Function `create_details`](#0x1_native_bridge_create_details)
2530
- [Function `add`](#0x1_native_bridge_add)
2631
- [Function `set_bridge_transfer_id_to_inbound_nonce`](#0x1_native_bridge_set_bridge_transfer_id_to_inbound_nonce)
2732
- [Function `assert_valid_bridge_transfer_id`](#0x1_native_bridge_assert_valid_bridge_transfer_id)
2833
- [Function `bridge_transfer_id`](#0x1_native_bridge_bridge_transfer_id)
34+
- [Function `bridge_relayer`](#0x1_native_bridge_bridge_relayer)
35+
- [Function `insurance_fund`](#0x1_native_bridge_insurance_fund)
36+
- [Function `insurance_budget_divider`](#0x1_native_bridge_insurance_budget_divider)
37+
- [Function `bridge_fee`](#0x1_native_bridge_bridge_fee)
2938
- [Function `get_bridge_transfer_details_from_nonce`](#0x1_native_bridge_get_bridge_transfer_details_from_nonce)
3039
- [Function `get_inbound_nonce_from_bridge_transfer_id`](#0x1_native_bridge_get_inbound_nonce_from_bridge_transfer_id)
3140
- [Function `increment_and_get_nonce`](#0x1_native_bridge_increment_and_get_nonce)
32-
- [Function `initialize`](#0x1_native_bridge_initialize)
3341
- [Function `store_aptos_coin_burn_cap`](#0x1_native_bridge_store_aptos_coin_burn_cap)
3442
- [Function `store_aptos_coin_mint_cap`](#0x1_native_bridge_store_aptos_coin_mint_cap)
43+
- [Function `mint_to`](#0x1_native_bridge_mint_to)
3544
- [Function `mint`](#0x1_native_bridge_mint)
36-
- [Function `mint_from`](#0x1_native_bridge_mint_from)
45+
- [Function `mint_internal`](#0x1_native_bridge_mint_internal)
3746
- [Function `burn_from`](#0x1_native_bridge_burn_from)
3847
- [Function `burn`](#0x1_native_bridge_burn)
3948
- [Function `burn_internal`](#0x1_native_bridge_burn_internal)
@@ -42,9 +51,11 @@
4251
- [Function `charge_bridge_fee`](#0x1_native_bridge_charge_bridge_fee)
4352
- [Function `update_bridge_relayer`](#0x1_native_bridge_update_bridge_relayer)
4453
- [Function `update_bridge_fee`](#0x1_native_bridge_update_bridge_fee)
45-
- [Function `bridge_relayer`](#0x1_native_bridge_bridge_relayer)
46-
- [Function `bridge_fee`](#0x1_native_bridge_bridge_fee)
54+
- [Function `update_insurance_fund`](#0x1_native_bridge_update_insurance_fund)
55+
- [Function `update_insurance_budget_divider`](#0x1_native_bridge_update_insurance_budget_divider)
4756
- [Function `assert_is_caller_relayer`](#0x1_native_bridge_assert_is_caller_relayer)
57+
- [Function `assert_outbound_rate_limit_budget_not_exceeded`](#0x1_native_bridge_assert_outbound_rate_limit_budget_not_exceeded)
58+
- [Function `assert_inbound_rate_limit_budget_not_exceeded`](#0x1_native_bridge_assert_inbound_rate_limit_budget_not_exceeded)
4859
- [Function `test_normalize_u64_to_32_bytes_helper`](#0x1_native_bridge_test_normalize_u64_to_32_bytes_helper)
4960

5061

@@ -1374,6 +1385,36 @@ Stores the mint capability for AptosCoin.
13741385

13751386

13761387

1388+
</details>
1389+
1390+
<a id="0x1_native_bridge_mint_to"></a>
1391+
1392+
## Function `mint_to`
1393+
1394+
Mints a specified amount of AptosCoin to a recipient's address.
1395+
1396+
@param core_resource The signer representing the core resource account.
1397+
@param recipient The address of the recipient to mint coins to.
1398+
@param amount The amount of AptosCoin to mint.
1399+
1400+
1401+
<pre><code><b>public</b> <b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_to">mint_to</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, recipient: <b>address</b>, amount: u64)
1402+
</code></pre>
1403+
1404+
1405+
1406+
<details>
1407+
<summary>Implementation</summary>
1408+
1409+
1410+
<pre><code><b>public</b> <b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_to">mint_to</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, recipient: <b>address</b>, amount: u64) <b>acquires</b> <a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a> {
1411+
<a href="system_addresses.md#0x1_system_addresses_assert_aptos_framework">system_addresses::assert_aptos_framework</a>(aptos_framework);
1412+
<a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(recipient, amount);
1413+
}
1414+
</code></pre>
1415+
1416+
1417+
13771418
</details>
13781419

13791420
<a id="0x1_native_bridge_mint"></a>
@@ -1399,29 +1440,25 @@ Mints a specified amount of AptosCoin to a recipient's address.
13991440
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint">mint</a>(recipient: <b>address</b>, amount: u64) <b>acquires</b> <a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a> {
14001441
<b>assert</b>!(<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_abort_native_bridge_enabled">features::abort_native_bridge_enabled</a>(), <a href="native_bridge.md#0x1_native_bridge_ENATIVE_BRIDGE_NOT_ENABLED">ENATIVE_BRIDGE_NOT_ENABLED</a>);
14011442

1402-
<a href="coin.md#0x1_coin_deposit">coin::deposit</a>(recipient, <a href="coin.md#0x1_coin_mint">coin::mint</a>(
1403-
amount,
1404-
&<b>borrow_global</b>&lt;<a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a>&gt;(@aptos_framework).mint_cap
1405-
));
1443+
<a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(recipient, amount);
14061444
}
14071445
</code></pre>
14081446

14091447

14101448

14111449
</details>
14121450

1413-
<a id="0x1_native_bridge_mint_from"></a>
1451+
<a id="0x1_native_bridge_mint_internal"></a>
14141452

1415-
## Function `mint_from`
1453+
## Function `mint_internal`
14161454

14171455
Mints a specified amount of AptosCoin to a recipient's address.
14181456

1419-
@param core_resource The signer representing the core resource account.
14201457
@param recipient The address of the recipient to mint coins to.
14211458
@param amount The amount of AptosCoin to mint.
14221459

14231460

1424-
<pre><code><b>public</b> <b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_from">mint_from</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, recipient: <b>address</b>, amount: u64)
1461+
<pre><code><b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(recipient: <b>address</b>, amount: u64)
14251462
</code></pre>
14261463

14271464

@@ -1430,9 +1467,11 @@ Mints a specified amount of AptosCoin to a recipient's address.
14301467
<summary>Implementation</summary>
14311468

14321469

1433-
<pre><code><b>public</b> <b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_from">mint_from</a>(aptos_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, recipient: <b>address</b>, amount: u64) <b>acquires</b> <a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a> {
1434-
<a href="system_addresses.md#0x1_system_addresses_assert_aptos_framework">system_addresses::assert_aptos_framework</a>(aptos_framework);
1435-
<a href="native_bridge.md#0x1_native_bridge_mint">mint</a>(recipient, amount);
1470+
<pre><code><b>fun</b> <a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(recipient: <b>address</b>, amount: u64) <b>acquires</b> <a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a> {
1471+
<a href="coin.md#0x1_coin_deposit">coin::deposit</a>(recipient, <a href="coin.md#0x1_coin_mint">coin::mint</a>(
1472+
amount,
1473+
&<b>borrow_global</b>&lt;<a href="native_bridge.md#0x1_native_bridge_AptosCoinMintCapability">AptosCoinMintCapability</a>&gt;(@aptos_framework).mint_cap
1474+
));
14361475
}
14371476
</code></pre>
14381477

@@ -1670,7 +1709,7 @@ Completes a bridge transfer on the destination chain.
16701709
<a href="native_bridge.md#0x1_native_bridge_set_bridge_transfer_id_to_inbound_nonce">set_bridge_transfer_id_to_inbound_nonce</a>(bridge_transfer_id, nonce);
16711710

16721711
// Mint <b>to</b> the recipient
1673-
<a href="native_bridge.md#0x1_native_bridge_mint">mint</a>(recipient, amount);
1712+
<a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(recipient, amount);
16741713

16751714
// Emit the <a href="event.md#0x1_event">event</a>
16761715
<b>let</b> bridge_events = <b>borrow_global_mut</b>&lt;<a href="native_bridge.md#0x1_native_bridge_BridgeEvents">BridgeEvents</a>&gt;(@aptos_framework);
@@ -1716,7 +1755,7 @@ Charge bridge fee to the initiate bridge transfer.
17161755
<b>let</b> bridge_relayer = <a href="native_bridge.md#0x1_native_bridge_bridge_relayer">bridge_relayer</a>();
17171756
<b>assert</b>!(amount &gt; bridge_fee, <a href="native_bridge.md#0x1_native_bridge_EINVALID_AMOUNT">EINVALID_AMOUNT</a>);
17181757
<b>let</b> new_amount = amount - bridge_fee;
1719-
<a href="native_bridge.md#0x1_native_bridge_mint">mint</a>(bridge_relayer, bridge_fee);
1758+
<a href="native_bridge.md#0x1_native_bridge_mint_internal">mint_internal</a>(bridge_relayer, bridge_fee);
17201759
new_amount
17211760
}
17221761
</code></pre>

types/src/on_chain_config/aptos_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl FeatureFlag {
152152
FeatureFlag::CONCURRENT_FUNGIBLE_BALANCE,
153153
FeatureFlag::LIMIT_VM_TYPE_SIZE,
154154
FeatureFlag::ABORT_IF_MULTISIG_PAYLOAD_MISMATCH,
155-
FeatureFlag::GOVERNED_GAS_POOL,
155+
// FeatureFlag::GOVERNED_GAS_POOL, // governed gas pool should be voted in
156156
]
157157
}
158158
}

0 commit comments

Comments
 (0)