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
6.18k stars 3.66k forks source link

Add a `--node-api-key` flag to the `aptos move replay` command to enable querying the full node using an API key #15351

Open 0xmaayan opened 1 day ago

0xmaayan commented 1 day ago

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

Which Components or Systems Does This Change Impact?

Checklist

trunk-io[bot] commented 1 day ago
⏱️ 51m total CI duration on this PR | Job | Cumulative Duration | Recent Runs | |---|---|---| | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/11956684066/job/33332020655) | 13m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684066/job/33332020655)  | | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/11955870217/job/33329277725) | 13m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870217/job/33329277725)  | | [rust-move-tests](https://github.com/aptos-labs/aptos-core/actions/runs/11956441061/job/33331199165) | 12m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441061/job/33331199165)  | | [rust-cargo-deny](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332042480) | 5m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870209/job/33329307686) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441046/job/33331224587) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332042480)  | | [check-dynamic-deps](https://github.com/aptos-labs/aptos-core/actions/runs/11956684062/job/33332019352) | 3m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870240/job/33329275958) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441056/job/33331197503) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684062/job/33332019352)  | | [general-lints](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332042902) | 1m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870209/job/33329308386) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441046/job/33331223970) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332042902)  | | [semgrep/ci](https://github.com/aptos-labs/aptos-core/actions/runs/11956684053/job/33332019355) | 1m | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870214/job/33329275992) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441065/job/33331198242) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684053/job/33332019355)  | | [file_change_determinator](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332020798) | 46s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870209/job/33329278287) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956441046/job/33331199232) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956684050/job/33332020798)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/11956683493/job/33332017756) | 12s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870218/job/33329276050) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956440955/job/33331197471) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956683493/job/33332017756)  | | [permission-check](https://github.com/aptos-labs/aptos-core/actions/runs/11956683516/job/33332017973) | 8s | [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11955870254/job/33329276016) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956440954/job/33331197474) [🟩](https://github.com/aptos-labs/aptos-core/actions/runs/11956683516/job/33332017973)  |

settingsfeedbackdocs ⋅ learn more about trunk.io