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

Stylus/update debugging info #1836

Merged
merged 22 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0278832
updated RPC providers that support stylus tracing
srinjoyc Nov 18, 2024
ea5a334
small typo fix
srinjoyc Nov 18, 2024
d85b9a4
small tone / sentence fix
srinjoyc Nov 18, 2024
f3494e3
fixed formatting with yarn:format
srinjoyc Nov 18, 2024
d7e096c
Added to tracing example commands and updated instructions for using…
srinjoyc Nov 18, 2024
2d269cb
typo fix
srinjoyc Nov 18, 2024
fbe2acb
added code blocks to sentence
srinjoyc Nov 18, 2024
7c07b69
mentioned both replay and trace and added flag to sample replay cmd
srinjoyc Nov 18, 2024
a9bad68
Moved stylus tracing support to rpc provider table and linked to it i…
srinjoyc Nov 18, 2024
b2fd88d
updated tenderly to include wss support on table
srinjoyc Nov 18, 2024
18cbaa2
added options list to cargo replay and caution for RPC usage
srinjoyc Nov 19, 2024
9e5fe53
Update arbitrum-docs/stylus/how-tos/debugging-stylus-tx.mdx
srinjoyc Nov 19, 2024
0e163e7
fix typo for heading
srinjoyc Nov 19, 2024
2e5e54b
fixed formatting
srinjoyc Nov 19, 2024
0b7de9a
Merge branch 'master' into stylus/update-debugging-info
mahsamoosavi Nov 19, 2024
fc37d78
updated flag definition for stylus tracing and removed mac osx compat…
srinjoyc Nov 19, 2024
6d9deb9
generalized requirements and instructions for both linux and mac
srinjoyc Nov 19, 2024
375734d
cleanup small mentions of windows, link lldb
srinjoyc Nov 19, 2024
4965b3a
updated RPC endpoint compatability section
srinjoyc Nov 19, 2024
e4e21bd
removed caution warning and updated old local node direct link
srinjoyc Nov 19, 2024
98491e3
updated note and rpc section
srinjoyc Nov 19, 2024
5a77c75
Merge branch 'master' into stylus/update-debugging-info
joshuacolvin0 Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,28 @@ Complete [this form](@portalApplicationForm@) , if you'd like to see your projec

:::

