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

Enhance Transaction Simulation: Bypass Auth Key Check and Fee Payment, Improve Multisig Consistency #13714

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

junkil-park
Copy link
Contributor

@junkil-park junkil-park commented Jun 14, 2024

Description

This PR implements the AIP-92 (Transaction Simulation Enhancement). This enhances the simulation functionality in several key ways:

  1. Bypass Authentication Key Check:

    • Removes the mandatory check for an authentication key during simulations.
    • This addresses a long-standing and frequently requested feature in this issue.
  2. Eliminate Gas Fee Payment Requirement:

    • Removes the requirement for a gas fee payer during simulations when the fee payer address is 0x0.
    • Simulations will no longer validate the presence of sufficient funds for gas payment, allowing developers to test scenarios without considering gas fees.
    • This addresses the feature request in this issue
  3. Improve Multisig Simulation Consistency:

    • Merges the Multisig payload simulation path with the execution path, ensuring consistency between simulation and actual execution.
    • This resolves the issue of an onchain payload not being retrived (desribed here and here).
    • This also resolves the issue of inaccurate gas estimation for multisig transactions (described here).

These changes are aimed at improving the flexibility of the simulation environment, allowing developers to test transactions and interactions without the constraints of authentication keys and gas fee payments.

This PR resolves, #6862, #13686, #12703, #8304, #12704.

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?

e2e API tests and tested on the localnet

Copy link

trunk-io bot commented Jun 14, 2024

⏱️ 6h 14m total CI duration on this PR
Job Cumulative Duration Recent Runs
test-fuzzers 2h 18m 🟩🟩🟩🟩
rust-move-tests 58m 🟥🟥🟥🟥
rust-move-unit-coverage 52m 🟩🟩🟩🟩
rust-targeted-unit-tests 31m 🟥🟥🟥🟥
run-tests-main-branch 23m 🟩🟩🟩🟩🟩
rust-lints 18m 🟥🟥🟥🟥🟥
general-lints 11m 🟩🟩🟩🟩🟩 (+1 more)
forge-compat-test / forge 9m 🟥
check-dynamic-deps 9m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 9m 🟥
rust-move-unit-coverage 9m 🟩
semgrep/ci 2m 🟩🟩🟩🟩🟩 (+1 more)
file_change_determinator 1m 🟩🟩🟩🟩🟩 (+1 more)
file_change_determinator 1m 🟩🟩🟩🟩🟩 (+1 more)
permission-check 18s 🟩🟩🟩🟩🟩 (+1 more)
permission-check 16s 🟩🟩🟩🟩🟩 (+1 more)
permission-check 15s 🟩🟩🟩🟩🟩 (+1 more)
permission-check 15s 🟩🟩🟩🟩🟩 (+1 more)

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

Job Duration vs 7d avg Delta
rust-move-tests 12m 9m +37%

settingsfeedbackdocs ⋅ learn more about trunk.io

@junkil-park junkil-park force-pushed the jpark/simulation-without-public-key branch from 4e10c7d to 761b480 Compare June 14, 2024 23:41
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 0.48780% with 204 lines in your changes missing coverage. Please review.

Project coverage is 59.4%. Comparing base (a482050) to head (ab884e0).
Report is 5 commits behind head on main.

Files Patch % Lines
aptos-move/aptos-vm/src/transaction_validation.rs 0.0% 154 Missing ⚠️
aptos-move/aptos-vm/src/aptos_vm.rs 0.0% 16 Missing ⚠️
types/src/transaction/authenticator.rs 0.0% 16 Missing ⚠️
aptos-move/aptos-vm/src/transaction_metadata.rs 0.0% 15 Missing ⚠️
types/src/on_chain_config/aptos_features.rs 25.0% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #13714     +/-   ##
=========================================
- Coverage    59.4%    59.4%   -0.1%     
=========================================
  Files         838      838             
  Lines      204392   204525    +133     
=========================================
+ Hits       121562   121563      +1     
- Misses      82830    82962    +132     

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

@junkil-park junkil-park force-pushed the jpark/simulation-without-public-key branch 2 times, most recently from a778a2f to 8fdeabc Compare June 18, 2024 17:48
@junkil-park junkil-park changed the title [Simulation] Enable the simulation without the authentication key check [Simulation] Enable Simulation Without Auth Key and Gas Fee Checks Jun 18, 2024
@junkil-park junkil-park force-pushed the jpark/simulation-without-public-key branch 3 times, most recently from 8cfb624 to d7a27a1 Compare June 25, 2024 18:33
@junkil-park junkil-park changed the title [Simulation] Enable Simulation Without Auth Key and Gas Fee Checks [Simulation] Enhance Transaction Simulation: Bypass Auth Key Check and Fee Payment, Improve Multisig Consistency Jun 25, 2024
@junkil-park junkil-park marked this pull request as ready for review June 25, 2024 18:40
@junkil-park junkil-park changed the title [Simulation] Enhance Transaction Simulation: Bypass Auth Key Check and Fee Payment, Improve Multisig Consistency Enhance Transaction Simulation: Bypass Auth Key Check and Fee Payment, Improve Multisig Consistency Jun 25, 2024
@junkil-park junkil-park force-pushed the jpark/simulation-without-public-key branch 2 times, most recently from 5b15596 to 453dbfc Compare June 26, 2024 17:01

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.

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.

This comment has been minimized.

This comment has been minimized.

…, Improve Multisig Consistency

This PR enhances the simulation functionality in several key ways:

1. Bypass Authentication Key Check: Removes the mandatory check for an authentication key during simulations.

2. Eliminate Gas Fee Payment Requirement: Removes the requirement for a gas fee payer during simulations when the fee payer address is 0x0. Simulations will no longer validate the presence of sufficient funds for gas payment, allowing developers to test scenarios without considering gas fees.

3. Improve Multisig Simulation Consistency: Merges the Multisig payload simulation path with the execution path, ensuring consistency between simulation and actual execution.

These changes are aimed at improving the flexibility of the simulation environment, allowing developers to test transactions and interactions without the constraints of authentication keys and gas fee payments.
@junkil-park junkil-park force-pushed the jpark/simulation-without-public-key branch from 564b400 to ab884e0 Compare August 21, 2024 21:20

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7

Compatibility test results for d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7 (PR)
1. Check liveness of validators at old version: d1bf834728a0cf166d993f4728dfca54f3086fb0
compatibility::simple-validator-upgrade::liveness-check : committed: 10312.75 txn/s, latency: 2984.43 ms, (p50: 2300 ms, p90: 3000 ms, p99: 26900 ms), latency samples: 400840
2. Upgrading first Validator to new version: ab884e0196152e905feeaa851dad39efa5a2f3d7
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7542.70 txn/s, latency: 3714.29 ms, (p50: 4200 ms, p90: 4400 ms, p99: 4600 ms), latency samples: 142960
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6994.88 txn/s, latency: 4091.69 ms, (p50: 4100 ms, p90: 4500 ms, p99: 6200 ms), latency samples: 268000
3. Upgrading rest of first batch to new version: ab884e0196152e905feeaa851dad39efa5a2f3d7
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7133.35 txn/s, latency: 3959.43 ms, (p50: 4300 ms, p90: 4800 ms, p99: 5000 ms), latency samples: 269720
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6997.38 txn/s, latency: 4539.15 ms, (p50: 4500 ms, p90: 7100 ms, p99: 7300 ms), latency samples: 235120
4. upgrading second batch to new version: ab884e0196152e905feeaa851dad39efa5a2f3d7
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 3474.31 txn/s, latency: 7948.74 ms, (p50: 9500 ms, p90: 13200 ms, p99: 16000 ms), latency samples: 71280
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9243.64 txn/s, latency: 3484.73 ms, (p50: 3000 ms, p90: 7200 ms, p99: 8600 ms), latency samples: 301080
5. check swarm health
Compatibility test for d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on ab884e0196152e905feeaa851dad39efa5a2f3d7

two traffics test: inner traffic : committed: 12764.02 txn/s, latency: 3113.38 ms, (p50: 3000 ms, p90: 3300 ms, p99: 12100 ms), latency samples: 4853120
two traffics test : committed: 99.92 txn/s, latency: 2893.78 ms, (p50: 2600 ms, p90: 3000 ms, p99: 9800 ms), latency samples: 1780
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.256, avg: 0.219", "QsPosToProposal: max: 0.288, avg: 0.247", "ConsensusProposalToOrdered: max: 0.327, avg: 0.303", "ConsensusOrderedToCommit: max: 0.699, avg: 0.587", "ConsensusProposalToCommit: max: 1.001, avg: 0.890"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.90s no progress at version 5079986 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.33s no progress at version 5079984 (avg 8.23s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7

Compatibility test results for d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7 (PR)
Upgrade the nodes to version: ab884e0196152e905feeaa851dad39efa5a2f3d7
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1229.66 txn/s, submitted: 1232.71 txn/s, failed submission: 3.04 txn/s, expired: 3.04 txn/s, latency: 2726.14 ms, (p50: 2300 ms, p90: 5300 ms, p99: 6500 ms), latency samples: 105080
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1165.06 txn/s, submitted: 1166.90 txn/s, failed submission: 1.83 txn/s, expired: 1.83 txn/s, latency: 2934.79 ms, (p50: 2300 ms, p90: 6000 ms, p99: 7800 ms), latency samples: 101700
5. check swarm health
Compatibility test for d1bf834728a0cf166d993f4728dfca54f3086fb0 ==> ab884e0196152e905feeaa851dad39efa5a2f3d7 passed
Upgrade the remaining nodes to version: ab884e0196152e905feeaa851dad39efa5a2f3d7
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1265.89 txn/s, submitted: 1268.54 txn/s, failed submission: 2.65 txn/s, expired: 2.65 txn/s, latency: 2546.87 ms, (p50: 2300 ms, p90: 4200 ms, p99: 5900 ms), latency samples: 114540
Test Ok

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.

4 participants