Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add permissions for fungible assets operation #14567

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

runtian-zhou
Copy link
Contributor

@runtian-zhou runtian-zhou commented Sep 9, 2024

Description

Implemented permissions for FA transfer.

  • Work with current Coin that already migrated to FA as well.
  • Implemented a new api deposit_with_signer so that permissions can be added to the signer back again.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Added test cases. In particular, tested the entire migration path of Coin and FA.

Key Areas to Review

Make sure FA permission works well throughout the entire migration path of FA.

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Sep 9, 2024

⏱️ 2h 19m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
rust-move-unit-coverage 18m 🟩
rust-move-unit-coverage 15m 🟩
rust-move-unit-coverage 15m 🟩
rust-move-unit-coverage 15m 🟩
check-dynamic-deps 12m 🟩🟩🟩🟩🟩 (+2 more)
general-lints 10m 🟩🟩🟩🟩🟩
rust-move-tests 9m 🟥
rust-move-tests 9m 🟥
rust-cargo-deny 9m 🟩🟩🟩🟩🟩
rust-move-tests 8m 🟥
rust-move-unit-coverage 4m
rust-move-tests 4m
semgrep/ci 4m 🟩🟩🟩🟩🟩 (+5 more)
rust-move-tests 3m 🟥
file_change_determinator 1m 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

runtian-zhou commented Sep 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.1%. Comparing base (7c5a356) to head (bb315dd).

Additional details and impacted files
@@                                 Coverage Diff                                  @@
##           09-04-implement_rust_logics_for_permissioned_signer   #14567   +/-   ##
====================================================================================
  Coverage                                                 60.1%    60.1%           
====================================================================================
  Files                                                      857      857           
  Lines                                                   210762   210762           