| Provider | Arb One? | Arb Nova? | Arb Sepolia? | Websocket? |
| ------------------------------------------------------------------------------------ | -------- | --------- | ------------ | ---------- |
| [1RPC](https://docs.1rpc.io/overview/supported-networks#arbitrum) | ✅ | | | |
| [Alchemy](https://docs.alchemy.com/reference/arbitrum-api-quickstart) | ✅ | ✅ | ✅ | ✅ |
| [Allnodes](https://arbitrum.publicnode.com) | ✅ | ✅ | | ✅ |
| [Ankr](https://www.ankr.com/docs/rpc-service/chains/chains-list/#arbitrum) | ✅ | | | ✅ |
| [Blast](https://blastapi.io/public-api/arbitrum) | ✅ | ✅ | | ✅ |
| [BlockPi](https://docs.blockpi.io/documentations/api-reference/arbitrum) | ✅ | ✅ | | |
| [BlockVision](https://dashboard.blockvision.org/connect) | ✅ | | | |
| [Chainbase](https://docs.chainbase.com/docs/chain-api-overview#arbitrum-one) | ✅ | | | ✅ |
| [Chainnodes](https://www.chainnodes.org/chains/arbitrum) | ✅ | | | |
| [Chainstack](https://chainstack.com/build-better-with-arbitrum/) | ✅ | | | ✅ |
| [DataHub](https://datahub.figment.io/) | ✅ | | | |
| [DRPC](https://drpc.org/public-endpoints/arbitrum) | ✅ | ✅ | | ✅ |
| [GetBlock](https://getblock.io/nodes/arb/) | ✅ | | | ✅ |
| [Infura](https://docs.infura.io/infura/networks/arbitrum) | ✅ | | ✅ | ✅ |
| [Lava](https://docs.lavanet.xyz/gateway-access) | ✅ | ✅ | | |
| [Moralis](https://docs.moralis.io/reference/introduction) | ✅ | | | |
| [Nirvana Labs](https://nirvanalabs.io) | ✅ | ✅ | ✅ | ✅ |
| [NodeReal](https://nodereal.io/meganode/api-marketplace/arbitrum-nitro-rpc) | ✅ | ✅ | | |
| [NOWNodes](https://nownodes.io/nodes/arbitrum-arb) | ✅ | | | |
| [Pocket Network](https://docs.pokt.network/welcome-to-pokt-network/supported-chains) | ✅ | | | |
| [Quicknode](https://www.quicknode.com/chains/arb) | ✅ | ✅ | ✅ | ✅ |
| [Unifra](https://unifra.io/) | ✅ | | | |
| Provider | Arb One? | Arb Nova? | Arb Sepolia? | Websocket? | Stylus Tracing? |
| ------------------------------------------------------------------------------------ | -------- | --------- | ------------ | ---------- | ------------------------------ |
| [1RPC](https://docs.1rpc.io/overview/supported-networks#arbitrum) | ✅ | | | | |
| [Alchemy](https://docs.alchemy.com/reference/arbitrum-api-quickstart) | ✅ | ✅ | ✅ | ✅ | Available on paid plans |
| [Allnodes](https://arbitrum.publicnode.com) | ✅ | ✅ | | ✅ | |
| [Ankr](https://www.ankr.com/docs/rpc-service/chains/chains-list/#arbitrum) | ✅ | | | ✅ | Available on paid plans |
| [Blast](https://blastapi.io/public-api/arbitrum) | ✅ | ✅ | | ✅ | |
| [BlockPi](https://docs.blockpi.io/documentations/api-reference/arbitrum) | ✅ | ✅ | | | |
| [BlockVision](https://dashboard.blockvision.org/connect) | ✅ | | | | |
| [Chainbase](https://docs.chainbase.com/docs/chain-api-overview#arbitrum-one) | ✅ | | | ✅ | |
| [Chainnodes](https://www.chainnodes.org/chains/arbitrum) | ✅ | | | | |
| [Chainstack](https://chainstack.com/build-better-with-arbitrum/) | ✅ | | | ✅ | Available on paid plans |
| [DataHub](https://datahub.figment.io/) | ✅ | | | | |
| [DRPC](https://drpc.org/public-endpoints/arbitrum) | ✅ | ✅ | | ✅ | |
| [GetBlock](https://getblock.io/nodes/arb/) | ✅ | | | ✅ | |
| [Infura](https://docs.infura.io/infura/networks/arbitrum) | ✅ | | ✅ | ✅ | Enabled on request |
| [Lava](https://docs.lavanet.xyz/gateway-access) | ✅ | ✅ | | | |
| [Moralis](https://docs.moralis.io/reference/introduction) | ✅ | | | | |
| [Nirvana Labs](https://nirvanalabs.io) | ✅ | ✅ | ✅ | ✅ | |
| [NodeReal](https://nodereal.io/meganode/api-marketplace/arbitrum-nitro-rpc) | ✅ | ✅ | | | |
| [NOWNodes](https://nownodes.io/nodes/arbitrum-arb) | ✅ | | | | |
| [Pocket Network](https://docs.pokt.network/welcome-to-pokt-network/supported-chains) | ✅ | | | | |
| [Quicknode](https://www.quicknode.com/chains/arb) | ✅ | ✅ | ✅ | ✅ | Testnet supported in free tier |
| [Unifra](https://unifra.io/) | ✅ | | | | |
| [Tenderly](https://tenderly.co/) | ✅ | ✅ | ✅ | ✅ | Testnet supported in free tier |
8 changes: 5 additions & 3 deletions arbitrum-docs/stylus/how-tos/debugging-stylus-tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export TX_HASH=0x18b241841fa0a59e02d3c6d693750ff0080ad792204aac7e5d4ce9e20c46683
And replay the transaction:

```sh
cargo stylus replay --tx=$TX_HASH --endpoint=$RPC_URL
cargo stylus replay --tx=$TX_HASH --endpoint=$RPC_URL --use-native-tracer
```
srinjoyc marked this conversation as resolved.
Show resolved Hide resolved

GDB will load and set a breakpoint automatically at the `user_entrypoint` internal Stylus function.
Expand Down Expand Up @@ -146,7 +146,7 @@ Thread 1 "cargo-stylus" hit Breakpoint 2, stylus_hello_world::Counter::increment
For traditional tracing, `cargo stylus` supports calls to `debug_traceTransaction`. To trace a transaction, you can use the following command:

```sh
cargo stylus trace [OPTIONS] --tx <TX>
cargo stylus trace [OPTIONS] --tx <TX> --use-native-tracer
```

Options:
Expand All @@ -162,11 +162,13 @@ Options:
Run the following command to obtain a trace output:

```sh
cargo stylus trace --tx=$TX_HASH --endpoint=$RPC_URL
cargo stylus trace --tx=$TX_HASH --endpoint=$RPC_URL --use-native-tracer
```

This will produce a trace of the functions called and [ink](https://docs.arbitrum.io/stylus/concepts/stylus-gas#ink-and-gas) left along each method:

```sh
[{"args":[0,0,0,4],"endInk":846200000,"name":"user_entrypoint","outs":[],"startInk":846200000},{"args":[],"endInk":846167558,"name":"msg_reentrant","outs":[0,0,0,0],"startInk":846175958},{"args":[],"endInk":846047922,"name":"read_args","outs":[208,157,224,138],"startInk":846061362},{"args":[],"endInk":845914924,"name":"msg_value","outs":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"startInk":845928364},{"args":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"endInk":227196069,"name":"storage_load_bytes32","outs":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"startInk":844944549},{"args":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],"endInk":226716083,"name":"storage_cache_bytes32","outs":[],"startInk":226734563},{"args":[0],"endInk":226418732,"name":"storage_flush_cache","outs":[],"startInk":226486805},{"args":[],"endInk":226362319,"name":"write_result","outs":[],"startInk":226403481},{"args":[],"endInk":846200000,"name":"user_returned","outs":[0,0,0,0],"startInk":846200000}]
```

RPC providers support `debug_traceTransaction` on live networks with the `stylusTracer`. This will allow you to leverage both `cargo stylus replay` and `cargo stylus trace` with their endpoints. See the list of providers that support Stylus tracing [here](https://docs.arbitrum.io/for-devs/dev-tools-and-resources/chain-info#third-party-rpc-providers).
srinjoyc marked this conversation as resolved.
Show resolved Hide resolved
Loading