Overview
This guide outlines the process for contributing code changes to Firedancer through pull requests. Following these guidelines helps maintain code quality and ensures your contributions can be reviewed efficiently.Before You Start
Make sure you understand the Firedancer code style guide before submitting a pull request. See the Contributing Guide for details.
Development Environment Setup
Ensure your development environment is properly configured:System requirements
- Linux OS (kernel v4.18 or newer)
- Git with submodule support
- Development dependencies installed via
./deps.sh +dev
Pull Request Guidelines
Code Quality Standards
Before submitting your pull request, ensure your code meets these standards:Code Style Compliance
- Follow the Firedancer code style guide (defined by
src/tango) - Use vertical alignment for improved readability
- Apply proper spacing rules for function calls and control flow
- Use
fd_util_base.htypes instead ofstdint.htypes - Document all public API functions
Testing Requirements
- Add unit tests for new functionality
- Include fuzz tests for security-critical code
- Ensure all existing tests continue to pass
- Add test vectors if contributing to consensus-critical code
Documentation
- Document public API functions with proper comment blocks
- Update relevant documentation files if changing behavior
- Include comments explaining complex logic or non-obvious decisions
Submitting Your Pull Request
Make your changes
- Write clean, well-documented code
- Follow the code style guidelines
- Keep commits atomic and focused
Pull Request Description
Your pull request description should include:- Summary: Brief overview of what the PR accomplishes
- Motivation: Why this change is needed
- Changes: Detailed description of the changes made
- Testing: How you tested the changes
- Related Issues: Link to any related GitHub issues
Code Review Process
What to Expect
The Firedancer team reviews all pull requests. Response times may vary based on complexity and team availability.
- Request changes to meet code style guidelines
- Ask for additional tests or documentation
- Suggest alternative approaches
- Request clarification on design decisions
Responding to Feedback
Special Considerations
Security-Sensitive Changes
If your PR involves:- Cryptographic operations
- Consensus-critical code
- Network protocol changes
- Sandbox/security mechanisms
- More detailed code review
- Requests for additional testing
- Possible security audit requirements
Performance-Critical Changes
For changes affecting performance:- Include benchmark results
- Document performance impact
- Test under realistic workloads
- Consider impact on different hardware configurations
Breaking Changes
If your PR introduces breaking changes:- Clearly mark it as breaking in the PR title
- Document migration path for users
- Discuss with maintainers before implementation
- Ensure compatibility considerations are addressed
Test Vectors
For consensus-critical changes, you may need to add test vectors:Generate fixtures
Create test fixtures using solana-conformance.
Submit to test-vectors
Make a pull request to the test-vectors repository with your new fixtures.
Common Issues
Build Failures
If your PR fails to build:- Ensure you’re using a supported compiler (GCC 8.5+, Clang)
- Verify all dependencies are installed
- Check for platform-specific issues
- Test on a clean clone of the repository
Test Failures
If tests fail:- Run tests locally to reproduce the issue
- Check if failures are related to your changes
- Ensure you haven’t introduced race conditions
- Verify seccomp compatibility if adding syscalls
Code Style Issues
If your code doesn’t match the style:- Review the Contributing Guide
- Look at existing code in
src/tangofor examples - Pay special attention to vertical alignment
- Check spacing rules for functions and control flow
After Merge
Once your pull request is merged:- Your changes will be included in the next release
- You’ll be credited as a contributor
- Your code will be tested in CI and on testnets
Thank you for contributing to Firedancer! Your contributions help make Solana more resilient and performant.