Thank you for your interest in contributing to the Soroban Debugger project! We welcome contributions from the community and are committed to fostering a collaborative, respectful, and productive environment.
- Getting Started
- Development Workflow
- Code Style & Quality
- Commit Messages
- Pull Request Process
- Issue Guidelines
- Areas for Contribution
- Project Structure
- Code of Conduct
- Communication
To begin contributing:
- Fork the repository on GitHub.
- Clone your fork:
git clone https://github.com/yourusername/soroban-debugger.git
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes (see Development Workflow).
- Test and lint your code.
- Commit your changes with a clear message.
- Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request (PR) against the
mainbranch.
- Rust 1.75 or later
- Soroban CLI (for contract testing)
cargo buildTo run all tests:
cargo testTo run a specific test or test file:
cargo test test_name
cargo test --test integration/basic-testsFuzzing helps discover crashes and panics in critical code paths like WASM parsing and argument parsing.
Prerequisites:
Install cargo-fuzz:
cargo install cargo-fuzzRunning a fuzz target:
# Run WASM loading fuzzer
cargo +nightly fuzz run wasm_loading
# Run argument parser fuzzer
cargo +nightly fuzz run arg_parser
# Run storage key parsing fuzzer
cargo +nightly fuzz run storage_keysBy default, fuzzers run indefinitely. You can limit the execution time with -- -max_total_time=<seconds>.
Tests should be:
- Isolated and repeatable
- Well-named and descriptive
- Covering both typical and edge cases
Add new tests for every new feature or bug fix. Place integration tests in the tests/ directory and unit tests alongside the code in src/.
cargo fmt
cargo clippycargo run -- run --contract path/to/contract.wasm --function function_namePlease follow these guidelines to ensure code consistency and maintainability:
- Formatting:
- Use
cargo fmtbefore committing. Code should be auto-formatted. - Indent with 4 spaces, no tabs.
- Keep lines under 100 characters when possible.
- Use
- Linting:
- Run
cargo clippyand address all warnings before submitting code.
- Run
- Naming:
- Use
snake_casefor variables and function names. - Use
CamelCasefor type and struct names. - Use
SCREAMING_SNAKE_CASEfor constants and statics.
- Use
- Documentation:
- Document all public functions, structs, and modules using Rust doc comments (
///). - Add inline comments for complex logic.
- Document all public functions, structs, and modules using Rust doc comments (
- Testing:
- Write unit and integration tests for new features and bug fixes.
- Place integration tests in the
tests/directory.
- Error Handling:
- Prefer
Result<T, E>over panics for recoverable errors. - Use meaningful error messages.
- Prefer
- General:
- Remove unused code and imports.
- Avoid commented-out code in commits.
- Keep functions small and focused.
We use Conventional Commits for commit messages. This helps automate changelogs and makes the project history easier to understand.
Format:
<type>(optional scope): short summary
[optional body]
[optional footer(s)]
Common types:
- feat: new feature
- fix: bug fix
- docs: documentation changes
- style: formatting, missing semicolons, etc. (no code change)
- refactor: code change that neither fixes a bug nor adds a feature
- perf: performance improvement
- test: adding or correcting tests
- chore: maintenance tasks (build scripts, tooling, etc.)
Examples:
feat: add support for contract breakpoints
fix: resolve panic when loading invalid WASM
docs: update README with new usage example
style: reformat engine.rs for readability
refactor(debugger): extract stepper logic into module
perf: optimize storage inspection for large contracts
test: add integration tests for CLI parser
chore: update dependencies and build scripts
Tips:
- Use the imperative mood (e.g., "add" not "added" or "adds").
- Reference issues or PRs in the footer if relevant (e.g.,
Closes #123).
Quick checklist before submitting a PR:
- All tests pass locally (
cargo test) - Code is formatted (
cargo fmt --all --check) - Clippy is clean (
cargo clippy --all-targets --all-features -- -D warnings) - Commit message follows Conventional Commits
- README links to CONTRIBUTING.md (if relevant to your change)
- PR description mentions the related issue(s)
- Push and open the PR.
- Fill in the PR description with context, motivation, and any related issues.
- Request a review from project maintainers.
- Respond to feedback and make necessary revisions.
- PRs will be merged after approval and successful CI checks.
When reporting a bug, please include:
- Steps to reproduce
- Expected and actual behavior
- Error messages and logs
- Contract WASM file (if relevant)
- Environment details (OS, Rust version, etc.)
When suggesting a feature, please include:
- A clear description of the feature
- Use cases and motivation
- Expected behavior
- Any relevant examples or references
We welcome contributions in the following areas:
Current Focus:
- CLI improvements
- Enhanced error messages
- Storage inspection
- Budget tracking
Upcoming:
- Breakpoint management
- Terminal UI enhancements
- Call stack visualization
- Execution replay
Future:
- WASM instrumentation
- Source map support
- Memory profiling
- Performance analysis
If you have ideas outside these areas, feel free to discuss them by opening an issue.
src/cli/— Command-line interfacesrc/debugger/— Core debugging enginesrc/runtime/— WASM execution environmentsrc/inspector/— State inspection toolssrc/ui/— Terminal user interfacesrc/utils/— Utility functionstests/— Integration testsexamples/— Example usage
We are committed to providing a welcoming and inclusive environment for everyone. All interactions must be respectful and constructive. Please review our Code of Conduct for details.
- For questions, open an issue or start a discussion on GitHub.
- For security concerns, please contact the maintainers directly.
- Join our community channels (if available) for real-time discussion.
Thank you for helping make Soroban Debugger better!