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

[api] Fix simulation API for fungible assets as gas #13199

Closed gregnazario closed 2 weeks ago

gregnazario commented 2 weeks ago

Description

This is a quick fix for making simulation with with fungible assets as gas. Uses the view function instead of the resource lookup for gas.

This could add some performance hit, which I have not measured, and we may want to look at just two resource lookups instead.

Type of Change

Which Components or Systems Does This Change Impact?

How Has This Been Tested?

CI or bust

Key Areas to Review

Checklist

trunk-io[bot] commented 2 weeks ago
⏱️ 4h 44m total CI duration on this PR | Job | Cumulative Duration | Recent Runs | |---|---|---| | [forge-framework-upgrade-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576136044) | 1h 12m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576136044)  | | [windows-build](https://github.com/aptos-labs/aptos-core/actions/runs/8945986352/job/24575889216) | 37m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986352/job/24575889216)  | | [rust-smoke-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900823) | 32m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900823)  | | [execution-performance / single-node-performance](https://github.com/aptos-labs/aptos-core/actions/runs/8945986367/job/24575896384) | 23m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986367/job/24575896384)  | | [forge-compat-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135858) | 23m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135858)  | | [rust-targeted-unit-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900972) | 16m | [⬜](https://github.com/aptos-labs/aptos-core/actions/runs/8945929680/job/24575752505) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900972)  | | [forge-e2e-test / forge](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135959) | 14m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135959)  | | [rust-images / rust-all](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575897485) | 13m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575897485)  | | [rust-lints](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900899) | 12m | [⬜](https://github.com/aptos-labs/aptos-core/actions/runs/8945929680/job/24575752406) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900899)  | | [run-tests-main-branch](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575900590) | 8m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929676/job/24575760616) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575900590)  | | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8945986353/job/24575891626) | 6m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929672/job/24575746026) [⬜](https://github.com/aptos-labs/aptos-core/actions/runs/8945985849/job/24575888142) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986353/job/24575891626)  | | [cli-e2e-tests / run-cli-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135559) | 6m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135559)  | | [check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986354/job/24575889973) | 4m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986354/job/24575889973)  | | [rust-build-cached-packages](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900493) | 4m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900493)  | | [check-dynamic-deps](https://github.com/aptos-labs/aptos-core/actions/runs/8945985843/job/24575887813) | 4m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929666/job/24575745716) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986351/job/24575889291) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985843/job/24575887813)  | | [general-lints](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900593) | 3m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929680/job/24575752292) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575900593)  | | [framework-upgrade-determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893402) | 3m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893402)  | | [semgrep/ci](https://github.com/aptos-labs/aptos-core/actions/runs/8945986356/job/24575889357) | 1m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929675/job/24575745761) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985858/job/24575887905) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986356/job/24575889357)  | | [node-api-compatibility-tests / node-api-compatibility-tests](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135652) | 53s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24576135652)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575894636) | 26s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929676/job/24575749964) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575894636)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575894192) | 20s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929680/job/24575746246) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986355/job/24575894192)  | | [execution-performance / file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8945986367/job/24575889760) | 12s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986367/job/24575889760)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575891182) | 11s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929676/job/24575746084) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985712/job/24575887606) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986372/job/24575891182)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893145) | 10s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893145)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986368/job/24575889453) | 10s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929668/job/24575745853) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985714/job/24575887464) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986368/job/24575889453)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986371/job/24575889569) | 8s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929667/job/24575745809) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985711/job/24575887459) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986371/job/24575889569)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986370/job/24575891167) | 7s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945929681/job/24575746133) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945985713/job/24575887602) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986370/job/24575891167)  | | [determine-docker-build-metadata](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893267) | 3s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575893267)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575890269) | 1s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/8945986390/job/24575890269)  |

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

Job Duration vs 7d avg Delta
forge-compat-test / forge 23m 14m +61%
rust-move-tests 3m 8m -66%

settingsfeedbackdocs ⋅ learn more about trunk.io

github-actions[bot] commented 2 weeks ago

Forge is running suite realistic_env_max_load on 0ca05f5332d7c29fb382bbf264668d27746bbf50

github-actions[bot] commented 2 weeks ago

Forge is running suite compat on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50

github-actions[bot] commented 2 weeks ago

Forge is running suite framework_upgrade on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50

github-actions[bot] commented 2 weeks ago

:white_check_mark: Forge suite realistic_env_max_load success on 0ca05f5332d7c29fb382bbf264668d27746bbf50

two traffics test: inner traffic : committed: 8123 txn/s, latency: 4821 ms, (p50: 4500 ms, p90: 5700 ms, p99: 10200 ms), latency samples: 3517640
two traffics test : committed: 100 txn/s, latency: 1932 ms, (p50: 1800 ms, p90: 2000 ms, p99: 6000 ms), latency samples: 1800
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.206, avg: 0.202", "QsPosToProposal: max: 0.240, avg: 0.216", "ConsensusProposalToOrdered: max: 0.434, avg: 0.410", "ConsensusOrderedToCommit: max: 0.374, avg: 0.359", "ConsensusProposalToCommit: max: 0.778, avg: 0.770"]
Max round gap was 1 [limit 4] at version 1711983. Max no progress secs was 4.489002 [limit 15] at version 1711983.
Test Ok
github-actions[bot] commented 2 weeks ago

:white_check_mark: Forge suite compat success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50 (PR)
1. Check liveness of validators at old version: 01b24e7e3548382dd25440b39a0438a993387f12
compatibility::simple-validator-upgrade::liveness-check : committed: 5924 txn/s, latency: 5178 ms, (p50: 4800 ms, p90: 8700 ms, p99: 11000 ms), latency samples: 254760
2. Upgrading first Validator to new version: 0ca05f5332d7c29fb382bbf264668d27746bbf50
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1668 txn/s, latency: 17047 ms, (p50: 19400 ms, p90: 24400 ms, p99: 24800 ms), latency samples: 90120
3. Upgrading rest of first batch to new version: 0ca05f5332d7c29fb382bbf264668d27746bbf50
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1706 txn/s, latency: 16934 ms, (p50: 19000 ms, p90: 22200 ms, p99: 22500 ms), latency samples: 88760
4. upgrading second batch to new version: 0ca05f5332d7c29fb382bbf264668d27746bbf50
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3032 txn/s, latency: 9797 ms, (p50: 9900 ms, p90: 12900 ms, p99: 16700 ms), latency samples: 130400
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50 passed
Test Ok
github-actions[bot] commented 2 weeks ago

:white_check_mark: Forge suite framework_upgrade success on 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50

Compatibility test results for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50 (PR)
Upgrade the nodes to version: 0ca05f5332d7c29fb382bbf264668d27746bbf50
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1271 txn/s, submitted: 1273 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2505 ms, (p50: 2100 ms, p90: 4300 ms, p99: 5600 ms), latency samples: 114420
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1083 txn/s, submitted: 1086 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2798 ms, (p50: 2100 ms, p90: 4800 ms, p99: 8400 ms), latency samples: 95380
5. check swarm health
Compatibility test for 01b24e7e3548382dd25440b39a0438a993387f12 ==> 0ca05f5332d7c29fb382bbf264668d27746bbf50 passed
Upgrade the remaining nodes to version: 0ca05f5332d7c29fb382bbf264668d27746bbf50
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1170 txn/s, submitted: 1173 txn/s, failed submission: 2 txn/s, expired: 2 txn/s, latency: 2510 ms, (p50: 2100 ms, p90: 4500 ms, p99: 6600 ms), latency samples: 106520
Test Ok