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

Create benchmark #14916

Open
wants to merge 1 commit into
base: 09-11-permission_for_framework
Choose a base branch
from

Conversation

runtian-zhou
Copy link
Contributor

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

Description

Added new transaction types for APT token transfers, including a permissioned transfer option that uses the permissioned signer framework. This enables both standard APT transfers and permissioned transfers through the transaction generator and e2e benchmark framework.

How Has This Been Tested?

The functionality is integrated into the existing e2e benchmark framework and transaction generator test infrastructure. The new transfer types are added to the test suite alongside other transaction types.

Key Areas to Review

  • New Move module permissioned_transfer.move implementing both standard and permissioned transfer functions
  • Integration of new transaction types into the entry points enum and transaction type arguments
  • Permissioned transfer implementation using the permissioned signer framework

Type of Change

  • New feature
  • Tests

Which Components or Systems Does This Change Impact?

  • Testing Infrastructure

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Oct 9, 2024

⏱️ 1h 59m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
rust-targeted-unit-tests 24m 🟥
rust-move-tests 11m 🟩
check-dynamic-deps 10m 🟩🟩🟩🟩🟩 (+2 more)
rust-cargo-deny 10m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 10m 🟥
rust-move-tests 10m 🟩
rust-move-tests 10m 🟩
rust-move-tests 10m 🟥
rust-move-tests 10m 🟩
file_change_determinator 5m 🟩🟩🟩🟩🟥 (+1 more)
rust-lints 4m 🟥
general-lints 3m 🟩🟩🟩🟩🟩 (+1 more)
semgrep/ci 2m 🟩🟩🟩🟩🟩 (+1 more)
rust-check-merge-base 1m 🟩
permission-check 21s 🟩🟩🟩🟩🟩 (+1 more)

🚨 2 jobs on the last run were significantly faster/slower than expected

Job Duration vs 7d avg Delta
file_change_determinator 4m 11s +1821%
check-dynamic-deps 4m 1m +204%

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

runtian-zhou commented Oct 9, 2024

@runtian-zhou runtian-zhou mentioned this pull request Oct 9, 2024
21 tasks
@rahxephon89 rahxephon89 force-pushed the 09-11-permission_for_framework branch from 43f2715 to d468098 Compare October 9, 2024 21:45
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from d468098 to 43f2715 Compare October 9, 2024 21:48
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch 3 times, most recently from 6c002e4 to 44e71be Compare October 9, 2024 23:23
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 43f2715 to e036793 Compare October 15, 2024 19:04
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 44e71be to 9161080 Compare October 15, 2024 19:04
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from e036793 to e4239a8 Compare October 15, 2024 20:05
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 9161080 to b728e81 Compare October 15, 2024 20:06
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from e4239a8 to d92055d Compare November 15, 2024 20:31
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch 2 times, most recently from ef3c832 to e2fcd91 Compare November 18, 2024 21:33
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from d92055d to 881aa71 Compare November 18, 2024 21:56
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from e2fcd91 to 4caabaf Compare November 18, 2024 21:56
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 881aa71 to e569dd2 Compare November 18, 2024 22:01
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 4caabaf to e5d6e5d Compare November 18, 2024 22:01
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from e569dd2 to 7723f05 Compare November 18, 2024 22:18
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from e5d6e5d to bf6221c Compare November 18, 2024 22:18
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 7723f05 to 54bc94c Compare November 19, 2024 18:13
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from bf6221c to 115f8f6 Compare November 19, 2024 18:13
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 54bc94c to 5d15334 Compare November 19, 2024 18:39
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 115f8f6 to 124c67e Compare November 19, 2024 18:39
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from e91028e to cab9176 Compare January 12, 2025 23:48
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 06c7b2f to 0b04c34 Compare January 12, 2025 23:48
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from cab9176 to 0e33483 Compare January 13, 2025 04:37
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 0b04c34 to 701bd90 Compare January 13, 2025 04:37
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 0e33483 to f80ad5e Compare January 13, 2025 04:40
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 701bd90 to dc45a68 Compare January 13, 2025 04:40
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from f80ad5e to 75b275e Compare January 13, 2025 05:57
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from dc45a68 to 9f4c26b Compare January 13, 2025 05:57
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 75b275e to 50837c1 Compare January 13, 2025 19:07
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 9f4c26b to fa00b2b Compare January 13, 2025 19:07
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 50837c1 to b4f375d Compare January 13, 2025 20:21
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from fa00b2b to afcf6ee Compare January 13, 2025 20:21
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from b4f375d to 346b2f0 Compare January 13, 2025 20:30
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from afcf6ee to 3945d58 Compare January 13, 2025 20:31
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 346b2f0 to a58773f Compare January 13, 2025 21:19
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 3945d58 to 9ea22ad Compare January 13, 2025 21:19
Comment on lines +7 to +17
public entry fun transfer_permissioned(
source: &signer, to: address, amount: u64
) {
let handle = permissioned_signer::create_permissioned_handle(source);
let permissioned_signer = permissioned_signer::signer_from_permissioned_handle(&handle);

primary_fungible_store::grant_apt_permission(source, &permissioned_signer, amount);
aptos_account::transfer(&permissioned_signer, to, amount);

permissioned_signer::destroy_permissioned_handle(handle);
}
Copy link

Choose a reason for hiding this comment

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

The transfer_permissioned function needs error handling around grant_apt_permission to prevent resource leaks. If permission granting fails, the handle created by create_permissioned_handle will not be properly cleaned up. Consider wrapping the permission and transfer operations in a let-else block to ensure destroy_permissioned_handle is called in both success and failure paths.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from a58773f to 689b0bb Compare January 13, 2025 21:44
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 9ea22ad to b5759d6 Compare January 13, 2025 21:44
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 689b0bb to da313b3 Compare January 13, 2025 22:26
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from b5759d6 to 7afaedc Compare January 13, 2025 22:26
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from da313b3 to e51b1d4 Compare January 13, 2025 23:12
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 7afaedc to 2a0df61 Compare January 13, 2025 23:12
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from e51b1d4 to 8475fe6 Compare January 14, 2025 00:24
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from 2a0df61 to a94f57b Compare January 14, 2025 00:24
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 8475fe6 to 74b326f Compare January 14, 2025 04:13
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from a94f57b to b8c8238 Compare January 14, 2025 04:13
@runtian-zhou runtian-zhou force-pushed the 09-11-permission_for_framework branch from 74b326f to 28c320c Compare January 14, 2025 16:00
@runtian-zhou runtian-zhou force-pushed the 10-09-create_benchmark branch from b8c8238 to 1c9648c Compare January 14, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant