Date: November 19, 2024

By: Walnut (walnut.dev)

Authors: Roman Mazur, Roman Barabanov and Przemek Thomann

Table of Contents

TL;DR:

This document explores the current state of debugging on Arbitrum Stylus, identifying key issues such as low-level trace outputs, lack of support for multi-VM transactions, and limited remote chain debugging.

<aside> ⚠️

Key Challenges discovered:

For more details, read The Current State of Arbitrum Stylus Debugging.

</aside>

<aside> ✅

Walnut’s Proposal for Arbitrum Sprint

For details, see the Roadmap with improvements to Arbitrum Stylus Debugging or open the actual proposal.

</aside>

<aside> 🚀

Future Plans:

Integrate Stylus into walnut.dev – a web-based transaction debugger and simulator with focus on multiVM and interop.

</aside>

The Current State of Arbitrum Stylus Debugging

In this section, we compare debugging experience on Arbitrum Stylus with the experience people have on Ethereum or other more mature chains. This allows us to see the gaps and present potential improvements.

Display transaction trace with cargo stylus trace command

Limitation Description Milestone Proposal
The trace output does not contain user-defined Rust functions. Milestone 1
The trace outputs currently miss details such as contract addresses, entrypoint names, decoded arguments, and results. Milestone 2
Calling cargo stylus trace for a multi-VM transaction that starts with Solidity and then calls Rust Stylus contract results in an error. Milestone 3
The cargo stylus trace command only works with transactions executed on the local Nitro dev node. This prevents developers from obtaining traces for transactions executed on hosted nodes such as mainnet, testnet or other Orbit chains. Milestone 8 (cancelled - in development by other teams)
[Full Interop Endgame] Missing full call trace for multi-VM transaction that involves Solidity and Rust Stylus calls, which would include external contract calls, internal function calls, decoded args and results for both Solidity and Rust. Advanced scenario, to be addressed later.

Debug transaction with cargo stylus replay command

Limitation Description Milestone Proposal
On macOS, cargo stylus replayfails because the Rust plugin for LLDB is missing, limiting variables inspection and line numbers tracking for debugging. Milestone 4 (canceled - already in development by other teams)
In case of multiple Stylus calls, cargo stylus replay only shows debug information for the top level contract. Debug info such as variable states, line numbers etc are missing for nested contract calls. Milestone 4
The cargo stylus replay command fails to replay transactions initiated with a Solidity call followed by a call to Stylus Contract. Milestone 5
Pretty printing for variables, particularly for types like U256, is lacking, which reduces user-friendliness. Milestone 6
The cargo stylus replay command is currently only functional with transactions executed on the local Nitro dev node. This limitation prevents developers from replaying remote transactions on hosted nodes, such as mainnet, testnet or other Orbit chains. Milestone 8 (cancelled - already in development by other teams)
[Full Interop Endgame] The cargo stylus replay command doesn’t support debugging for Stylus transactions involving Solidity contracts, which would present internal steps of the Solidity contracts including variable inspection and line numbers. Advanced scenario, to be addressed later.

Stylus Contract Verification

Limitation Description Milestone Proposal
No ability to publish source code for verification using the cargo stylus verify command N/A