aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.85k stars 3.54k forks source link

Create token with collection object. #13215

Closed JohnChangUK closed 3 days ago

JohnChangUK commented 1 week ago

Description

Amend create token functions which take in Object<Collection> to create tokens using the Object<Collection> rather than the collection name.

Extra documentation will be added to the set_name function in collection.move, and the current token creation functions which take in collection_name.

Type of Change

Which Components or Systems Does This Change Impact?

How Has This Been Tested?

Unit tests added.

Checklist

trunk-io[bot] commented 1 week ago
⏱️ 6h 9m total CI duration on this PR | Job | Cumulative Duration | Recent Runs | |---|---|---| | [rust-move-unit-coverage](https://github.com/aptos-labs/aptos-core/actions/runs/9054319046/job/24874036461) | 1h 55m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293359/job/24652836978) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8992319089/job/24701868497) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156947/job/24707208331) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107797/job/24742869310) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319046/job/24874036461)  | | [rust-targeted-unit-tests](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039650) | 1h 49m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293358/job/24652848051) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8992319096/job/24701881140) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156927/job/24707218770) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107794/job/24742882686) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039650)  | | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/9054319061/job/24874036741) | 1h 16m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293350/job/24652837126) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8992319113/job/24701868475) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156926/job/24707208037) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107799/job/24742868797) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319061/job/24874036741)  | | [rust-lints](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039567) | 36m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293358/job/24652847735) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156927/job/24707218598) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107794/job/24742882243) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039567)  | | [run-tests-main-branch](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874042193) | 17m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293360/job/24652851310) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156877/job/24707221465) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107316/job/24742884771) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874042193)  | | [general-lints](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039500) | 7m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293358/job/24652847910) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156927/job/24707218410) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107794/job/24742882490) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874039500)  | | [check-dynamic-deps](https://github.com/aptos-labs/aptos-core/actions/runs/9054319053/job/24874036118) | 5m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293349/job/24652836357) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156929/job/24707207274) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107792/job/24742867768) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319053/job/24874036118)  | | [semgrep/ci](https://github.com/aptos-labs/aptos-core/actions/runs/9054319048/job/24874036119) | 2m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293356/job/24652836325) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156934/job/24707207330) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107784/job/24742868130) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319048/job/24874036119)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874036595) | 46s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293358/job/24652837168) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156927/job/24707207863) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107794/job/24742869068) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054319054/job/24874036595)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874038196) | 44s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293360/job/24652841403) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156877/job/24707213833) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107316/job/24742874021) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874038196)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/9054318862/job/24874035853) | 11s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293364/job/24652836849) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156890/job/24707207948) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107312/job/24742866069) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318862/job/24874035853)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874035867) | 10s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293360/job/24652837379) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156877/job/24707208154) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107316/job/24742866129) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318865/job/24874035867)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/9054318861/job/24874035652) | 10s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293354/job/24652836579) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156885/job/24707207213) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107306/job/24742865891) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318861/job/24874035652)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/9054318863/job/24874035631) | 8s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8976293363/job/24652836549) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8994156883/job/24707207406) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9006107307/job/24742865878) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/9054318863/job/24874035631)  |

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
rust-targeted-unit-tests 26m 21m +22%

settingsfeedbackdocs ⋅ learn more about trunk.io

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 57.6%. Comparing base (6cdd4c2) to head (b2a5b39). Report is 4 commits behind head on main.

:exclamation: Current head b2a5b39 differs from pull request most recent head b46bd57. Consider uploading reports for the commit b46bd57 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #13215 +/- ## ======================================= Coverage 57.6% 57.6% ======================================= Files 834 834 Lines 198397 198397 ======================================= Hits 114318 114318 Misses 84079 84079 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 3 days ago

Forge is running suite realistic_env_max_load on b2a5b39e5f2fda50e96436533e8d5c7b53348069

github-actions[bot] commented 3 days ago

Forge is running suite compat on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069

github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite compat success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069 (PR)
1. Check liveness of validators at old version: 01b24e7e3548382dd25440b39a0438a993387f12
compatibility::simple-validator-upgrade::liveness-check : committed: 6896 txn/s, latency: 4816 ms, (p50: 4800 ms, p90: 7800 ms, p99: 8400 ms), latency samples: 241380
2. Upgrading first Validator to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1764 txn/s, latency: 15664 ms, (p50: 19000 ms, p90: 21900 ms, p99: 22300 ms), latency samples: 91740
3. Upgrading rest of first batch to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1599 txn/s, latency: 17860 ms, (p50: 18900 ms, p90: 23100 ms, p99: 23500 ms), latency samples: 84760
4. upgrading second batch to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3619 txn/s, latency: 8772 ms, (p50: 9600 ms, p90: 12600 ms, p99: 12800 ms), latency samples: 144780
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069 passed
Test Ok
github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite realistic_env_max_load success on b2a5b39e5f2fda50e96436533e8d5c7b53348069

two traffics test: inner traffic : committed: 7475 txn/s, latency: 5248 ms, (p50: 5100 ms, p90: 6300 ms, p99: 10900 ms), latency samples: 3229540
two traffics test : committed: 100 txn/s, latency: 1890 ms, (p50: 1900 ms, p90: 2100 ms, p99: 3800 ms), latency samples: 1820
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.210, avg: 0.204", "QsPosToProposal: max: 0.317, avg: 0.268", "ConsensusProposalToOrdered: max: 0.471, avg: 0.444", "ConsensusOrderedToCommit: max: 0.381, avg: 0.361", "ConsensusProposalToCommit: max: 0.847, avg: 0.804"]
Max round gap was 1 [limit 4] at version 1652218. Max no progress secs was 4.510727 [limit 15] at version 1652218.
Test Ok
github-actions[bot] commented 3 days ago

Forge is running suite compat on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069

github-actions[bot] commented 3 days ago

Forge is running suite realistic_env_max_load on b2a5b39e5f2fda50e96436533e8d5c7b53348069

github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite compat success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069 (PR)
1. Check liveness of validators at old version: 01b24e7e3548382dd25440b39a0438a993387f12
compatibility::simple-validator-upgrade::liveness-check : committed: 6661 txn/s, latency: 5021 ms, (p50: 4800 ms, p90: 8900 ms, p99: 10200 ms), latency samples: 233140
2. Upgrading first Validator to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1377 txn/s, latency: 19640 ms, (p50: 23200 ms, p90: 28300 ms, p99: 30400 ms), latency samples: 73000
3. Upgrading rest of first batch to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1814 txn/s, latency: 15965 ms, (p50: 19300 ms, p90: 22000 ms, p99: 22600 ms), latency samples: 90720
4. upgrading second batch to new version: b2a5b39e5f2fda50e96436533e8d5c7b53348069
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3604 txn/s, latency: 8816 ms, (p50: 9600 ms, p90: 12600 ms, p99: 12900 ms), latency samples: 144160
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b2a5b39e5f2fda50e96436533e8d5c7b53348069 passed
Test Ok
github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite realistic_env_max_load success on b2a5b39e5f2fda50e96436533e8d5c7b53348069

two traffics test: inner traffic : committed: 7113 txn/s, latency: 5499 ms, (p50: 5400 ms, p90: 6700 ms, p99: 13800 ms), latency samples: 3080160
two traffics test : committed: 100 txn/s, latency: 1994 ms, (p50: 1900 ms, p90: 2200 ms, p99: 4500 ms), latency samples: 1820
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.216, avg: 0.202", "QsPosToProposal: max: 0.367, avg: 0.274", "ConsensusProposalToOrdered: max: 0.474, avg: 0.427", "ConsensusOrderedToCommit: max: 0.380, avg: 0.369", "ConsensusProposalToCommit: max: 0.810, avg: 0.796"]
Max round gap was 1 [limit 4] at version 1577939. Max no progress secs was 4.6019793 [limit 15] at version 1577939.
Test Ok
github-actions[bot] commented 3 days ago

Forge is running suite framework_upgrade on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43

github-actions[bot] commented 3 days ago

Forge is running suite realistic_env_max_load on b46bd57515ed498f98b3c7413a2d20508a5b3a43

github-actions[bot] commented 3 days ago

Forge is running suite compat on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43

github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite realistic_env_max_load success on b46bd57515ed498f98b3c7413a2d20508a5b3a43

two traffics test: inner traffic : committed: 7541.22650795059 txn/s, latency: 5189.714788413253 ms, (p50: 5100 ms, p90: 6000 ms, p99: 10600 ms), latency samples: 3265800
two traffics test : committed: 99.98293405642796 txn/s, latency: 1871.2363636363636 ms, (p50: 1800 ms, p90: 2100 ms, p99: 2400 ms), latency samples: 1760
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.208, avg: 0.201", "QsPosToProposal: max: 0.255, avg: 0.234", "ConsensusProposalToOrdered: max: 0.455, avg: 0.409", "ConsensusOrderedToCommit: max: 0.375, avg: 0.354", "ConsensusProposalToCommit: max: 0.773, avg: 0.763"]
Max round gap was 1 [limit 4] at version 1558464. Max no progress secs was 4.518884 [limit 15] at version 1558464.
Test Ok
github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite compat success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43 (PR)
1. Check liveness of validators at old version: 01b24e7e3548382dd25440b39a0438a993387f12
compatibility::simple-validator-upgrade::liveness-check : committed: 6173.834791780183 txn/s, latency: 5106.562027893277 ms, (p50: 4800 ms, p90: 9300 ms, p99: 12000 ms), latency samples: 230880
2. Upgrading first Validator to new version: b46bd57515ed498f98b3c7413a2d20508a5b3a43
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1524.0237397634417 txn/s, latency: 19073.617655140828 ms, (p50: 17900 ms, p90: 30100 ms, p99: 30500 ms), latency samples: 87340
3. Upgrading rest of first batch to new version: b46bd57515ed498f98b3c7413a2d20508a5b3a43
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1391.2438269792028 txn/s, latency: 20271.336510344827 ms, (p50: 21500 ms, p90: 27400 ms, p99: 29600 ms), latency samples: 72500
4. upgrading second batch to new version: b46bd57515ed498f98b3c7413a2d20508a5b3a43
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3297.8794337093996 txn/s, latency: 9419.294061707524 ms, (p50: 9700 ms, p90: 12700 ms, p99: 12900 ms), latency samples: 141960
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43 passed
Test Ok
github-actions[bot] commented 3 days ago

:white_check_mark: Forge suite framework_upgrade success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43 (PR)
Upgrade the nodes to version: b46bd57515ed498f98b3c7413a2d20508a5b3a43
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1094.2673004731967 txn/s, submitted: 1096.245686512622 txn/s, failed submission: 1.978386039425225 txn/s, expired: 1.978386039425225 txn/s, latency: 2757.715096424267 ms, (p50: 2200 ms, p90: 5400 ms, p99: 7800 ms), latency samples: 99560
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1092.6491690930711 txn/s, submitted: 1096.2053909615597 txn/s, failed submission: 3.5562218684884335 txn/s, expired: 3.5562218684884335 txn/s, latency: 2763.405807567128 ms, (p50: 2400 ms, p90: 4500 ms, p99: 6100 ms), latency samples: 98320
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> b46bd57515ed498f98b3c7413a2d20508a5b3a43 passed
Upgrade the remaining nodes to version: b46bd57515ed498f98b3c7413a2d20508a5b3a43
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1116.3685613139908 txn/s, submitted: 1118.8021828309259 txn/s, failed submission: 2.433621516934978 txn/s, expired: 2.433621516934978 txn/s, latency: 2719.4867419738407 ms, (p50: 2400 ms, p90: 4500 ms, p99: 6800 ms), latency samples: 100920
Test Ok