Skip to main content
Thank you for your interest in contributing to Avail! This guide will help you get started with contributing code, documentation, and improvements to the project.

Code of Conduct

Please review and adhere to our Code of Conduct to maintain a respectful and collaborative environment.

Our Standards

We value:
  • Respectfulness - Being considerate of differing opinions and experiences
  • Empathy - Showing understanding towards other community members
  • Collaboration - Working together constructively
  • Professionalism - Maintaining professional conduct in all interactions
  • Responsibility - Taking ownership of actions and their impact
Harassment, discrimination, personal attacks, and unprofessional conduct are not tolerated. Report any concerns to the project team via Discord.

Getting Started

1

Set Up Development Environment

Follow the Building from Source guide to set up your development environment with all necessary dependencies.
2

Explore the Codebase

Familiarize yourself with the project structure:
  • node/ - Node implementation
  • runtime/ - Blockchain runtime
  • pallets/ - Custom pallets (dactr, mandate, system, vector)
  • base/ - Core utilities
  • e2e/ - End-to-end tests
3

Find an Issue

Browse open issues to find something to work on, or create a new issue for bugs or feature requests.

Reporting Issues

If you encounter a bug or have a feature request, please create an issue using the appropriate template.

Bug Reports

When reporting bugs, include:
  • Description - Clear description of the issue
  • Steps to reproduce - Detailed steps to recreate the bug
  • Expected behavior - What should happen
  • Actual behavior - What actually happens
  • Environment - OS, Rust version, node version
  • Logs - Relevant error messages or logs
Use the Bug Report template.

Feature Requests

When requesting features, include:
  • Use case - Why this feature is needed
  • Proposed solution - How it could be implemented
  • Alternatives - Other approaches considered
  • Impact - Who would benefit from this feature
Use the Feature Request template.

Making Changes

Fork and Clone

1

Fork the Repository

Create a fork of the Avail repository to your GitHub account.
2

Clone Your Fork

git clone https://github.com/YOUR_USERNAME/avail.git
cd avail
3

Add Upstream Remote

git remote add upstream https://github.com/availproject/avail.git
git fetch upstream

Create a Branch

Create a descriptive branch for your changes:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description
Use clear branch names that describe the change, such as:
  • feature/add-new-rpc-endpoint
  • fix/resolve-memory-leak
  • refactor/improve-error-handling
  • docs/update-installation-guide

Make Your Changes

Implement your changes following our coding standards:
// Follow Rust conventions and formatting
// Use descriptive names
// Add documentation comments

/// Processes a new block and updates chain state.
///
/// # Arguments
/// * `block` - The block to process
///
/// # Returns
/// Result indicating success or error
pub fn process_block(block: Block) -> Result<(), Error> {
    // Implementation
}

Testing Your Changes

Thoroughly test your changes before submitting:
1

Run Unit Tests

cargo test --release --workspace
2

Run Specific Package Tests

cargo test --release -p package-name
3

Run E2E Tests (if applicable)

cargo build --release --features fast-runtime
./target/release/avail-node --dev
# In another terminal:
cd e2e && cargo test -- --test-threads 1
4

Check Code Quality

# Format code
cargo fmt

# Run linter
cargo clippy

# Verify compilation with features
cargo build --release --features "runtime-benchmarks try-runtime"
See the Testing Guide for detailed information.

Code Quality Standards

Formatting

All code must be formatted with rustfmt:
cargo fmt
Verify formatting:
cargo fmt --check

Linting

Code must pass Clippy without warnings:
cargo clippy
The project uses custom Clippy configuration in Cargo.toml under [workspace.lints.clippy].

Documentation

Add documentation for:
  • Public APIs
  • Complex logic
  • Runtime pallets
  • RPC methods
/// Brief description of the function.
///
/// More detailed explanation if needed.
///
/// # Arguments
/// * `param` - Description of parameter
///
/// # Returns
/// Description of return value
///
/// # Examples
/// ```
/// let result = function_name(param);
/// ```
pub fn function_name(param: Type) -> ReturnType {
    // Implementation
}

Committing Changes

Commit Messages

Write clear, descriptive commit messages:
# Use imperative mood
git commit -m "Add Kate RPC endpoint for proof queries"
git commit -m "Fix memory leak in block processing"
git commit -m "Refactor transaction validation logic"
git commit -m "Update documentation for RPC methods"

Commit Guidelines

  • Keep commits focused and atomic
  • One logical change per commit
  • Reference issue numbers when applicable: Fix #123: Resolve node crash on startup
  • Provide context in the commit body for complex changes

Submitting a Pull Request

1

Push Your Branch

git push origin feature/your-feature-name
2

Create Pull Request

Go to GitHub and create a pull request from your fork to the main repository.
3

Fill Out PR Template

Complete the pull request template with:
  • Type: Feature, Bugfix, Refactor, Documentation, Testing, etc.
  • Description: Summarize changes and motivation
  • Related Issues: Link to related issues (e.g., “Closes #123”)
  • Testing Performed: Describe testing approach
  • Checklist: Verify all items are completed
4

Address Review Feedback

Respond to reviewer comments and make requested changes:
# Make changes based on feedback
git add .
git commit -m "Address review feedback"
git push origin feature/your-feature-name

Pull Request Checklist

Before submitting, ensure:
  • Code is formatted: cargo fmt
  • Tests pass: cargo test --release --workspace
  • Clippy passes: cargo clippy
  • Builds successfully: cargo build --release
  • Builds with features: cargo build --release --features runtime-benchmarks
  • Self-review completed
  • Documentation updated (if needed)
  • Commit messages are clear
We prioritize substantial contributions over minor changes. For larger contributions, consider reaching out through Discord to discuss your plans.

Review Process

What to Expect

  1. Initial Review - A maintainer will review your PR within a few days
  2. Feedback - You may receive requests for changes or clarifications
  3. Iteration - Address feedback and push updates
  4. Approval - Once approved, your PR will be merged

Review Criteria

Reviewers check for:
  • Code quality and style
  • Test coverage
  • Performance implications
  • Security considerations
  • Documentation completeness
  • Breaking changes

Types of Contributions

Code Contributions

Features

New functionality, pallets, RPC endpoints, or capabilities

Bug Fixes

Corrections for issues, crashes, or incorrect behavior

Performance

Optimizations and efficiency improvements

Refactoring

Code structure improvements without changing functionality

Non-Code Contributions

Documentation

Guides, API docs, examples, and tutorials

Testing

Additional test coverage and test infrastructure

Issue Triage

Helping categorize and respond to issues

Community Support

Answering questions on Discord and GitHub

Development Workflow

Keeping Your Fork Updated

Regularly sync with the upstream repository:
# Fetch upstream changes
git fetch upstream

# Update your main branch
git checkout main
git merge upstream/main
git push origin main

# Rebase your feature branch
git checkout feature/your-feature-name
git rebase main

Handling Merge Conflicts

If conflicts arise:
# Update from main
git fetch upstream
git rebase upstream/main

# Resolve conflicts in affected files
# Then continue rebase
git add .
git rebase --continue

# Force push to update PR
git push --force-with-lease origin feature/your-feature-name

Security

For security vulnerabilities:
Do not create public issues for security vulnerabilities. Report them privately according to our Security Policy.

Documentation Contributions

For documentation updates:
  1. Documentation website code: availproject.github.io
  2. Code documentation: In-line comments and doc comments in this repository
  3. Wiki: GitHub Wiki

Getting Help

If you need assistance:

Recognition

Contributors are recognized in:
  • Git commit history
  • Release notes
  • Community highlights
Thank you for contributing to Avail! Your contributions help make the project better for everyone.

Additional Resources

Building from Source

Complete guide to building the Avail node

Running Tests

Testing infrastructure and best practices

GitHub Repository

Visit the main repository

Project Wiki

Additional documentation and guides

Build docs developers (and LLMs) love