====================================================================================
+ Hits                                                    126723   126744   +21     
+ Misses                                                   84039    84018   -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 350db4c to dad258f Compare September 10, 2024 17:25
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from dad258f to 6b4da66 Compare September 10, 2024 17:29
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 6b4da66 to b1fd015 Compare September 12, 2024 01:50
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from b1fd015 to 6592c01 Compare September 17, 2024 05:08
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 6592c01 to 54c34ad Compare September 17, 2024 21:23
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 54c34ad to 1835d3d Compare September 18, 2024 06:22
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 1835d3d to 42decc7 Compare September 18, 2024 17:52
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 42decc7 to 6ac9449 Compare September 19, 2024 00:35
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 6ac9449 to 3ae6a87 Compare September 19, 2024 08:08
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 3ae6a87 to 7fbfa3e Compare October 4, 2024 20:56
@runtian-zhou runtian-zhou force-pushed the 09-04-implement_rust_logics_for_permissioned_signer branch from 7fbfa3e to f3015ce Compare October 5, 2024 01:54
@runtian-zhou runtian-zhou force-pushed the 12-17-feature_gate_permissioned_signer branch from f8c3ecb to d3219e1 Compare January 15, 2025 17:56
@runtian-zhou runtian-zhou changed the base branch from 12-17-feature_gate_permissioned_signer to runtianz/account_perms January 15, 2025 17:58
@runtian-zhou runtian-zhou force-pushed the runtianz/account_perms branch from 3e9ee91 to 6a823bf Compare January 15, 2025 18:26
@igor-aptos igor-aptos added CICD:run-execution-performance-test Run execution performance test CICD:run-execution-performance-full-test Run execution performance test (full version) labels Jan 15, 2025
@runtian-zhou runtian-zhou force-pushed the runtianz/account_perms branch from 9eb6bd0 to 000d361 Compare January 15, 2025 20:46
@runtian-zhou runtian-zhou force-pushed the asset_permission branch 2 times, most recently from 3a6c8a2 to 5522b36 Compare January 15, 2025 21:42
@@ -616,6 +617,7 @@ module aptos_framework::coin {
public entry fun migrate_to_fungible_store<CoinType>(
account: &signer
) acquires CoinStore, CoinConversionMap, CoinInfo {
permissioned_signer::assert_master_signer(account);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this shouldn't require any permissions?

@@ -1016,6 +1019,7 @@ module aptos_framework::coin {
}

public fun register<CoinType>(account: &signer) acquires CoinConversionMap {
permissioned_signer::assert_master_signer(account);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add TODO here to move this to FA Withdraw(0) permission

@runtian-zhou runtian-zhou force-pushed the runtianz/account_perms branch from 3cb1cd0 to 519d733 Compare January 16, 2025 01:23
Base automatically changed from runtianz/account_perms to main January 16, 2025 02:29
@runtian-zhou runtian-zhou enabled auto-merge (squash) January 16, 2025 02:45

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 9b137848277806bd2cdd2b2b129fd6fe4e789a78

two traffics test: inner traffic : committed: 14793.75 txn/s, submitted: 14793.80 txn/s, expired: 0.05 txn/s, latency: 2682.55 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3300 ms), latency samples: 5624920
two traffics test : committed: 99.99 txn/s, latency: 1407.46 ms, (p50: 1300 ms, p70: 1300, p90: 1600 ms, p99: 6600 ms), latency samples: 1700
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.572, avg: 1.445", "ConsensusProposalToOrdered: max: 0.302, avg: 0.291", "ConsensusOrderedToCommit: max: 0.328, avg: 0.319", "ConsensusProposalToCommit: max: 0.620, avg: 0.610"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.20s no progress at version 25425 (avg 0.19s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.56s no progress at version 2887301 (avg 0.56s) [limit 16].
Test Ok

Copy link
Contributor

✅ Forge suite compat success on f69dc31b0f674662b6bfa941dc7eee9ce9035e29 ==> 9b137848277806bd2cdd2b2b129fd6fe4e789a78

Compatibility test results for f69dc31b0f674662b6bfa941dc7eee9ce9035e29 ==> 9b137848277806bd2cdd2b2b129fd6fe4e789a78 (PR)
1. Check liveness of validators at old version: f69dc31b0f674662b6bfa941dc7eee9ce9035e29
compatibility::simple-validator-upgrade::liveness-check : committed: 15823.35 txn/s, latency: 2005.15 ms, (p50: 2000 ms, p70: 2100, p90: 2400 ms, p99: 3300 ms), latency samples: 525180
2. Upgrading first Validator to new version: 9b137848277806bd2cdd2b2b129fd6fe4e789a78
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 4971.00 txn/s, latency: 6221.56 ms, (p50: 7000 ms, p70: 7500, p90: 7800 ms, p99: 7900 ms), latency samples: 99020
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 4967.48 txn/s, latency: 6937.26 ms, (p50: 7700 ms, p70: 7800, p90: 8000 ms, p99: 8100 ms), latency samples: 176080
3. Upgrading rest of first batch to new version: 9b137848277806bd2cdd2b2b129fd6fe4e789a78
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 4834.29 txn/s, latency: 5923.41 ms, (p50: 6100 ms, p70: 7100, p90: 7800 ms, p99: 8100 ms), latency samples: 102740
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 4735.92 txn/s, latency: 7258.29 ms, (p50: 8000 ms, p70: 8100, p90: 8100 ms, p99: 8400 ms), latency samples: 170880
4. upgrading second batch to new version: 9b137848277806bd2cdd2b2b129fd6fe4e789a78
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 9462.45 txn/s, latency: 3234.12 ms, (p50: 3800 ms, p70: 3900, p90: 4000 ms, p99: 4200 ms), latency samples: 166980
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9494.22 txn/s, latency: 3602.01 ms, (p50: 3800 ms, p70: 4000, p90: 4200 ms, p99: 4400 ms), latency samples: 309920
5. check swarm health
Compatibility test for f69dc31b0f674662b6bfa941dc7eee9ce9035e29 ==> 9b137848277806bd2cdd2b2b129fd6fe4e789a78 passed
Test Ok

@runtian-zhou runtian-zhou merged commit 7ecc8ad into main Jan 16, 2025
46 checks passed
@runtian-zhou runtian-zhou deleted the asset_permission branch January 16, 2025 04:34
grao1991 pushed a commit that referenced this pull request Jan 16, 2025
* TMP

* add permissions for fungible assets operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:run-execution-performance-full-test Run execution performance test (full version) CICD:run-execution-performance-test Run execution performance test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants