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 a --node-api-key flag to the aptos move replay command to enable querying the full node using an API key #15351

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xmaayan
Copy link
Contributor

Description

For future Buildspace usage, we need to be able to provide an API key for the replay job to avoid server rate limiting.
For more context:

cargo run --bin aptos move replay --help

      --network <NETWORK>
          The network to replay on.
          
          Possible values: mainnet, testnet, <REST_ENDPOINT_URL>

      --txn-id <TXN_ID>
          The id of the transaction to replay. Also being referred to as "version" in some contexts

      --benchmark
          If this option is set, benchmark the transaction and report the running time(s)

      --profile-gas
          If this option is set, profile the transaction and generate a detailed report of its gas usage

      --skip-comparison
          If present, skip the comparison against the expected transaction output

      --node-api-key <NODE_API_KEY>
          Key to use for ratelimiting purposes with the node API. This value will be used as `Authorization: Bearer <key>`

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

How Has This Been Tested?

Command without --node-api-key executed successfully

cargo run --bin aptos move replay --profile-gas --network testnet --txn-id 830794924

Command with --node-api-key executed successfully and can see a spike in the Node api metrics in my Build account

cargo run --bin aptos move replay --profile-gas --network testnet --txn-id 830794924 --node-api-key aptos_123asd

Key Areas to Review

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
  • Move Compiler
  • Other (specify)

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 Nov 21, 2024

⏱️ 1h 27m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 12m 🟩
rust-move-tests 12m 🟩
rust-cargo-deny 7m 🟩🟩🟩🟩
rust-doc-tests 5m 🟩
execution-performance / test-target-determinator 5m 🟩
test-target-determinator 5m 🟩
check-dynamic-deps 4m 🟩🟩🟩🟩
check 4m 🟩
semgrep/ci 2m 🟩🟩🟩🟩
general-lints 2m 🟩🟩🟩🟩
fetch-last-released-docker-image-tag 2m 🟩
file_change_determinator 57s 🟩🟩🟩🟩
permission-check 15s 🟩🟩🟩🟩

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

Job Duration vs 7d avg Delta
execution-performance / single-node-performance 10s 15m -99%

settingsfeedbackdocs ⋅ learn more about trunk.io

/// Key to use for ratelimiting purposes with the node API. This value will be used
/// as `Authorization: Bearer <key>`
#[clap(long)]
pub(crate) node_api_key: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just be using RestOptions like all the other commands, or does that not make sense here?

Copy link
Contributor Author

@0xmaayan 0xmaayan Nov 21, 2024

Choose a reason for hiding this comment

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

RestOptions holds a url option. The replay command actually uses a network flag and then maps it to a url. Using both options can be confusing and changing it will just introduce an unnecessary breaking change

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, this is fine then.

@0xmaayan 0xmaayan enabled auto-merge (squash) November 25, 2024 17:41

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 749fff901410753610a65c0ee0c6d3ef94357c3a

two traffics test: inner traffic : committed: 14511.00 txn/s, latency: 2740.04 ms, (p50: 2700 ms, p70: 2700, p90: 2900 ms, p99: 3300 ms), latency samples: 5517420
two traffics test : committed: 99.92 txn/s, latency: 1609.54 ms, (p50: 1400 ms, p70: 1500, p90: 1600 ms, p99: 10800 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.044, avg: 1.560", "ConsensusProposalToOrdered: max: 0.313, avg: 0.291", "ConsensusOrderedToCommit: max: 0.370, avg: 0.357", "ConsensusProposalToCommit: max: 0.656, avg: 0.648"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.08s no progress at version 2171722 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.49s no progress at version 2171720 (avg 6.97s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite compat success on 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a

Compatibility test results for 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a (PR)
1. Check liveness of validators at old version: 94976266c0e4edd1a31a3783be4c4184f8892ff5
compatibility::simple-validator-upgrade::liveness-check : committed: 14444.07 txn/s, latency: 2387.39 ms, (p50: 2100 ms, p70: 2100, p90: 2400 ms, p99: 8200 ms), latency samples: 545520
2. Upgrading first Validator to new version: 749fff901410753610a65c0ee0c6d3ef94357c3a
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7499.77 txn/s, latency: 3686.88 ms, (p50: 3900 ms, p70: 4500, p90: 4700 ms, p99: 5200 ms), latency samples: 139680
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 7448.06 txn/s, latency: 4324.69 ms, (p50: 4500 ms, p70: 4600, p90: 6300 ms, p99: 6500 ms), latency samples: 251800
3. Upgrading rest of first batch to new version: 749fff901410753610a65c0ee0c6d3ef94357c3a
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7144.80 txn/s, latency: 3857.95 ms, (p50: 3900 ms, p70: 4400, p90: 5300 ms, p99: 5700 ms), latency samples: 130060
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7253.74 txn/s, latency: 4457.96 ms, (p50: 4600 ms, p70: 4800, p90: 6100 ms, p99: 6500 ms), latency samples: 242060
4. upgrading second batch to new version: 749fff901410753610a65c0ee0c6d3ef94357c3a
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 12136.72 txn/s, latency: 2320.70 ms, (p50: 2600 ms, p70: 2700, p90: 2800 ms, p99: 2900 ms), latency samples: 207340
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 11796.32 txn/s, latency: 2715.60 ms, (p50: 2700 ms, p70: 2800, p90: 3600 ms, p99: 4100 ms), latency samples: 382940
5. check swarm health
Compatibility test for 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a passed
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a

Compatibility test results for 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a (PR)
Upgrade the nodes to version: 749fff901410753610a65c0ee0c6d3ef94357c3a
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1309.95 txn/s, submitted: 1311.97 txn/s, failed submission: 2.02 txn/s, expired: 2.02 txn/s, latency: 2430.67 ms, (p50: 2100 ms, p70: 2400, p90: 4200 ms, p99: 5900 ms), latency samples: 116660
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1530.44 txn/s, submitted: 1533.42 txn/s, failed submission: 2.99 txn/s, expired: 2.99 txn/s, latency: 2048.74 ms, (p50: 2000 ms, p70: 2100, p90: 3000 ms, p99: 4200 ms), latency samples: 133280
5. check swarm health
Compatibility test for 94976266c0e4edd1a31a3783be4c4184f8892ff5 ==> 749fff901410753610a65c0ee0c6d3ef94357c3a passed
Upgrade the remaining nodes to version: 749fff901410753610a65c0ee0c6d3ef94357c3a
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1470.31 txn/s, submitted: 1473.08 txn/s, failed submission: 2.78 txn/s, expired: 2.78 txn/s, latency: 2254.91 ms, (p50: 2100 ms, p70: 2400, p90: 3600 ms, p99: 5100 ms), latency samples: 127040
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.

2 participants