From 4cd420e038ced51bb9e5cebd0c14b9b7b6b0c55c Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Fri, 20 Jun 2025 19:28:40 +0900 Subject: [PATCH 01/13] refactor: make more fancy repository --- .github/ISSUE_TEMPLATE/bug_report.yml | 121 ++++++ .github/ISSUE_TEMPLATE/documentation.yml | 102 ++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 109 ++++++ .github/PULL_REQUEST_TEMPLATE.md | 101 +++++ .github/workflows/quality.yml | 214 +++++++++++ .github/workflows/release.yml | 243 ++++++++++++ CODE_OF_CONDUCT.md | 128 +++++++ CONTRIBUTING.md | 240 ++++++++++++ LICENSE | 205 +++++++++++ README.md | 407 +++++++++++++++------ SECURITY.md | 104 ++++++ scripts/install.sh | 221 +++++++++++ 12 files changed, 2077 insertions(+), 118 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/release.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 SECURITY.md create mode 100755 scripts/install.sh diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..7709711 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,121 @@ +name: Bug Report +description: File a bug report to help us improve +title: "[Bug]: " +labels: ["bug", "triage"] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! ๐Ÿ› + + Please search existing issues before creating a new one to avoid duplicates. + + - type: input + id: mitosis-version + attributes: + label: Mitosis Chain Version + description: What version of Mitosis Chain are you running? + placeholder: v1.0.0 or commit hash + validations: + required: true + + - type: dropdown + id: environment + attributes: + label: Environment + description: What environment are you running on? + options: + - Localnet + - Devnet + - Testnet + - Mainnet + - Custom + validations: + required: true + + - type: input + id: os + attributes: + label: Operating System + description: What operating system are you using? + placeholder: Ubuntu 22.04, macOS 13.5, Windows 11, etc. + validations: + required: true + + - type: input + id: go-version + attributes: + label: Go Version + description: What version of Go are you using? + placeholder: go version go1.21.5 linux/amd64 + validations: + required: false + + - type: textarea + id: what-happened + attributes: + label: What happened? + description: A clear and concise description of what the bug is. + placeholder: Describe the bug... + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: What did you expect to happen? + placeholder: Describe what you expected to happen... + validations: + required: true + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to Reproduce + description: Please provide detailed steps to reproduce the issue. + placeholder: | + 1. Run command `...` + 2. Set configuration `...` + 3. Observe error `...` + validations: + required: true + + - type: textarea + id: logs + attributes: + label: Logs + description: Please copy and paste any relevant log output. + render: shell + placeholder: Paste your logs here... + validations: + required: false + + - type: textarea + id: config + attributes: + label: Configuration + description: Please provide relevant configuration files or settings. + render: yaml + placeholder: Paste your configuration here... + validations: + required: false + + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Add any other context about the problem here. + placeholder: Any additional information that might be helpful... + validations: + required: false + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000..91aaa8c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,102 @@ +name: Documentation +description: Report missing, unclear, or incorrect documentation +title: "[Docs]: " +labels: ["documentation", "good first issue"] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for helping us improve our documentation! ๐Ÿ“š + + Clear documentation is essential for a great developer experience. + + - type: dropdown + id: doc-type + attributes: + label: Documentation Type + description: What type of documentation needs improvement? + options: + - README + - API Documentation + - Setup Guide + - CLI Documentation + - Code Comments + - Tutorial + - FAQ + - Other + validations: + required: true + + - type: input + id: page-url + attributes: + label: Documentation Page/File + description: Link to the documentation page or file path that needs improvement + placeholder: https://docs.mitosis.org/... or path/to/file.md + validations: + required: false + + - type: dropdown + id: issue-type + attributes: + label: Issue Type + description: What kind of documentation issue is this? + options: + - Missing documentation + - Incorrect information + - Unclear instructions + - Outdated content + - Typo/Grammar + - Broken links + - Missing examples + - Poor organization + validations: + required: true + + - type: textarea + id: current-content + attributes: + label: Current Content + description: What does the current documentation say? (copy/paste relevant sections) + render: markdown + placeholder: Paste current documentation content here... + validations: + required: false + + - type: textarea + id: suggested-improvement + attributes: + label: Suggested Improvement + description: How should the documentation be improved? + placeholder: The documentation should explain... + validations: + required: true + + - type: textarea + id: context + attributes: + label: Additional Context + description: | + Why is this improvement needed? What confusion does the current documentation cause? + placeholder: This would help developers who... + validations: + required: false + + - type: checkboxes + id: contribution + attributes: + label: Contribution + description: Would you like to contribute to fixing this documentation issue? + options: + - label: I'd like to work on this documentation improvement + required: false + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..e89e3a7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,109 @@ +name: Feature Request +description: Suggest an idea for this project +title: "[Feature]: " +labels: ["enhancement", "triage"] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to suggest a new feature! ๐Ÿš€ + + Please search existing issues and discussions before creating a new feature request. + + - type: textarea + id: problem + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + placeholder: I'm always frustrated when... + validations: + required: false + + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + placeholder: I would like... + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + placeholder: I've also considered... + validations: + required: false + + - type: dropdown + id: feature-type + attributes: + label: Feature Type + description: What type of feature is this? + options: + - CLI Enhancement + - Consensus Layer + - EVM Integration + - Performance Improvement + - Developer Experience + - Documentation + - Testing + - Infrastructure + - Security + - Other + validations: + required: true + + - type: dropdown + id: priority + attributes: + label: Priority + description: How important is this feature to you? + options: + - Nice to have + - Important + - Critical + validations: + required: true + + - type: textarea + id: use-cases + attributes: + label: Use Cases + description: Describe specific use cases where this feature would be beneficial. + placeholder: | + - As a validator operator, I want to... + - As a developer, I need to... + - As a user, I would like to... + validations: + required: true + + - type: textarea + id: implementation + attributes: + label: Implementation Ideas + description: If you have ideas about how this could be implemented, please share them. + placeholder: This could be implemented by... + validations: + required: false + + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Add any other context, screenshots, or examples about the feature request here. + placeholder: Any additional information... + validations: + required: false + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1184de4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,101 @@ +## Summary + + + +## Type of Change + + + +- [ ] ๐Ÿ› Bug fix (non-breaking change which fixes an issue) +- [ ] โœจ New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ’ฅ Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] ๐Ÿ“š Documentation update +- [ ] ๐ŸŽจ Code style/refactoring (no functional changes) +- [ ] โšก Performance improvement +- [ ] ๐Ÿ”ง Chore (maintenance, dependencies, etc.) +- [ ] ๐Ÿงช Test improvements + +## Changes Made + + + +- +- +- + +## Related Issues + + + +Fixes #(issue number) + +## Testing + + + +### Test Environment +- [ ] Localnet +- [ ] Devnet +- [ ] Testnet + +### Test Commands +```bash +# Add the commands you used to test +make test +make test-integration +``` + +### Test Results + + +## Breaking Changes + + + +- [ ] No breaking changes +- [ ] Breaking changes (describe below) + + + +## Checklist + + + +### Code Quality +- [ ] My code follows the project's style guidelines +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] My changes generate no new warnings + +### Testing +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] I have tested the changes on localnet/devnet + +### Documentation +- [ ] I have made corresponding changes to the documentation +- [ ] I have updated the CLI help text if applicable +- [ ] I have added/updated code comments where necessary + +### Dependencies +- [ ] I have checked that no new dependencies were introduced unnecessarily +- [ ] All dependencies are properly licensed and documented + +## Screenshots/Demos + + + +## Additional Notes + + + +## Reviewer Guidelines + + + +Please ensure: +- [ ] Code follows project conventions +- [ ] Changes are well-tested +- [ ] Documentation is updated +- [ ] Breaking changes are clearly documented +- [ ] Security implications are considered \ No newline at end of file diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..9b20781 --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,214 @@ +name: Quality Checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + security-events: write + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --timeout=10m + + security: + name: Security Scan + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Run Gosec Security Scanner + uses: securecodewarrior/github-action-add-sarif@v1 + with: + sarif-file: gosec.sarif + continue-on-error: true + + - name: Run govulncheck + run: | + go install golang.org/x/vuln/cmd/govulncheck@latest + govulncheck ./... + + dependency-check: + name: Dependency Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Verify dependencies + run: | + go mod tidy + git diff --exit-code go.mod go.sum + + - name: Check for known vulnerabilities + run: | + go install golang.org/x/vuln/cmd/govulncheck@latest + govulncheck ./... + + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.21', '1.22'] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + cache: true + + - name: Run tests + run: | + go test -v -race -coverprofile=coverage.out ./... + + - name: Generate test coverage report + if: matrix.go-version == '1.21' + run: | + go tool cover -html=coverage.out -o coverage.html + + - name: Upload coverage reports + if: matrix.go-version == '1.21' + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: coverage.html + + - name: Check test coverage + if: matrix.go-version == '1.21' + run: | + COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') + echo "Total test coverage: ${COVERAGE}%" + if (( $(echo "$COVERAGE < 60" | bc -l) )); then + echo "โŒ Test coverage is below 60%" + exit 1 + else + echo "โœ… Test coverage is above 60%" + fi + + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, darwin] + goarch: [amd64, arm64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Build binaries + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + # Build mitosisd + go build -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd + + # Build mito CLI + go build -o build/mito-${GOOS}-${GOARCH} ./cmd/mito + + # Build midevtool + go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} + path: build/* + + benchmark: + name: Benchmark + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Run benchmarks + run: | + go test -bench=. -benchmem -run=^$ ./... > benchmark.txt + echo "๐Ÿ“Š Benchmark Results:" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat benchmark.txt >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + quality-gate: + name: Quality Gate + runs-on: ubuntu-latest + needs: [lint, security, dependency-check, test, build] + if: always() + steps: + - name: Check all jobs + run: | + echo "Lint: ${{ needs.lint.result }}" + echo "Security: ${{ needs.security.result }}" + echo "Dependency Check: ${{ needs.dependency-check.result }}" + echo "Test: ${{ needs.test.result }}" + echo "Build: ${{ needs.build.result }}" + + if [[ "${{ needs.lint.result }}" != "success" || + "${{ needs.security.result }}" != "success" || + "${{ needs.dependency-check.result }}" != "success" || + "${{ needs.test.result }}" != "success" || + "${{ needs.build.result }}" != "success" ]]; then + echo "โŒ Quality gate failed" + exit 1 + else + echo "โœ… Quality gate passed" + fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3a1baba --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,243 @@ +name: Release + +on: + push: + tags: + - 'v*' # mitosisd releases (vX.Y.Z) + - 'mito/v*' # mito CLI releases (mito/vX.Y.Z) + +permissions: + contents: write + packages: write + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + os: [linux, darwin] + arch: [amd64, arm64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Determine release type and version + id: release_info + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + + if [[ "${TAG_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "RELEASE_TYPE=mitosisd" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "BINARY_NAME=mitosisd" >> $GITHUB_OUTPUT + elif [[ "${TAG_NAME}" =~ ^mito/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "RELEASE_TYPE=mito" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT + echo "BINARY_NAME=mito" >> $GITHUB_OUTPUT + else + echo "โŒ Invalid tag format: ${TAG_NAME}" + exit 1 + fi + + - name: Build mitosisd + if: steps.release_info.outputs.RELEASE_TYPE == 'mitosisd' + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + VERSION: ${{ steps.release_info.outputs.VERSION }} + run: | + echo "๐Ÿ”จ Building mitosisd ${VERSION} for ${GOOS}-${GOARCH}" + go build -ldflags="-X main.version=${VERSION} -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION}" \ + -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd + + - name: Build mito CLI + if: steps.release_info.outputs.RELEASE_TYPE == 'mito' + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + VERSION: ${{ steps.release_info.outputs.VERSION }} + run: | + echo "๐Ÿ”จ Building mito CLI ${VERSION} for ${GOOS}-${GOARCH}" + go build -ldflags="-X main.version=${VERSION}" \ + -o build/mito-${GOOS}-${GOARCH} ./cmd/mito + + - name: Create checksums + run: | + cd build + for file in *; do + sha256sum "$file" > "$file.sha256" + done + + - name: Upload binaries + uses: actions/upload-artifact@v3 + with: + name: binaries-${{ steps.release_info.outputs.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }} + path: build/* + + create-release: + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Determine release info + id: release_info + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + + if [[ "${TAG_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "RELEASE_TYPE=mitosisd" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "COMPONENT_NAME=Mitosis Chain Node (mitosisd)" >> $GITHUB_OUTPUT + echo "DESCRIPTION=The core blockchain node for Mitosis Chain. Handles consensus, networking, and blockchain state management." >> $GITHUB_OUTPUT + elif [[ "${TAG_NAME}" =~ ^mito/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "RELEASE_TYPE=mito" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT + echo "COMPONENT_NAME=Mito CLI" >> $GITHUB_OUTPUT + echo "DESCRIPTION=Command-line interface for Mitosis Chain. Manage validators, transactions, and interact with the blockchain." >> $GITHUB_OUTPUT + fi + + - name: Download all artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Organize artifacts + run: | + mkdir -p release + find artifacts -type f -exec cp {} release/ \; + + - name: Generate changelog + id: changelog + run: | + # Get previous tag for the same component + if [[ "${{ steps.release_info.outputs.RELEASE_TYPE }}" == "mitosisd" ]]; then + PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.release_info.outputs.TAG_NAME }}" | head -n1) + else + PREV_TAG=$(git tag --sort=-version:refname | grep -E '^mito/v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.release_info.outputs.TAG_NAME }}" | head -n1) + fi + + if [ -z "$PREV_TAG" ]; then + PREV_TAG=$(git rev-list --max-parents=0 HEAD) + fi + + echo "CHANGELOG<> $GITHUB_OUTPUT + echo "## What's Changed" >> $GITHUB_OUTPUT + if [[ "${{ steps.release_info.outputs.RELEASE_TYPE }}" == "mitosisd" ]]; then + echo "### Node (mitosisd) Changes" >> $GITHUB_OUTPUT + git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mitosisd/ app/ x/ >> $GITHUB_OUTPUT + else + echo "### CLI (mito) Changes" >> $GITHUB_OUTPUT + git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mito/ >> $GITHUB_OUTPUT + fi + echo "" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: release/* + body: | + # ${{ steps.release_info.outputs.COMPONENT_NAME }} ${{ steps.release_info.outputs.VERSION }} + + ${{ steps.release_info.outputs.DESCRIPTION }} + + ${{ steps.changelog.outputs.CHANGELOG }} + + ## ๐Ÿ“ฅ Installation + + ### Quick Install (Linux/macOS) + ```bash + # For mitosisd + curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + + # For mito CLI only + VERSION="${{ steps.release_info.outputs.VERSION }}" COMPONENT="mito" \ + curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + ``` + + ### Manual Download + Download the appropriate binary for your platform from the assets below: + + | Platform | Architecture | Download | + |----------|--------------|----------| + | Linux | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-linux-amd64) | + | Linux | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-linux-arm64) | + | macOS | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-darwin-amd64) | + | macOS | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-darwin-arm64) | + + ## ๐Ÿ” Verification + + All binaries include SHA256 checksums. Verify your download: + ```bash + sha256sum -c .sha256 + ``` + + ## ๐Ÿ“– Documentation + + - [Setup Guide](https://docs.mitosis.org/setup) + - [CLI Reference](https://docs.mitosis.org/cli) + - [Upgrade Guide](https://docs.mitosis.org/upgrade) + + ## ๐Ÿ†• What's New in This Release + + ${{ steps.changelog.outputs.CHANGELOG }} + draft: false + prerelease: ${{ contains(steps.release_info.outputs.VERSION, 'alpha') || contains(steps.release_info.outputs.VERSION, 'beta') || contains(steps.release_info.outputs.VERSION, 'rc') }} + generate_release_notes: true + + docker: + needs: [create-release] + runs-on: ubuntu-latest + # Only build Docker images for mitosisd releases + if: startsWith(github.ref, 'refs/tags/v') + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..4b33ce9 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +community@mitosis.org. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ec44933 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,240 @@ +# Contributing to Mitosis Chain + +Welcome to Mitosis Chain! We're excited to have you contribute to the next-generation modular blockchain infrastructure. This guide will help you get started with contributing to our project. + +## ๐ŸŽฏ Quick Start + +### Prerequisites + +- Go 1.21 or higher +- Node.js 18+ (for frontend tools) +- Git +- Docker (for running devnet) + +### Development Setup + +1. **Fork and Clone** + ```bash + git clone https://github.com/YOUR_USERNAME/chain.git + cd chain + git remote add upstream https://github.com/mitosis-org/chain.git + ``` + +2. **Setup Development Environment** + ```bash + # Fetch submodules + git submodule update --init --recursive + + # Setup localnet (for testing) + make setup-geth + make setup-mitosisd + ``` + +3. **Verify Installation** + ```bash + make test + make build + ``` + +## ๐Ÿ”„ Development Workflow + +### 1. Create a Feature Branch +```bash +git checkout -b feature/your-feature-name +``` + +### 2. Make Changes +- Write your code following our coding standards +- Add tests for new functionality +- Update documentation if needed + +### 3. Test Your Changes +```bash +# Run unit tests +make test + +# Run integration tests +make test-integration + +# Run linting +make lint + +# Test localnet setup +make localnet-test +``` + +### 4. Commit Your Changes +We follow [Conventional Commits](https://www.conventionalcommits.org/) specification: + +```bash +git commit -m "feat: add new validator management feature" +git commit -m "fix: resolve consensus layer sync issue" +git commit -m "docs: update API documentation" +git commit -m "test: add unit tests for evmvalidator module" +``` + +**Commit Types:** +- `feat`: New features +- `fix`: Bug fixes +- `docs`: Documentation changes +- `style`: Code style changes (formatting, etc.) +- `refactor`: Code refactoring +- `test`: Adding or updating tests +- `chore`: Build process or auxiliary tool changes + +### 5. Push and Create Pull Request +```bash +git push origin feature/your-feature-name +``` + +Then create a Pull Request through GitHub with: +- Clear title and description +- Reference any related issues +- Include screenshots/demos if applicable + +## ๐Ÿ“ Coding Standards + +### Go Code Style +- Follow the [official Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) +- Use `gofmt` and `goimports` for formatting +- Write meaningful variable and function names +- Add comments for exported functions and complex logic + +### Solidity Code Style +- Follow our [Solidity Style Guide](.cursor/rules/shared-rules/solidity/reference/coinbase-style-guide.mdc) +- Use ERC7201 for storage patterns +- Implement comprehensive tests for all contracts + +### Project Structure +``` +chain/ +โ”œโ”€โ”€ app/ # Cosmos SDK app configuration +โ”œโ”€โ”€ cmd/ # CLI applications +โ”œโ”€โ”€ x/ # Custom Cosmos SDK modules +โ”œโ”€โ”€ types/ # Common types +โ”œโ”€โ”€ proto/ # Protocol buffer definitions +โ”œโ”€โ”€ infra/ # Infrastructure and deployment +โ””โ”€โ”€ scripts/ # Build and utility scripts +``` + +## ๐Ÿงช Testing Guidelines + +### Unit Tests +- Write tests for all new functions +- Aim for >80% code coverage +- Use table-driven tests where appropriate +- Mock external dependencies + +### Integration Tests +- Test module interactions +- Verify end-to-end workflows +- Include both happy path and error cases + +### Example Test Structure +```go +func TestValidatorCreation(t *testing.T) { + tests := []struct { + name string + input ValidatorInput + want Validator + wantErr bool + }{ + { + name: "valid validator creation", + input: ValidatorInput{...}, + want: Validator{...}, + wantErr: false, + }, + // Add more test cases + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test implementation + }) + } +} +``` + +## ๐Ÿ› Bug Reports + +When filing a bug report, please include: + +1. **Environment Information** + - Operating system and version + - Go version + - Mitosis Chain version + +2. **Steps to Reproduce** + - Clear, numbered steps + - Expected vs actual behavior + - Relevant logs or error messages + +3. **Additional Context** + - Screenshots if applicable + - Configuration files + - Related issues or PRs + +## ๐Ÿ’ก Feature Requests + +For new features: + +1. **Check existing issues** to avoid duplicates +2. **Describe the use case** and problem you're solving +3. **Propose a solution** with technical details +4. **Consider breaking changes** and backward compatibility + +## ๐Ÿ“– Documentation + +- Update relevant documentation with your changes +- Follow markdown best practices +- Include code examples where helpful +- Update the changelog for significant changes + +### Documentation Types +- **README.md**: Project overview and quick start +- **API Documentation**: Generated from code comments +- **User Guides**: Step-by-step instructions +- **Developer Guides**: Technical implementation details + +## ๐Ÿ” Code Review Process + +### For Contributors +- Respond to review feedback promptly +- Make requested changes in new commits +- Keep discussions focused and constructive + +### For Reviewers +- Be constructive and respectful +- Focus on code quality, security, and maintainability +- Approve when satisfied with the changes + +## ๐Ÿ† Recognition + +Contributors are recognized through: +- **Contributor list** in our README +- **Release notes** acknowledgments +- **Community highlights** in our social channels + +## ๐Ÿค Community Guidelines + +- Be respectful and inclusive +- Help newcomers get started +- Share knowledge and best practices +- Follow our [Code of Conduct](CODE_OF_CONDUCT.md) + +## ๐Ÿ†˜ Getting Help + +- **GitHub Discussions**: Technical questions and ideas +- **Discord**: Real-time community chat +- **Issues**: Bug reports and feature requests + +## ๐Ÿ“š Additional Resources + +- [Cosmos SDK Documentation](https://docs.cosmos.network/) +- [Go Documentation](https://golang.org/doc/) +- [Mitosis Chain Documentation](https://docs.mitosis.org/) + +--- + +Thank you for contributing to Mitosis Chain! Your efforts help build the future of modular blockchain infrastructure. ๐Ÿš€ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3beae9c --- /dev/null +++ b/LICENSE @@ -0,0 +1,205 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(which shall not include communication that is conspicuously +marked or otherwise designated in writing by the copyright owner +as "Not a Work"). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based upon (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and derivative works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to use, reproduce, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Work, and to +permit persons to whom the Work is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Work. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, trademark, patent, +attribution and other notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright notice to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Support. You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or support. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright 2024 Mitosis Labs + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index ee4eb70..ed84319 100644 --- a/README.md +++ b/README.md @@ -1,187 +1,358 @@ -# Mitosis Chain +
+ Mitosis Chain + + # Mitosis Chain + **โšก Next-Generation Modular Blockchain Infrastructure** + + [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) + [![Go Report Card](https://goreportcard.com/badge/github.com/mitosis-org/chain)](https://goreportcard.com/report/github.com/mitosis-org/chain) + [![CI](https://github.com/mitosis-org/chain/workflows/CI/badge.svg)](https://github.com/mitosis-org/chain/actions) + [![Quality Gate](https://github.com/mitosis-org/chain/workflows/Quality%20Checks/badge.svg)](https://github.com/mitosis-org/chain/actions) + + [๐Ÿš€ Quick Start](#-quick-start) โ€ข + [๐Ÿ“– Documentation](https://docs.mitosis.org) โ€ข + [๐Ÿ’ฌ Community](#-community) โ€ข + [๐ŸŽฏ Roadmap](#-roadmap) โ€ข + [๐Ÿค Contributing](CONTRIBUTING.md) +
-## Architecture +--- + +## โœจ Why Mitosis Chain? + + + + + + + +
+ +### ๐Ÿ”ง **Developer-First** +Full EVM compatibility with Cosmos SDK power. Run your Ethereum dApps without changes while leveraging advanced Cosmos features. + + + +### โšก **High Performance** +Modular architecture separates execution from consensus. Optimized for DeFi and cross-chain operations with minimal latency. + + + +### ๐Ÿ›ก๏ธ **Battle-Tested** +Built on proven technologies: Cosmos SDK, CometBFT, and EVM. Security-focused design with regular audits. + +
+ +## ๐Ÿš€ Quick Start + +### One-Line Installation + +#### Install Mitosis Chain Node (mitosisd) +```bash +# Latest mitosisd (blockchain node) +curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + +# Specific version +VERSION=v1.0.0 curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash +``` + +#### Install Mito CLI (validator management) +```bash +# Latest mito CLI +COMPONENT=mito curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + +# Specific version +COMPONENT=mito VERSION=v1.0.0 curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash +``` + +### Manual Installation + +#### For Mitosis Chain Node (mitosisd) +```bash +# Download latest mitosisd release (vX.Y.Z) +wget https://github.com/mitosis-org/chain/releases/latest/download/mitosisd-linux-amd64 +chmod +x mitosisd-linux-amd64 && mv mitosisd-linux-amd64 /usr/local/bin/mitosisd + +# Initialize and start node +mitosisd init my-node --chain-id mitosis-mainnet-1 +mitosisd start +``` + +#### For Mito CLI +```bash +# Download latest mito CLI release (mito/vX.Y.Z) +wget $(curl -s https://api.github.com/repos/mitosis-org/chain/releases | grep browser_download_url | grep mito/v | grep linux-amd64 | head -n1 | cut -d'"' -f4) +chmod +x mito-linux-amd64 && mv mito-linux-amd64 /usr/local/bin/mito + +# Configure and use +mito config set-rpc https://rpc.mitosis.org +mito version +``` + +### Using Docker +```bash +# Run Mitosis Chain Node (mitosisd only) +docker run -p 26657:26657 -p 8545:8545 ghcr.io/mitosis-org/chain:latest +``` + +## ๐Ÿ—๏ธ Architecture ### Overview ![architecture.png](assets/architecture.png) -The Mitosis Chain employs a modular architecture that separates execution from consensus. +Mitosis Chain employs a **modular architecture** that separates execution from consensus, providing the best of both Ethereum and Cosmos ecosystems. + +
+๐Ÿ” Detailed Architecture -- The execution layer is fully EVM-compatible, enabling unmodified Ethereum execution clients to process transactions, manage state, and execute smart contracts. -- The consensus layer is built upon the Cosmos SDK and utilizes CometBFT for consensus. -- The two layers communicate with each other using [Engine API](https://hackmd.io/@danielrachi/engine_api). The consensus layer utilizes [Octane](https://github.com/omni-network/omni/tree/main/octane) for Engine API implementation. +- **Execution Layer**: Fully EVM-compatible, enabling unmodified Ethereum execution clients +- **Consensus Layer**: Built upon Cosmos SDK with CometBFT for Byzantine fault tolerance +- **Communication**: Uses [Engine API](https://hackmd.io/@danielrachi/engine_api) via [Octane](https://github.com/omni-network/omni/tree/main/octane) +- **Design Philosophy**: Keep consensus layer thin, implement logic in EVM smart contracts -Most of our logic exists on the execution layer, while the consensus layer is kept thin by having only minimal code and responsibilities for consensus. +
### Validator & Governance System -In most Cosmos SDK-based chains, validator and governance systems are built using `x/staking`, `x/slashing`, `x/distribution`, and `x/gov` modules provided by Cosmos SDK. -However, we don't use all of them. We implement most of the necessary logic as smart contracts in the EVM (execution layer). \ -For example: -- A user stakes and delegates $MITO to a validator on EVM. -- An operator creates and operates a validator on EVM. -- Staking rewards are distributed on EVM. -- For governance, users cast votes and proposals are executed on EVM. +Unlike traditional Cosmos chains, Mitosis implements **most logic as EVM smart contracts**: -The contracts manage all user flows and serve as the source of truth. -Some information from the contracts is delivered to the consensus layer through EVM logs on `ConsensusValidatorEntrypoint` and `ConsensusGovernanceEntrypoint` contracts. -When an EVM block has been created and finalized on the consensus layer, the consensus layer parses and processes the EVM logs in the block. +| Component | Traditional Cosmos | Mitosis Chain | +|-----------|-------------------|---------------| +| Staking | `x/staking` module | EVM Smart Contract | +| Delegation | `x/staking` module | EVM Smart Contract | +| Rewards | `x/distribution` module | EVM Smart Contract | +| Governance | `x/gov` module | EVM Smart Contract | + +**Benefits:** +- ๐ŸŽฏ **Unified Development**: Single language (Solidity) for all logic +- โšก **Better UX**: Standard Ethereum tooling and wallets +- ๐Ÿ”„ **Easier Upgrades**: Contract upgrades vs. chain upgrades ### Core Modules + + + + + + +
+ #### `x/evmengine` (forked from Octane) +- Communicates with execution client via Engine API +- Wraps EVM blocks into consensus transactions +- Seamlessly integrates with other modules -This module communicates with an execution client through Engine API and wraps an EVM block into one transaction in the consensus layer. -Note that there can only be one transaction wrapped from an EVM block, and other types of transactions are prohibited in a consensus block. \ -This module is forked from [Octane](https://github.com/omni-network/omni/tree/main/octane). There are limited changes from the upstream for seamless integration with `x/evmvalidator` and `x/evmgov`. + #### `x/evmvalidator` +- Manages validator set from EVM contract state +- Lightweight replacement for `x/staking` +- Integrates with `x/slashing` and `x/evidence` -This module manages a validator set on the consensus layer. Note that there are no features such as delegation and reward distribution because those features are implemented in contracts on EVM. -Most states are managed in the EVM contracts, and this module simply applies validator set changes and consensus voting power updates delivered from `ConsensusValidatorEntrypoint`. \ -We could say this module is a lightweight version of `x/staking` that has EVM contracts as the source of truth. -This module also implements some parts of interfaces of `x/staking` to integrate with `x/slashing` and `x/evidence`. + #### `x/evmgov` +- Enables arbitrary message execution from EVM +- Governance parameters controlled by smart contracts +- Minimal overhead compared to `x/gov` -This module provides arbitrary message execution from EVM. Governance on EVM can trigger arbitrary message execution against consensus layer modules. It can be used for cases such as module parameter changes. -It is very lightweight compared to `x/gov` because there are no concepts such as proposals and voting power. -These concepts are implemented in EVM contracts, and this module simply executes arbitrary messages delivered from `ConsensusGovernanceEntrypoint`. +
-## Setup +## ๐Ÿ› ๏ธ Development -We categorize environments for setup into: -- **Localnet** - - Localnet is for fast development and testing iterations in local environment. - - It runs a single validator for the mitosis chain. -- **Devnet** - - Devnet is for development and testing with complete form of the components. - - It runs two validator nodes and a non-validator node for the mitosis chain. +### Prerequisites -**Chain IDs** -- **Localnet** - - Chain ID (EVM): `124899` - - Chain ID (Cosmos SDK): `mitosis-localnet-1` -- **Devnet** - - Chain ID (EVM): `124864` - - Chain ID (Cosmos SDK): `mitosis-devnet-1` +- **Go 1.21+** +- **Node.js 18+** (for tooling) +- **Docker** (for devnet) +- **Git** with submodules -### Localnet - -You should run an execution client (`geth` or `reth`) and an consensus client (`mitosisd`) both. +### Setup Development Environment +```bash +# Clone repository +git clone https://github.com/mitosis-org/chain.git +cd chain -Pre-requisites +# Fetch submodules +git submodule update --init --recursive -Make sure you have fetched the GitHub submodules: +# Build binaries +make build -```sh -git submodule update --init --recursive +# Run tests +make test ``` -Setup and run an execution client (`geth` or `reth`): +### Network Environments -```bash -# It initializes geth. If there was already initialized, it remove all old data and re-initialize it. -make setup-geth # or `make setup-reth` +| Environment | Purpose | Chain ID (EVM) | Chain ID (Cosmos) | +|-------------|---------|----------------|-------------------| +| **Localnet** | Local development | `124899` | `mitosis-localnet-1` | +| **Devnet** | Integration testing | `124864` | `mitosis-devnet-1` | +| **Testnet** | Public testing | TBD | TBD | +| **Mainnet** | Production | TBD | TBD | -# Note that it just tries to use existing data instead of setting up geth automatically. -# You should run `setup-geth` if you haven't initialized geth yet or want to reset it. -make run-geth # or `make setup-reth` -``` +
+๐Ÿ“‹ Localnet Setup -Setup and run an consensus client (`mitosisd`): ```bash -# It initializes mitosisd. If there was already initialized, it remove all old data and re-initialize it. -make setup-mitosisd +# Setup execution client +make setup-geth # or make setup-reth +make run-geth -# Note that it just tries to use existing data instead of setting up mitosisd automatically. -# You should run `setup-mitosisd` if you haven't initialized mitosisd yet or want to reset it. +# Setup consensus client +make setup-mitosisd make run-mitosisd -``` -Remove all data (reset) of `geth` and `mitosisd`: -```bash -# Note that it won't be working as expected if you clean up only one of geth and mitosisd. -make clean-geth # or `make clean-reth` -make clean-mitosisd -``` - -Deploy & Setup consensus entrypoint contracts: -```bash -# Run this command in https://github.com/mitosis-org/protocol to deploy the consensus entrypoint contracts. -# The deployed address would be: -# - ConsensusGovernanceEntrypoint: 0x06c9918ff483fd88C65dD02E788427cfF04545b9 -# - ConsensusValidatorEntrypoint : 0x9866D79EF3e9c0c22Db2b55877013e13a60AD478 +# Deploy contracts (in protocol repo) ./tools/deploy-consensus-entrypoints.sh -# Note that `ConsensusGovernanceEntrypoint` address is managed in `app.toml`: -# [evmgov] -# entrypoint = "0x06c9918ff483fd88C65dD02E788427cfF04545b9" - -# Update `ConsensusValidatorEntrypoint` address in x/evmvalidator module. +# Update contract addresses ./build/midevtool governance execute \ --entrypoint 0x06c9918ff483fd88C65dD02E788427cfF04545b9 \ --private-key 0x5a496832ac0d7a484e6996301a5511dbc3b723d037bc61261ecaf425bd6a5b37 \ --msg '[{"@type":"/mitosis.evmvalidator.v1.MsgUpdateValidatorEntrypointContractAddr","authority":"mito1g86pactsvfrcglkvqzvdwkxhjshafu280q95p7","addr":"0x9866D79EF3e9c0c22Db2b55877013e13a60AD478"}]' ``` -### Devnet +
+ +
+๐Ÿณ Devnet Setup -#### Build a dockerfile for mitosisd ```bash +# Build Docker image make devnet-build -``` -#### Setup and run the mitosis chain -```bash -# Init a mitosis chain. -# It prepares a genesis file for the mitosis chain. +# Initialize chain make devnet-init -# Run nodes for a mitosis chain. +# Start all services make devnet-up -# Check the status of the nodes. +# Check status docker logs mitosis-devnet-node-mitosisd-1 -docker logs mitosis-devnet-node-reth-1 - -# Check geth rpc is working properly. cast block-number --rpc-url http://localhost:18545 -# You can use `curl` instead if `cast` is not installed. -curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":124864}' http://localhost:18545 -``` -#### Deploy consensus entrypoint contracts: -```bash -# Run this command in https://github.com/mitosis-org/protocol to deploy the consensus entrypoint contracts. -# The deployed address would be: -# - ConsensusGovernanceEntrypoint: 0x06c9918ff483fd88C65dD02E788427cfF04545b9 -# - ConsensusValidatorEntrypoint : 0x9866D79EF3e9c0c22Db2b55877013e13a60AD478 -RPC_URL="http://127.0.0.1:18545" ./tools/deploy-consensus-entrypoints.sh +# Create validator +make devnet-create-validator + +# Stop and clean +make devnet-down +make devnet-clean ``` -#### Create a validator for the mitosis chain +
+ +## ๐Ÿ”ง Tools & CLI + +### MITO CLI + +Powerful command-line interface for validator operations and blockchain interaction. + ```bash -# It creates a validator for the `subval` node. -# Note that it setup `ConsensusValidatorEntrypoint` address automatically. -make devnet-create-validator +# Install +go install github.com/mitosis-org/chain/cmd/mito@latest + +# Configure +mito config set-rpc https://rpc.mitosis.org +mito config set-contract --validator-manager 0xECF7658978A03b3A35C2c5B33C449D74E8151Db0 + +# Create validator +mito tx send validator create \ + --pubkey 0x1234... \ + --operator 0x5678... \ + --commission-rate 5% \ + --initial-collateral 1.5 \ + --account my-validator + +# Query validator +mito query validator info --address 0x1234... ``` -#### Stop the mitosis chain and reset the data -```bash -# It stops the nodes. -# You can start them again with keeping existing data through `make devnet-up`. -make devnet-down +[๐Ÿ“– **Full CLI Documentation**](cmd/mito/README.md) +## ๐Ÿค Contributing + +We welcome contributions from the community! Check out our [Contributing Guide](CONTRIBUTING.md) to get started. + +### Ways to Contribute + +- ๐Ÿ› **Report bugs** via [GitHub Issues](https://github.com/mitosis-org/chain/issues) +- โœจ **Suggest features** via [GitHub Discussions](https://github.com/mitosis-org/chain/discussions) +- ๐Ÿ“š **Improve documentation** (great for first-time contributors!) +- ๐Ÿงช **Write tests** and improve test coverage +- ๐Ÿ” **Security research** via our [Security Policy](SECURITY.md) + +### Development Workflow + +1. **Fork** the repository +2. **Create** a feature branch (`git checkout -b feature/amazing-feature`) +3. **Commit** your changes (`git commit -m 'feat: add amazing feature'`) +4. **Push** to the branch (`git push origin feature/amazing-feature`) +5. **Open** a Pull Request + +## ๐Ÿ’ฌ Community + + + + + + + + +
+ +### ๐Ÿ’ญ **Discord** +Real-time discussions
+*Coming Soon* + +
+ +### ๐Ÿฆ **Twitter** +Updates & announcements
+*Coming Soon* + +
+ +### ๐Ÿ“ **GitHub** +Code & issues
+[mitosis-org/chain](https://github.com/mitosis-org/chain) + +
+ +### ๐Ÿ“– **Docs** +Technical documentation
+[docs.mitosis.org](https://docs.mitosis.org) + +
+ +## ๐Ÿ“ License + +This project is licensed under the [Apache License 2.0](LICENSE). -# It stops all nodes and removes all data of the nodes. -# It also removes the initialization data which is created by `make devnet-init`. -make devnet-clean ``` +Copyright 2024 Mitosis Labs + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +``` + +## ๐Ÿ™ Acknowledgments + +Special thanks to: +- [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) team for the robust blockchain framework +- [CometBFT](https://github.com/cometbft/cometbft) for Byzantine fault-tolerant consensus +- [Octane](https://github.com/omni-network/omni/tree/main/octane) for EVM-Engine API integration +- All our [contributors](https://github.com/mitosis-org/chain/graphs/contributors) ๐Ÿš€ + +--- + +
-## Tools +**[โญ Star this repo](https://github.com/mitosis-org/chain) โ€ข [๐Ÿด Fork it](https://github.com/mitosis-org/chain/fork) โ€ข [๐Ÿš€ Deploy it](https://docs.mitosis.org/deploy)** -### Validator Operations +*Built with โค๏ธ by the Mitosis community* -For managing validators in the Mitosis network, please see the [MITO CLI documentation](cmd/mito/README.md). +
diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..aecfb91 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,104 @@ +# Security Policy + +## Supported Versions + +We actively support and provide security updates for the following versions of Mitosis Chain: + +| Version | Supported | +| ------- | ------------------ | +| main | :white_check_mark: | +| latest | :white_check_mark: | +| < 1.0 | :x: | + +## Reporting a Vulnerability + +The Mitosis Chain team takes security vulnerabilities seriously. We appreciate your efforts to responsibly disclose any vulnerabilities you find. + +### How to Report + +**Please do NOT report security vulnerabilities through public GitHub issues.** + +Instead, please report them via one of the following methods: + +1. **Email**: Send details to [security@mitosis.org](mailto:security@mitosis.org) +2. **GitHub Security Advisories**: Use the [private vulnerability reporting feature](https://github.com/mitosis-org/chain/security/advisories/new) + +### What to Include + +When reporting a vulnerability, please include: + +- Type of issue (e.g., buffer overflow, SQL injection, cross-site scripting, etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue + +### Response Timeline + +- **Initial Response**: We will acknowledge receipt of your vulnerability report within 48 hours +- **Investigation**: We will investigate and validate the vulnerability within 7 days +- **Resolution**: We will work on a fix and provide updates on our progress +- **Disclosure**: We will coordinate with you on the disclosure timeline + +### Responsible Disclosure + +We believe in responsible disclosure and ask that you: + +- Give us reasonable time to investigate and fix the issue before public disclosure +- Do not access, modify, or delete data that doesn't belong to you +- Do not perform any actions that could negatively impact other users +- Do not publicly disclose the vulnerability until we have addressed it + +### Security Features + +Mitosis Chain implements several security measures: + +- **Code Audits**: Regular security audits of critical components +- **Dependency Scanning**: Automated scanning for known vulnerabilities in dependencies +- **Static Analysis**: Continuous static code analysis for security issues +- **Access Controls**: Strict access controls for critical infrastructure +- **Encryption**: All sensitive data is encrypted at rest and in transit + +### Security Best Practices for Users + +When using Mitosis Chain, please follow these security best practices: + +1. **Keep Software Updated**: Always use the latest supported version +2. **Secure Private Keys**: Never share private keys or store them in unsecured locations +3. **Network Security**: Use secure networks and VPNs when possible +4. **Backup Strategy**: Implement proper backup strategies for critical data +5. **Monitor Activity**: Regularly monitor your validator and transaction activity + +### Security Advisories + +We will publish security advisories for any vulnerabilities that could affect users: + +- **GitHub Security Advisories**: Published on our GitHub repository +- **Community Channels**: Announced in our Discord and Telegram channels +- **Documentation**: Updated security guidance in our documentation + +### Bug Bounty Program + +We are planning to launch a bug bounty program to reward security researchers who help us identify vulnerabilities. Details will be announced soon. + +### Contact Information + +For security-related questions or concerns: + +- **Email**: [security@mitosis.org](mailto:security@mitosis.org) +- **PGP Key**: [Available here](https://keybase.io/mitosis/pgp_keys.asc) (Coming Soon) + +### Legal Safe Harbor + +Mitosis Labs will not pursue legal action against security researchers who: + +- Follow this responsible disclosure process +- Act in good faith +- Do not violate any laws +- Do not access or modify data beyond what is necessary to demonstrate the vulnerability + +--- + +Thank you for helping us keep Mitosis Chain secure! ๐Ÿ”’ \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..abf2769 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,221 @@ +#!/bin/bash + +# Mitosis Chain Installation Script +# Usage: +# curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash +# COMPONENT=mito curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + +set -e + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Configuration +REPO="mitosis-org/chain" +INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" +VERSION="${VERSION:-latest}" +COMPONENT="${COMPONENT:-mitosisd}" # Default to mitosisd, can be 'mito' + +# Utility functions +log() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +warn() { + echo -e "${YELLOW}[WARN]${NC} $1" +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" + exit 1 +} + +# Detect platform +detect_platform() { + local os arch + + case "$(uname -s)" in + Linux*) os="linux" ;; + Darwin*) os="darwin" ;; + *) error "Unsupported OS: $(uname -s)" ;; + esac + + case "$(uname -m)" in + x86_64) arch="amd64" ;; + arm64|aarch64) arch="arm64" ;; + *) error "Unsupported architecture: $(uname -m)" ;; + esac + + echo "${os}-${arch}" +} + +# Get latest release version for component +get_latest_version() { + local component="$1" + local version + + if [[ "$component" == "mito" ]]; then + # Get latest mito release (mito/vX.Y.Z) + version=$(curl -s "https://api.github.com/repos/${REPO}/releases" | \ + grep '"tag_name":' | \ + grep '"mito/' | \ + head -n1 | \ + cut -d'"' -f4 | \ + sed 's/mito\///') + else + # Get latest mitosisd release (vX.Y.Z) + version=$(curl -s "https://api.github.com/repos/${REPO}/releases" | \ + grep '"tag_name":' | \ + grep -v '"mito/' | \ + head -n1 | \ + cut -d'"' -f4) + fi + + if [[ -z "$version" ]]; then + error "Failed to get latest version for ${component}" + fi + echo "$version" +} + +# Get tag name for component and version +get_tag_name() { + local component="$1" + local version="$2" + + if [[ "$component" == "mito" ]]; then + echo "mito/${version}" + else + echo "${version}" + fi +} + +# Download and install binary +install_binary() { + local binary="$1" + local platform="$2" + local tag_name="$3" + local url="https://github.com/${REPO}/releases/download/${tag_name}/${binary}-${platform}" + + log "Downloading ${binary} from tag ${tag_name} for ${platform}..." + + # Create temporary directory + local temp_dir + temp_dir=$(mktemp -d) + cd "$temp_dir" + + # Download binary + if command -v curl >/dev/null 2>&1; then + curl -L -o "$binary" "$url" + elif command -v wget >/dev/null 2>&1; then + wget -O "$binary" "$url" + else + error "curl or wget is required" + fi + + # Download checksum + if command -v curl >/dev/null 2>&1; then + curl -L -o "${binary}.sha256" "${url}.sha256" + elif command -v wget >/dev/null 2>&1; then + wget -O "${binary}.sha256" "${url}.sha256" + fi + + # Verify checksum + if command -v sha256sum >/dev/null 2>&1; then + sha256sum -c "${binary}.sha256" || error "Checksum verification failed" + elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 -c "${binary}.sha256" || error "Checksum verification failed" + else + warn "Cannot verify checksum: sha256sum or shasum not found" + fi + + # Make executable + chmod +x "$binary" + + # Install to target directory + if [[ -w "$INSTALL_DIR" ]]; then + mv "$binary" "$INSTALL_DIR/" + else + log "Installing to $INSTALL_DIR (requires sudo)" + sudo mv "$binary" "$INSTALL_DIR/" + fi + + # Cleanup + cd / + rm -rf "$temp_dir" + + log "Successfully installed ${binary} to ${INSTALL_DIR}/${binary}" +} + +# Main installation function +main() { + log "๐Ÿš€ Installing Mitosis Chain component: ${COMPONENT}" + + # Validate component + if [[ "$COMPONENT" != "mitosisd" && "$COMPONENT" != "mito" ]]; then + error "Invalid component: ${COMPONENT}. Must be 'mitosisd' or 'mito'" + fi + + # Check prerequisites + if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then + error "curl or wget is required" + fi + + # Detect platform + local platform + platform=$(detect_platform) + log "Detected platform: $platform" + + # Get version + if [[ "$VERSION" == "latest" ]]; then + VERSION=$(get_latest_version "$COMPONENT") + fi + log "Installing version: $VERSION" + + # Get tag name + local tag_name + tag_name=$(get_tag_name "$COMPONENT" "$VERSION") + log "Using release tag: $tag_name" + + # Install binary + install_binary "$COMPONENT" "$platform" "$tag_name" + + log "โœ… Installation complete!" + echo + + # Show component-specific next steps + if [[ "$COMPONENT" == "mitosisd" ]]; then + log "๐ŸŽฏ Next steps for Mitosis Chain Node:" + echo " 1. Initialize your node: mitosisd init [moniker] --chain-id mitosis-mainnet-1" + echo " 2. Start the node: mitosisd start" + echo " 3. Check version: mitosisd version" + echo " 4. View logs: mitosisd start --log_level info" + else + log "๐ŸŽฏ Next steps for Mito CLI:" + echo " 1. Configure RPC: mito config set-rpc https://rpc.mitosis.org" + echo " 2. Set contracts: mito config set-contract --validator-manager 0x..." + echo " 3. Check version: mito version" + echo " 4. View help: mito --help" + fi + + echo + log "๐Ÿ“– Documentation: https://docs.mitosis.org" + log "๐Ÿ’ฌ Community: https://discord.gg/mitosis" + + # Show installation info for other component + if [[ "$COMPONENT" == "mitosisd" ]]; then + echo + log "๐Ÿ’ก To install the Mito CLI separately:" + echo " COMPONENT=mito curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash" + else + echo + log "๐Ÿ’ก To install the Mitosis Chain Node separately:" + echo " curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash" + fi +} + +# Run main function +main "$@" \ No newline at end of file From 6a488c34c81417bbb978b96e7d7c066eef164ace Mon Sep 17 00:00:00 2001 From: Suho Lee Date: Mon, 23 Jun 2025 18:02:24 +0900 Subject: [PATCH 02/13] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20GitHub=20Action?= =?UTF-8?q?s=20workflows=20for=20Mito=20CLI=20and=20Mitosisd=20releases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Introduced `release-mito.yml` for automating Mito CLI releases, including version extraction, binary building, checksum creation, and GitHub release creation. - Added `release-mitosisd.yml` for Mitosisd releases, featuring similar automation steps tailored for the blockchain node, including Docker image build and push. - Both workflows support multiple OS and architecture builds, enhancing CI/CD efficiency for the Mitosis project. --- .github/workflows/release-mito.yml | 151 ++++++++++++++++++ .../{release.yml => release-mitosisd.yml} | 94 +++-------- 2 files changed, 172 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/release-mito.yml rename .github/workflows/{release.yml => release-mitosisd.yml} (51%) diff --git a/.github/workflows/release-mito.yml b/.github/workflows/release-mito.yml new file mode 100644 index 0000000..e49b2c6 --- /dev/null +++ b/.github/workflows/release-mito.yml @@ -0,0 +1,151 @@ +name: Release Mito CLI + +on: + push: + tags: + - 'mito/v*' # mito CLI releases (mito/vX.Y.Z) + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + os: [linux, darwin] + arch: [amd64, arm64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Extract version + id: version + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT + + - name: Build mito CLI + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + VERSION: ${{ steps.version.outputs.VERSION }} + run: | + echo "๐Ÿ”จ Building mito CLI ${VERSION} for ${GOOS}-${GOARCH}" + go build -ldflags="-X main.version=${VERSION}" \ + -o build/mito-${GOOS}-${GOARCH} ./cmd/mito + + - name: Create checksums + run: | + cd build + for file in *; do + sha256sum "$file" > "$file.sha256" + done + + - name: Upload binaries + uses: actions/upload-artifact@v3 + with: + name: binaries-mito-${{ matrix.os }}-${{ matrix.arch }} + path: build/* + + create-release: + needs: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Extract version + id: version + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT + + - name: Download all artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Organize artifacts + run: | + mkdir -p release + find artifacts -type f -exec cp {} release/ \; + + - name: Generate changelog + id: changelog + run: | + # Get previous mito CLI tag + PREV_TAG=$(git tag --sort=-version:refname | grep -E '^mito/v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.version.outputs.TAG_NAME }}" | head -n1) + + if [ -z "$PREV_TAG" ]; then + PREV_TAG=$(git rev-list --max-parents=0 HEAD) + fi + + echo "CHANGELOG<> $GITHUB_OUTPUT + echo "## What's Changed" >> $GITHUB_OUTPUT + echo "### CLI (mito) Changes" >> $GITHUB_OUTPUT + git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mito/ >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: release/* + body: | + # Mito CLI ${{ steps.version.outputs.VERSION }} + + Command-line interface for Mitosis Chain. Manage validators, transactions, and interact with the blockchain. + + ${{ steps.changelog.outputs.CHANGELOG }} + + ## ๐Ÿ“ฅ Installation + + ### Quick Install (Linux/macOS) + ```bash + VERSION="${{ steps.version.outputs.VERSION }}" COMPONENT="mito" \ + curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + ``` + + ### Manual Download + Download the appropriate binary for your platform from the assets below: + + | Platform | Architecture | Download | + |----------|--------------|----------| + | Linux | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mito-linux-amd64) | + | Linux | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mito-linux-arm64) | + | macOS | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mito-darwin-amd64) | + | macOS | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mito-darwin-arm64) | + + ## ๐Ÿ” Verification + + All binaries include SHA256 checksums. Verify your download: + ```bash + sha256sum -c .sha256 + ``` + + ## ๐Ÿ“– Documentation + + - [CLI Reference](https://docs.mitosis.org/cli) + - [User Guide](https://docs.mitosis.org/guide) + - [Commands Reference](https://docs.mitosis.org/commands) + + ## ๐Ÿ†• What's New in This Release + + ${{ steps.changelog.outputs.CHANGELOG }} + draft: false + prerelease: ${{ contains(steps.version.outputs.VERSION, 'alpha') || contains(steps.version.outputs.VERSION, 'beta') || contains(steps.version.outputs.VERSION, 'rc') }} + generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release-mitosisd.yml similarity index 51% rename from .github/workflows/release.yml rename to .github/workflows/release-mitosisd.yml index 3a1baba..9a030a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-mitosisd.yml @@ -1,10 +1,9 @@ -name: Release +name: Release Mitosisd on: push: tags: - 'v*' # mitosisd releases (vX.Y.Z) - - 'mito/v*' # mito CLI releases (mito/vX.Y.Z) permissions: contents: write @@ -30,47 +29,23 @@ jobs: go-version-file: '.go-version' cache: true - - name: Determine release type and version - id: release_info + - name: Extract version + id: version run: | TAG_NAME=${GITHUB_REF#refs/tags/} echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT - - if [[ "${TAG_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then - echo "RELEASE_TYPE=mitosisd" >> $GITHUB_OUTPUT - echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT - echo "BINARY_NAME=mitosisd" >> $GITHUB_OUTPUT - elif [[ "${TAG_NAME}" =~ ^mito/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then - echo "RELEASE_TYPE=mito" >> $GITHUB_OUTPUT - echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT - echo "BINARY_NAME=mito" >> $GITHUB_OUTPUT - else - echo "โŒ Invalid tag format: ${TAG_NAME}" - exit 1 - fi + echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT - name: Build mitosisd - if: steps.release_info.outputs.RELEASE_TYPE == 'mitosisd' env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} - VERSION: ${{ steps.release_info.outputs.VERSION }} + VERSION: ${{ steps.version.outputs.VERSION }} run: | echo "๐Ÿ”จ Building mitosisd ${VERSION} for ${GOOS}-${GOARCH}" go build -ldflags="-X main.version=${VERSION} -X github.com/cosmos/cosmos-sdk/version.Version=${VERSION}" \ -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd - - name: Build mito CLI - if: steps.release_info.outputs.RELEASE_TYPE == 'mito' - env: - GOOS: ${{ matrix.os }} - GOARCH: ${{ matrix.arch }} - VERSION: ${{ steps.release_info.outputs.VERSION }} - run: | - echo "๐Ÿ”จ Building mito CLI ${VERSION} for ${GOOS}-${GOARCH}" - go build -ldflags="-X main.version=${VERSION}" \ - -o build/mito-${GOOS}-${GOARCH} ./cmd/mito - - name: Create checksums run: | cd build @@ -81,7 +56,7 @@ jobs: - name: Upload binaries uses: actions/upload-artifact@v3 with: - name: binaries-${{ steps.release_info.outputs.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }} + name: binaries-mitosisd-${{ matrix.os }}-${{ matrix.arch }} path: build/* create-release: @@ -93,23 +68,12 @@ jobs: with: fetch-depth: 0 - - name: Determine release info - id: release_info + - name: Extract version + id: version run: | TAG_NAME=${GITHUB_REF#refs/tags/} echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT - - if [[ "${TAG_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then - echo "RELEASE_TYPE=mitosisd" >> $GITHUB_OUTPUT - echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT - echo "COMPONENT_NAME=Mitosis Chain Node (mitosisd)" >> $GITHUB_OUTPUT - echo "DESCRIPTION=The core blockchain node for Mitosis Chain. Handles consensus, networking, and blockchain state management." >> $GITHUB_OUTPUT - elif [[ "${TAG_NAME}" =~ ^mito/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then - echo "RELEASE_TYPE=mito" >> $GITHUB_OUTPUT - echo "VERSION=${TAG_NAME#mito/}" >> $GITHUB_OUTPUT - echo "COMPONENT_NAME=Mito CLI" >> $GITHUB_OUTPUT - echo "DESCRIPTION=Command-line interface for Mitosis Chain. Manage validators, transactions, and interact with the blockchain." >> $GITHUB_OUTPUT - fi + echo "VERSION=${TAG_NAME}" >> $GITHUB_OUTPUT - name: Download all artifacts uses: actions/download-artifact@v3 @@ -124,12 +88,8 @@ jobs: - name: Generate changelog id: changelog run: | - # Get previous tag for the same component - if [[ "${{ steps.release_info.outputs.RELEASE_TYPE }}" == "mitosisd" ]]; then - PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.release_info.outputs.TAG_NAME }}" | head -n1) - else - PREV_TAG=$(git tag --sort=-version:refname | grep -E '^mito/v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.release_info.outputs.TAG_NAME }}" | head -n1) - fi + # Get previous mitosisd tag + PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | grep -v "${{ steps.version.outputs.TAG_NAME }}" | head -n1) if [ -z "$PREV_TAG" ]; then PREV_TAG=$(git rev-list --max-parents=0 HEAD) @@ -137,13 +97,8 @@ jobs: echo "CHANGELOG<> $GITHUB_OUTPUT echo "## What's Changed" >> $GITHUB_OUTPUT - if [[ "${{ steps.release_info.outputs.RELEASE_TYPE }}" == "mitosisd" ]]; then - echo "### Node (mitosisd) Changes" >> $GITHUB_OUTPUT - git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mitosisd/ app/ x/ >> $GITHUB_OUTPUT - else - echo "### CLI (mito) Changes" >> $GITHUB_OUTPUT - git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mito/ >> $GITHUB_OUTPUT - fi + echo "### Node (mitosisd) Changes" >> $GITHUB_OUTPUT + git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD -- cmd/mitosisd/ app/ x/ >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -152,9 +107,9 @@ jobs: with: files: release/* body: | - # ${{ steps.release_info.outputs.COMPONENT_NAME }} ${{ steps.release_info.outputs.VERSION }} + # Mitosis Chain Node (mitosisd) ${{ steps.version.outputs.VERSION }} - ${{ steps.release_info.outputs.DESCRIPTION }} + The core blockchain node for Mitosis Chain. Handles consensus, networking, and blockchain state management. ${{ steps.changelog.outputs.CHANGELOG }} @@ -162,11 +117,6 @@ jobs: ### Quick Install (Linux/macOS) ```bash - # For mitosisd - curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash - - # For mito CLI only - VERSION="${{ steps.release_info.outputs.VERSION }}" COMPONENT="mito" \ curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash ``` @@ -175,10 +125,10 @@ jobs: | Platform | Architecture | Download | |----------|--------------|----------| - | Linux | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-linux-amd64) | - | Linux | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-linux-arm64) | - | macOS | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-darwin-amd64) | - | macOS | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.release_info.outputs.TAG_NAME }}/${{ steps.release_info.outputs.RELEASE_TYPE }}-darwin-arm64) | + | Linux | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mitosisd-linux-amd64) | + | Linux | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mitosisd-linux-arm64) | + | macOS | x86_64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mitosisd-darwin-amd64) | + | macOS | ARM64 | [Download](https://github.com/mitosis-org/chain/releases/download/${{ steps.version.outputs.TAG_NAME }}/mitosisd-darwin-arm64) | ## ๐Ÿ” Verification @@ -190,21 +140,19 @@ jobs: ## ๐Ÿ“– Documentation - [Setup Guide](https://docs.mitosis.org/setup) - - [CLI Reference](https://docs.mitosis.org/cli) + - [Node Operation Guide](https://docs.mitosis.org/node) - [Upgrade Guide](https://docs.mitosis.org/upgrade) ## ๐Ÿ†• What's New in This Release ${{ steps.changelog.outputs.CHANGELOG }} draft: false - prerelease: ${{ contains(steps.release_info.outputs.VERSION, 'alpha') || contains(steps.release_info.outputs.VERSION, 'beta') || contains(steps.release_info.outputs.VERSION, 'rc') }} + prerelease: ${{ contains(steps.version.outputs.VERSION, 'alpha') || contains(steps.version.outputs.VERSION, 'beta') || contains(steps.version.outputs.VERSION, 'rc') }} generate_release_notes: true docker: needs: [create-release] runs-on: ubuntu-latest - # Only build Docker images for mitosisd releases - if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v4 From e46383b9733588d7c2b02fda3dd742caf8c0e896 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Mon, 23 Jun 2025 20:59:32 +0900 Subject: [PATCH 03/13] chore: remove submodule checkout from GitHub Actions workflows - Eliminated the `submodules: recursive` option from the checkout steps in `quality.yml`, `release-mito.yml`, and `release-mitosisd.yml` workflows to streamline the CI/CD process. - This change simplifies the workflow configuration and reduces potential issues related to submodule management. --- .github/workflows/quality.yml | 8 -------- .github/workflows/release-mito.yml | 1 - .github/workflows/release-mitosisd.yml | 3 --- 3 files changed, 12 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 9b20781..1737269 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -17,8 +17,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Go uses: actions/setup-go@v4 @@ -88,8 +86,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v4 @@ -135,8 +131,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Go uses: actions/setup-go@v4 @@ -171,8 +165,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Go uses: actions/setup-go@v4 diff --git a/.github/workflows/release-mito.yml b/.github/workflows/release-mito.yml index e49b2c6..cbd05e5 100644 --- a/.github/workflows/release-mito.yml +++ b/.github/workflows/release-mito.yml @@ -20,7 +20,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive - name: Set up Go uses: actions/setup-go@v4 diff --git a/.github/workflows/release-mitosisd.yml b/.github/workflows/release-mitosisd.yml index 9a030a3..5e09734 100644 --- a/.github/workflows/release-mitosisd.yml +++ b/.github/workflows/release-mitosisd.yml @@ -21,7 +21,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive - name: Set up Go uses: actions/setup-go@v4 @@ -156,8 +155,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 0722dac65de896b1dcde8f147bdd2132cf833115 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 02:06:38 +0900 Subject: [PATCH 04/13] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20GitHub=20Action?= =?UTF-8?q?s=20workflows=20for=20benchmarking,=20building,=20linting,=20te?= =?UTF-8?q?sting,=20and=20security=20scanning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Introduced new workflows: `benchmark.yml`, `build.yml`, `lint.yml`, `test.yml`, `security.yml`, and `quality-gate.yml` to enhance CI/CD processes. - The `benchmark.yml` workflow runs performance benchmarks on pull requests. - The `build.yml` workflow supports multi-platform builds for binaries. - The `lint.yml` workflow implements code linting using `golangci-lint`. - The `test.yml` workflow executes tests with coverage reporting. - The `security.yml` workflow performs security scans using Gosec and checks for known vulnerabilities. - The `quality-gate.yml` workflow ensures all quality checks pass before merging. - Removed the deprecated `quality.yml` workflow to streamline the configuration. --- .github/workflows/benchmark.yml | 30 +++++ .github/workflows/build.yml | 48 +++++++ .github/workflows/lint.yml | 35 +++++ .github/workflows/quality-gate.yml | 94 +++++++++++++ .github/workflows/quality.yml | 206 ----------------------------- .github/workflows/security.yml | 83 ++++++++++++ .github/workflows/test.yml | 55 ++++++++ 7 files changed, 345 insertions(+), 206 deletions(-) create mode 100644 .github/workflows/benchmark.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/quality-gate.yml delete mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/security.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..5d20026 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,30 @@ +name: Benchmark + +on: + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + benchmark: + name: Performance Benchmark + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Run benchmarks + run: | + go test -bench=. -benchmem -run=^$ ./... > benchmark.txt + echo "๐Ÿ“Š Benchmark Results:" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat benchmark.txt >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d45d70e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + build: + name: Multi-Platform Build + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, darwin] + goarch: [amd64, arm64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Build binaries + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + # Build mitosisd + go build -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd + + # Build mito CLI + go build -o build/mito-${GOOS}-${GOARCH} ./cmd/mito + + # Build midevtool + go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} + path: build/* \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3f5b157 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + lint: + name: Code Linting + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --timeout=10m + + - name: Verify dependencies + run: | + go mod tidy + git diff --exit-code go.mod go.sum \ No newline at end of file diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml new file mode 100644 index 0000000..6c19fed --- /dev/null +++ b/.github/workflows/quality-gate.yml @@ -0,0 +1,94 @@ +name: Quality Gate + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + quality-gate: + name: Quality Gate + runs-on: ubuntu-latest + # Wait for all quality workflows to complete + needs: [] + steps: + - name: Wait for all quality checks + uses: actions/github-script@v6 + with: + script: | + const { owner, repo } = context.repo; + const { sha } = context.payload.pull_request?.head || context.payload; + + // Define required workflows + const requiredWorkflows = ['Lint', 'Security', 'Test', 'Build']; + + // Add benchmark check for PRs + if (context.eventName === 'pull_request') { + requiredWorkflows.push('Benchmark'); + } + + console.log(`Checking workflows for commit: ${sha}`); + console.log(`Required workflows: ${requiredWorkflows.join(', ')}`); + + // Wait for workflows to complete + let allPassed = true; + const maxWaitTime = 30 * 60 * 1000; // 30 minutes + const startTime = Date.now(); + + while (Date.now() - startTime < maxWaitTime) { + const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ + owner, + repo, + head_sha: sha, + status: 'completed' + }); + + const completedWorkflows = runs.workflow_runs + .filter(run => requiredWorkflows.includes(run.name)) + .reduce((acc, run) => { + acc[run.name] = run.conclusion; + return acc; + }, {}); + + console.log('Completed workflows:', completedWorkflows); + + // Check if all required workflows are completed + const allCompleted = requiredWorkflows.every(name => + completedWorkflows.hasOwnProperty(name) + ); + + if (allCompleted) { + // Check if all passed + allPassed = requiredWorkflows.every(name => + completedWorkflows[name] === 'success' + ); + break; + } + + // Wait 30 seconds before checking again + await new Promise(resolve => setTimeout(resolve, 30000)); + } + + if (!allPassed) { + core.setFailed('โŒ Quality gate failed - some workflows did not pass'); + } else { + console.log('โœ… Quality gate passed - all workflows successful'); + } + + - name: Quality Gate Summary + run: | + echo "## ๐ŸŽฏ Quality Gate Results" >> $GITHUB_STEP_SUMMARY + echo "All required quality checks have been completed and passed." >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Checked Workflows:" >> $GITHUB_STEP_SUMMARY + echo "- โœ… Lint" >> $GITHUB_STEP_SUMMARY + echo "- โœ… Security" >> $GITHUB_STEP_SUMMARY + echo "- โœ… Test" >> $GITHUB_STEP_SUMMARY + echo "- โœ… Build" >> $GITHUB_STEP_SUMMARY + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "- โœ… Benchmark" >> $GITHUB_STEP_SUMMARY + fi \ No newline at end of file diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml deleted file mode 100644 index 1737269..0000000 --- a/.github/workflows/quality.yml +++ /dev/null @@ -1,206 +0,0 @@ -name: Quality Checks - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -permissions: - contents: read - security-events: write - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest - args: --timeout=10m - - security: - name: Security Scan - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Run Gosec Security Scanner - uses: securecodewarrior/github-action-add-sarif@v1 - with: - sarif-file: gosec.sarif - continue-on-error: true - - - name: Run govulncheck - run: | - go install golang.org/x/vuln/cmd/govulncheck@latest - govulncheck ./... - - dependency-check: - name: Dependency Check - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Verify dependencies - run: | - go mod tidy - git diff --exit-code go.mod go.sum - - - name: Check for known vulnerabilities - run: | - go install golang.org/x/vuln/cmd/govulncheck@latest - govulncheck ./... - - test: - name: Test - runs-on: ubuntu-latest - strategy: - matrix: - go-version: ['1.21', '1.22'] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - cache: true - - - name: Run tests - run: | - go test -v -race -coverprofile=coverage.out ./... - - - name: Generate test coverage report - if: matrix.go-version == '1.21' - run: | - go tool cover -html=coverage.out -o coverage.html - - - name: Upload coverage reports - if: matrix.go-version == '1.21' - uses: actions/upload-artifact@v3 - with: - name: coverage-report - path: coverage.html - - - name: Check test coverage - if: matrix.go-version == '1.21' - run: | - COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') - echo "Total test coverage: ${COVERAGE}%" - if (( $(echo "$COVERAGE < 60" | bc -l) )); then - echo "โŒ Test coverage is below 60%" - exit 1 - else - echo "โœ… Test coverage is above 60%" - fi - - build: - name: Build - runs-on: ubuntu-latest - strategy: - matrix: - goos: [linux, darwin] - goarch: [amd64, arm64] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Build binaries - env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - run: | - # Build mitosisd - go build -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd - - # Build mito CLI - go build -o build/mito-${GOOS}-${GOARCH} ./cmd/mito - - # Build midevtool - go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool - - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} - path: build/* - - benchmark: - name: Benchmark - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Run benchmarks - run: | - go test -bench=. -benchmem -run=^$ ./... > benchmark.txt - echo "๐Ÿ“Š Benchmark Results:" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat benchmark.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - - quality-gate: - name: Quality Gate - runs-on: ubuntu-latest - needs: [lint, security, dependency-check, test, build] - if: always() - steps: - - name: Check all jobs - run: | - echo "Lint: ${{ needs.lint.result }}" - echo "Security: ${{ needs.security.result }}" - echo "Dependency Check: ${{ needs.dependency-check.result }}" - echo "Test: ${{ needs.test.result }}" - echo "Build: ${{ needs.build.result }}" - - if [[ "${{ needs.lint.result }}" != "success" || - "${{ needs.security.result }}" != "success" || - "${{ needs.dependency-check.result }}" != "success" || - "${{ needs.test.result }}" != "success" || - "${{ needs.build.result }}" != "success" ]]; then - echo "โŒ Quality gate failed" - exit 1 - else - echo "โœ… Quality gate passed" - fi \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..d605bb3 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,83 @@ +name: Security + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + security-events: write + +jobs: + security-scan: + name: Security Scan + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Install Gosec + run: | + go install github.com/securego/gosec/v2/cmd/gosec@latest + + - name: Run Gosec Security Scanner + run: | + gosec -fmt sarif -out gosec.sarif ./... + continue-on-error: true + + - name: Add Security Training Context + if: always() && hashFiles('gosec.sarif') != '' + uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1 + with: + inputSarifFile: gosec.sarif + outputSarifFile: gosec-with-training.sarif + continue-on-error: true + + - name: Upload SARIF file + if: always() && hashFiles('gosec-with-training.sarif') != '' && github.token != '' + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: gosec-with-training.sarif + category: gosec + continue-on-error: true + + - name: Upload Raw SARIF file (fallback) + if: always() && hashFiles('gosec.sarif') != '' && hashFiles('gosec-with-training.sarif') == '' && github.token != '' + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: gosec.sarif + category: gosec + continue-on-error: true + + - name: Run govulncheck + run: | + go install golang.org/x/vuln/cmd/govulncheck@latest + govulncheck ./... + continue-on-error: true + + dependency-check: + name: Dependency Vulnerability Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Check for known vulnerabilities + run: | + go install golang.org/x/vuln/cmd/govulncheck@latest + govulncheck ./... + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..636caa2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,55 @@ +name: Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + test: + name: Test Suite + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.21', '1.22'] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + cache: true + + - name: Run tests + run: | + go test -v -race -coverprofile=coverage.out ./... + + - name: Generate test coverage report + if: matrix.go-version == '1.21' + run: | + go tool cover -html=coverage.out -o coverage.html + + - name: Upload coverage reports + if: matrix.go-version == '1.21' + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: coverage.html + + - name: Check test coverage + if: matrix.go-version == '1.21' + run: | + COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') + echo "Total test coverage: ${COVERAGE}%" + if (( $(echo "$COVERAGE < 60" | bc -l) )); then + echo "โŒ Test coverage is below 60%" + exit 1 + else + echo "โœ… Test coverage is above 60%" + fi \ No newline at end of file From 416fb4b1ba65462c8a1e19951437430a61eb71fb Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 02:22:45 +0900 Subject: [PATCH 05/13] chore: update GitHub Actions workflows for artifact upload and security permissions - Upgraded the `upload-artifact` action in `build.yml` from v3 to v4 for improved functionality. - Added additional permissions in `security.yml` for actions, id-token, and checks to enhance security scanning capabilities. --- .github/workflows/build.yml | 2 +- .github/workflows/security.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d45d70e..865c191 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} path: build/* \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index d605bb3..94938a4 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -9,6 +9,9 @@ on: permissions: contents: read security-events: write + actions: read + id-token: write + checks: write jobs: security-scan: From 9ba475c2c0bf7f7dd6ab51da0ce2f3b837680671 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 02:34:58 +0900 Subject: [PATCH 06/13] chore: update GitHub Actions workflows for linting and testing - Added write permissions for checks and pull-requests in `lint.yml` to enhance workflow capabilities. - Upgraded `setup-go` action from v4 to v5 in `lint.yml` for improved Go setup. - Updated `golangci-lint-action` from v3 to v6 in `lint.yml` and added a custom config argument. - Upgraded `upload-artifact` action from v3 to v4 in `test.yml` for better artifact management. --- .github/workflows/lint.yml | 9 ++++++--- .github/workflows/quality-gate.yml | 1 + .github/workflows/test.yml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3f5b157..6dc31b6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,6 +8,9 @@ on: permissions: contents: read + # Add permissions for checks + checks: write + pull-requests: write jobs: lint: @@ -18,16 +21,16 @@ jobs: uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: '.go-version' cache: true - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: latest - args: --timeout=10m + args: --timeout=10m --config=.golangci.yml - name: Verify dependencies run: | diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 6c19fed..84f60f0 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + actions: read jobs: quality-gate: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 636caa2..b93ed9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: - name: Upload coverage reports if: matrix.go-version == '1.21' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage.html From 091690b4f36039956fc0b3a2bc8f706e6afd7e4f Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 02:41:29 +0900 Subject: [PATCH 07/13] chore: enhance GitHub Actions workflows for building and quality checks - Added a new `pr-build` job in `build.yml` for quick builds targeting linux/amd64 on pull requests. - Updated `quality-gate.yml` to improve the quality summary reporting, including configuration recommendations for branch protection rules. - Streamlined the quality checks reporting process and enhanced clarity in the summary output. --- .github/workflows/build.yml | 39 +++++- .github/workflows/quality-gate.yml | 184 +++++++++++++++++++---------- 2 files changed, 161 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 865c191..64617e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,46 @@ permissions: contents: read jobs: - build: + # Quick build for PRs - only linux/amd64 + pr-build: + name: PR Build (linux/amd64) + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: '.go-version' + cache: true + + - name: Build binaries + env: + GOOS: linux + GOARCH: amd64 + run: | + # Build mitosisd + go build -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd + + # Build mito CLI + go build -o build/mito-${GOOS}-${GOARCH} ./cmd/mito + + # Build midevtool + go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: binaries-linux-amd64 + path: build/* + + # Full multi-platform build for main branch + main-build: name: Multi-Platform Build runs-on: ubuntu-latest + if: github.event_name == 'push' strategy: matrix: goos: [linux, darwin] diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 84f60f0..aa91ccb 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -1,95 +1,157 @@ name: Quality Gate on: - push: - branches: [ main ] + # Only run after other workflows complete + workflow_run: + workflows: ["Lint", "Test", "Security", "Build"] + types: [completed] + branches: [main] + # Also run on PR events, but with a delay to wait for other checks pull_request: - branches: [ main ] + branches: [main] permissions: contents: read + checks: read actions: read jobs: quality-gate: - name: Quality Gate + name: Quality Gate Check runs-on: ubuntu-latest - # Wait for all quality workflows to complete - needs: [] steps: - - name: Wait for all quality checks - uses: actions/github-script@v6 + - name: Wait for required checks + uses: actions/github-script@v7 with: script: | const { owner, repo } = context.repo; - const { sha } = context.payload.pull_request?.head || context.payload; + const sha = context.payload.pull_request?.head?.sha || context.sha; - // Define required workflows - const requiredWorkflows = ['Lint', 'Security', 'Test', 'Build']; + console.log(`๐Ÿ” Checking quality gate for commit: ${sha}`); + console.log(`๐Ÿ“‹ Event: ${context.eventName}`); - // Add benchmark check for PRs + // Define required check runs (job names from workflows) + const requiredChecks = [ + 'Code Linting', // from lint.yml + 'Test Suite', // from test.yml + 'Security Scan', // from security.yml + 'Dependency Vulnerability Check', // from security.yml + ]; + + // Add build check based on event type if (context.eventName === 'pull_request') { - requiredWorkflows.push('Benchmark'); + requiredChecks.push('PR Build (linux/amd64)'); + } else { + requiredChecks.push('Multi-Platform Build'); } - console.log(`Checking workflows for commit: ${sha}`); - console.log(`Required workflows: ${requiredWorkflows.join(', ')}`); + console.log(`๐Ÿ“‹ Required checks: ${requiredChecks.join(', ')}`); - // Wait for workflows to complete - let allPassed = true; - const maxWaitTime = 30 * 60 * 1000; // 30 minutes - const startTime = Date.now(); + // Wait for checks with timeout + const maxWaitMinutes = 20; + const checkIntervalSeconds = 30; + const maxAttempts = (maxWaitMinutes * 60) / checkIntervalSeconds; - while (Date.now() - startTime < maxWaitTime) { - const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ - owner, - repo, - head_sha: sha, - status: 'completed' - }); - - const completedWorkflows = runs.workflow_runs - .filter(run => requiredWorkflows.includes(run.name)) - .reduce((acc, run) => { - acc[run.name] = run.conclusion; - return acc; - }, {}); - - console.log('Completed workflows:', completedWorkflows); - - // Check if all required workflows are completed - const allCompleted = requiredWorkflows.every(name => - completedWorkflows.hasOwnProperty(name) - ); + let attempt = 0; + let allPassed = false; + + while (attempt < maxAttempts && !allPassed) { + attempt++; + console.log(`\n๐Ÿ”„ Attempt ${attempt}/${maxAttempts}`); - if (allCompleted) { - // Check if all passed - allPassed = requiredWorkflows.every(name => - completedWorkflows[name] === 'success' + try { + // Get check runs for this commit + const { data: checkRuns } = await github.rest.checks.listForRef({ + owner, + repo, + ref: sha, + per_page: 100 + }); + + const relevantChecks = checkRuns.check_runs.filter(check => + requiredChecks.includes(check.name) ); - break; + + console.log(`๐Ÿ“Š Found ${relevantChecks.length}/${requiredChecks.length} required checks`); + + // Check status of each required check + const checkStatus = {}; + const pendingChecks = []; + const failedChecks = []; + + for (const checkName of requiredChecks) { + const check = relevantChecks.find(c => c.name === checkName); + + if (!check) { + checkStatus[checkName] = 'missing'; + pendingChecks.push(checkName); + } else if (check.status === 'completed') { + checkStatus[checkName] = check.conclusion; + if (check.conclusion !== 'success') { + failedChecks.push(`${checkName}: ${check.conclusion}`); + } + } else { + checkStatus[checkName] = check.status; + pendingChecks.push(checkName); + } + } + + // Log current status + console.log('\n๐Ÿ“ˆ Current check status:'); + for (const [name, status] of Object.entries(checkStatus)) { + const emoji = status === 'success' ? 'โœ…' : + status === 'failure' || status === 'error' ? 'โŒ' : + status === 'missing' ? 'โณ' : '๐ŸŸก'; + console.log(` ${emoji} ${name}: ${status}`); + } + + // Check if we're done + if (failedChecks.length > 0) { + console.log(`\nโŒ Quality Gate FAILED`); + console.log(`Failed checks: ${failedChecks.join(', ')}`); + core.setFailed(`Quality gate failed: ${failedChecks.join(', ')}`); + return; + } + + if (pendingChecks.length === 0) { + console.log(`\nโœ… Quality Gate PASSED - All checks successful!`); + allPassed = true; + break; + } + + console.log(`โณ Waiting for: ${pendingChecks.join(', ')}`); + + // Wait before next check + if (attempt < maxAttempts) { + console.log(`โฑ๏ธ Waiting ${checkIntervalSeconds}s before next check...`); + await new Promise(resolve => setTimeout(resolve, checkIntervalSeconds * 1000)); + } + + } catch (error) { + console.log(`โš ๏ธ Error checking status: ${error.message}`); + if (attempt === maxAttempts) { + core.setFailed(`Failed to check quality gate status: ${error.message}`); + return; + } } - - // Wait 30 seconds before checking again - await new Promise(resolve => setTimeout(resolve, 30000)); } if (!allPassed) { - core.setFailed('โŒ Quality gate failed - some workflows did not pass'); - } else { - console.log('โœ… Quality gate passed - all workflows successful'); + console.log(`\nโฐ Quality Gate TIMEOUT after ${maxWaitMinutes} minutes`); + core.setFailed(`Quality gate timed out waiting for checks to complete`); } - name: Quality Gate Summary + if: success() run: | - echo "## ๐ŸŽฏ Quality Gate Results" >> $GITHUB_STEP_SUMMARY - echo "All required quality checks have been completed and passed." >> $GITHUB_STEP_SUMMARY + echo "## โœ… Quality Gate Passed" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "All required quality checks have completed successfully:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- โœ… **Code Linting** - Code style and format validation" >> $GITHUB_STEP_SUMMARY + echo "- โœ… **Test Suite** - Unit and integration tests" >> $GITHUB_STEP_SUMMARY + echo "- โœ… **Security Scan** - Vulnerability scanning" >> $GITHUB_STEP_SUMMARY + echo "- โœ… **Dependency Check** - Dependency vulnerability check" >> $GITHUB_STEP_SUMMARY + echo "- โœ… **Build** - Cross-platform build verification" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "### Checked Workflows:" >> $GITHUB_STEP_SUMMARY - echo "- โœ… Lint" >> $GITHUB_STEP_SUMMARY - echo "- โœ… Security" >> $GITHUB_STEP_SUMMARY - echo "- โœ… Test" >> $GITHUB_STEP_SUMMARY - echo "- โœ… Build" >> $GITHUB_STEP_SUMMARY - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "- โœ… Benchmark" >> $GITHUB_STEP_SUMMARY - fi \ No newline at end of file + echo "๐ŸŽ‰ **This PR meets all quality standards and is ready for merge!**" >> $GITHUB_STEP_SUMMARY \ No newline at end of file From 478517638866e94a75c678d3adb4d0d15a1a0792 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 15:51:33 +0900 Subject: [PATCH 08/13] fix(ci): support codecov --- .github/workflows/test.yml | 47 ++++++++++++++++++------------ codecov.yml | 58 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 18 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b93ed9b..db18cb1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,17 +13,20 @@ jobs: test: name: Test Suite runs-on: ubuntu-latest - strategy: - matrix: - go-version: ['1.21', '1.22'] steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Go ${{ matrix.go-version }} + - name: Read Go version + id: go-version + run: | + GO_VERSION=$(cat .go-version) + echo "version=$GO_VERSION" >> $GITHUB_OUTPUT + + - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ steps.go-version.outputs.version }} cache: true - name: Run tests @@ -31,25 +34,33 @@ jobs: go test -v -race -coverprofile=coverage.out ./... - name: Generate test coverage report - if: matrix.go-version == '1.21' run: | go tool cover -html=coverage.out -o coverage.html - name: Upload coverage reports - if: matrix.go-version == '1.21' uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage.html - - name: Check test coverage - if: matrix.go-version == '1.21' - run: | - COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') - echo "Total test coverage: ${COVERAGE}%" - if (( $(echo "$COVERAGE < 60" | bc -l) )); then - echo "โŒ Test coverage is below 60%" - exit 1 - else - echo "โœ… Test coverage is above 60%" - fi \ No newline at end of file + # Commented out strict coverage check - now using Codecov for coverage reporting + # - name: Check test coverage + # if: matrix.go-version == '1.21' + # run: | + # COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') + # echo "Total test coverage: ${COVERAGE}%" + # if (( $(echo "$COVERAGE < 60" | bc -l) )); then + # echo "โŒ Test coverage is below 60%" + # exit 1 + # else + # echo "โœ… Test coverage is above 60%" + # fi + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.out + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..92d9dfc --- /dev/null +++ b/codecov.yml @@ -0,0 +1,58 @@ +codecov: + require_ci_to_pass: yes + notify: + after_n_builds: 1 + +coverage: + precision: 2 + round: down + range: "50...100" + + status: + project: + default: + target: 60% + threshold: 1% + if_no_uploads: error + if_not_found: success + if_ci_failed: error + patch: + default: + target: 70% + threshold: 5% + if_no_uploads: error + if_not_found: success + if_ci_failed: error + +comment: + layout: "header, diff, flags, files, footer" + behavior: default + require_changes: false + require_base: no + require_head: yes + +ignore: + - "*.pb.go" + - "*.pulsar.go" + - "**/*_test.go" + - "**/testutil/**" + - "**/mock_*.go" + - "api/**" + - "proto/**" + - "test-keystore/**" + - "infra/**" + - "scripts/**" + - "dependencies/**" + +flags: + unittests: + carryforward: true + paths: + - "x/" + - "app/" + - "cmd/" + - "types/" + - "bindings/" + +github_checks: + annotations: true \ No newline at end of file From 8ce89eac65e9f3b6faf837a16bfaff55d818f763 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 16:06:25 +0900 Subject: [PATCH 09/13] fix: move direct dependencies to correct section in go.mod - Move github.com/pelletier/go-toml/v2 from indirect to direct dependencies - Move golang.org/x/term from indirect to direct dependencies - This resolves lint workflow failure where go mod tidy was creating diff --- go.mod | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 92e6b6e..07f7255 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,11 @@ require ( google.golang.org/protobuf v1.36.5 ) +require ( + github.com/pelletier/go-toml/v2 v2.2.2 + golang.org/x/term v0.29.0 +) + require ( cloud.google.com/go v0.112.1 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect @@ -168,7 +173,6 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -218,7 +222,6 @@ require ( golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sync v0.11.0 // indirect golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect golang.org/x/text v0.22.0 // indirect golang.org/x/time v0.9.0 // indirect google.golang.org/api v0.171.0 // indirect From 2c2dca1cfc0aceb228d5549656cc41acea2947db Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Tue, 24 Jun 2025 16:16:20 +0900 Subject: [PATCH 10/13] fix(ci): merge PR and main build jobs, remove multi-platform build --- .github/workflows/build.yml | 45 ++----------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64617e3..8cc2458 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,9 @@ permissions: contents: read jobs: - # Quick build for PRs - only linux/amd64 - pr-build: - name: PR Build (linux/amd64) + build: + name: Build runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - name: Checkout code uses: actions/checkout@v4 @@ -43,43 +41,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: binaries-linux-amd64 - path: build/* - - # Full multi-platform build for main branch - main-build: - name: Multi-Platform Build - runs-on: ubuntu-latest - if: github.event_name == 'push' - strategy: - matrix: - goos: [linux, darwin] - goarch: [amd64, arm64] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: '.go-version' - cache: true - - - name: Build binaries - env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - run: | - # Build mitosisd - go build -o build/mitosisd-${GOOS}-${GOARCH} ./cmd/mitosisd - - # Build mito CLI - go build -o build/mito-${GOOS}-${GOARCH} ./cmd/mito - - # Build midevtool - go build -o build/midevtool-${GOOS}-${GOARCH} ./cmd/midevtool - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} path: build/* \ No newline at end of file From 467f823c866c1050721e5e53da1b61c58810b301 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Wed, 25 Jun 2025 04:03:22 +0900 Subject: [PATCH 11/13] fix(ci): remove conditional build checks from quality-gate workflow --- .github/workflows/quality-gate.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index aa91ccb..1aa17e2 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -38,13 +38,6 @@ jobs: 'Dependency Vulnerability Check', // from security.yml ]; - // Add build check based on event type - if (context.eventName === 'pull_request') { - requiredChecks.push('PR Build (linux/amd64)'); - } else { - requiredChecks.push('Multi-Platform Build'); - } - console.log(`๐Ÿ“‹ Required checks: ${requiredChecks.join(', ')}`); // Wait for checks with timeout From 20912726f558b58e42f33e535d989fab9cb0ca1c Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Wed, 25 Jun 2025 14:08:46 +0900 Subject: [PATCH 12/13] docs: change readme style --- README.md | 362 +++++++++--------------------------------------------- 1 file changed, 61 insertions(+), 301 deletions(-) diff --git a/README.md b/README.md index ed84319..e06c244 100644 --- a/README.md +++ b/README.md @@ -1,358 +1,118 @@ -
- Mitosis Chain - - # Mitosis Chain - **โšก Next-Generation Modular Blockchain Infrastructure** - - [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) - [![Go Report Card](https://goreportcard.com/badge/github.com/mitosis-org/chain)](https://goreportcard.com/report/github.com/mitosis-org/chain) - [![CI](https://github.com/mitosis-org/chain/workflows/CI/badge.svg)](https://github.com/mitosis-org/chain/actions) - [![Quality Gate](https://github.com/mitosis-org/chain/workflows/Quality%20Checks/badge.svg)](https://github.com/mitosis-org/chain/actions) - - [๐Ÿš€ Quick Start](#-quick-start) โ€ข - [๐Ÿ“– Documentation](https://docs.mitosis.org) โ€ข - [๐Ÿ’ฌ Community](#-community) โ€ข - [๐ŸŽฏ Roadmap](#-roadmap) โ€ข - [๐Ÿค Contributing](CONTRIBUTING.md) -
+# mitosis ---- +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) +[![Security](https://github.com/mitosis-org/chain/actions/workflows/security.yml/badge.svg?branch=main)](https://github.com/mitosis-org/chain/actions/workflows/security.yml) +[![Quality Gate](https://github.com/mitosis-org/chain/actions/workflows/quality-gate.yml/badge.svg?branch=main)](https://github.com/mitosis-org/chain/actions/workflows/quality-gate.yml) -## โœจ Why Mitosis Chain? +**Modular, contributor-friendly implementation of the Ethereum-compatible blockchain protocol** - - - - - - -
+## What is Mitosis? -### ๐Ÿ”ง **Developer-First** -Full EVM compatibility with Cosmos SDK power. Run your Ethereum dApps without changes while leveraging advanced Cosmos features. +Mitosis is a new Ethereum-compatible blockchain implementation that is focused on being user-friendly, highly modular, as well as being fast and efficient. Mitosis is built on Cosmos SDK and is compatible with all Ethereum tooling and infrastructure. It features a unique modular architecture that separates execution from consensus, combining the best of both Ethereum and Cosmos ecosystems. - +## Goals -### โšก **High Performance** -Modular architecture separates execution from consensus. Optimized for DeFi and cross-chain operations with minimal latency. +As a full Ethereum-compatible blockchain, Mitosis allows users to connect to the network and interact with smart contracts using familiar Ethereum tooling. Building a successful blockchain requires creating a high-quality implementation that is both secure and efficient, as well as being easy to use. It also requires building a strong community of contributors who can help support and improve the software. - +More concretely, our goals are: -### ๐Ÿ›ก๏ธ **Battle-Tested** -Built on proven technologies: Cosmos SDK, CometBFT, and EVM. Security-focused design with regular audits. +1. **Modularity**: Every component of Mitosis is built to be used as a library: well-tested, heavily documented and benchmarked. We envision that developers will import the node's crates, mix and match, and innovate on top of them. -
+2. **Performance**: Mitosis aims to be fast, leveraging the proven Cosmos SDK architecture with full EVM compatibility. We optimize for DeFi and cross-chain operations with minimal latency. -## ๐Ÿš€ Quick Start +3. **Free for anyone to use any way they want**: Mitosis is free open source software, built for the community, by the community. By licensing the software under the Apache license, we want developers to use it without being bound by business licenses. -### One-Line Installation +4. **EVM Compatibility**: Full compatibility with Ethereum tooling, wallets, and infrastructure. Run your Ethereum dApps without changes while leveraging advanced Cosmos features. -#### Install Mitosis Chain Node (mitosisd) -```bash -# Latest mitosisd (blockchain node) -curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash +5. **Developer Experience**: Unified development experience using Solidity for all logic, standard Ethereum tooling, and familiar wallet integration. -# Specific version -VERSION=v1.0.0 curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash -``` +## Status -#### Install Mito CLI (validator management) -```bash -# Latest mito CLI -COMPONENT=mito curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash +Mitosis is under active development and is not yet ready for production use. We are working towards a stable release. -# Specific version -COMPONENT=mito VERSION=v1.0.0 curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash -``` +## For Users -### Manual Installation +### Installation -#### For Mitosis Chain Node (mitosisd) ```bash -# Download latest mitosisd release (vX.Y.Z) +# Install latest release +curl -sSL https://raw.githubusercontent.com/mitosis-org/chain/main/scripts/install.sh | bash + +# Or download from releases wget https://github.com/mitosis-org/chain/releases/latest/download/mitosisd-linux-amd64 chmod +x mitosisd-linux-amd64 && mv mitosisd-linux-amd64 /usr/local/bin/mitosisd - -# Initialize and start node -mitosisd init my-node --chain-id mitosis-mainnet-1 -mitosisd start ``` -#### For Mito CLI -```bash -# Download latest mito CLI release (mito/vX.Y.Z) -wget $(curl -s https://api.github.com/repos/mitosis-org/chain/releases | grep browser_download_url | grep mito/v | grep linux-amd64 | head -n1 | cut -d'"' -f4) -chmod +x mito-linux-amd64 && mv mito-linux-amd64 /usr/local/bin/mito - -# Configure and use -mito config set-rpc https://rpc.mitosis.org -mito version -``` +### Running a Node -### Using Docker ```bash -# Run Mitosis Chain Node (mitosisd only) -docker run -p 26657:26657 -p 8545:8545 ghcr.io/mitosis-org/chain:latest -``` - -## ๐Ÿ—๏ธ Architecture - -### Overview - -![architecture.png](assets/architecture.png) - -Mitosis Chain employs a **modular architecture** that separates execution from consensus, providing the best of both Ethereum and Cosmos ecosystems. - -
-๐Ÿ” Detailed Architecture +# Initialize node +mitosisd init my-node --chain-id mitosis-localnet-1 -- **Execution Layer**: Fully EVM-compatible, enabling unmodified Ethereum execution clients -- **Consensus Layer**: Built upon Cosmos SDK with CometBFT for Byzantine fault tolerance -- **Communication**: Uses [Engine API](https://hackmd.io/@danielrachi/engine_api) via [Octane](https://github.com/omni-network/omni/tree/main/octane) -- **Design Philosophy**: Keep consensus layer thin, implement logic in EVM smart contracts - -
- -### Validator & Governance System - -Unlike traditional Cosmos chains, Mitosis implements **most logic as EVM smart contracts**: - -| Component | Traditional Cosmos | Mitosis Chain | -|-----------|-------------------|---------------| -| Staking | `x/staking` module | EVM Smart Contract | -| Delegation | `x/staking` module | EVM Smart Contract | -| Rewards | `x/distribution` module | EVM Smart Contract | -| Governance | `x/gov` module | EVM Smart Contract | - -**Benefits:** -- ๐ŸŽฏ **Unified Development**: Single language (Solidity) for all logic -- โšก **Better UX**: Standard Ethereum tooling and wallets -- ๐Ÿ”„ **Easier Upgrades**: Contract upgrades vs. chain upgrades - -### Core Modules - - - - - - - -
- -#### `x/evmengine` (forked from Octane) -- Communicates with execution client via Engine API -- Wraps EVM blocks into consensus transactions -- Seamlessly integrates with other modules - - - -#### `x/evmvalidator` -- Manages validator set from EVM contract state -- Lightweight replacement for `x/staking` -- Integrates with `x/slashing` and `x/evidence` - - - -#### `x/evmgov` -- Enables arbitrary message execution from EVM -- Governance parameters controlled by smart contracts -- Minimal overhead compared to `x/gov` - -
+# Start node +mitosisd start +``` -## ๐Ÿ› ๏ธ Development +## For Developers ### Prerequisites -- **Go 1.21+** -- **Node.js 18+** (for tooling) -- **Docker** (for devnet) -- **Git** with submodules - -### Setup Development Environment - -```bash -# Clone repository -git clone https://github.com/mitosis-org/chain.git -cd chain - -# Fetch submodules -git submodule update --init --recursive - -# Build binaries -make build - -# Run tests -make test -``` - -### Network Environments +- Go 1.24+ +- Git -| Environment | Purpose | Chain ID (EVM) | Chain ID (Cosmos) | -|-------------|---------|----------------|-------------------| -| **Localnet** | Local development | `124899` | `mitosis-localnet-1` | -| **Devnet** | Integration testing | `124864` | `mitosis-devnet-1` | -| **Testnet** | Public testing | TBD | TBD | -| **Mainnet** | Production | TBD | TBD | +### Building from Source -
-๐Ÿ“‹ Localnet Setup +First, clone the repository: ```bash -# Setup execution client -make setup-geth # or make setup-reth -make run-geth - -# Setup consensus client -make setup-mitosisd -make run-mitosisd - -# Deploy contracts (in protocol repo) -./tools/deploy-consensus-entrypoints.sh - -# Update contract addresses -./build/midevtool governance execute \ - --entrypoint 0x06c9918ff483fd88C65dD02E788427cfF04545b9 \ - --private-key 0x5a496832ac0d7a484e6996301a5511dbc3b723d037bc61261ecaf425bd6a5b37 \ - --msg '[{"@type":"/mitosis.evmvalidator.v1.MsgUpdateValidatorEntrypointContractAddr","authority":"mito1g86pactsvfrcglkvqzvdwkxhjshafu280q95p7","addr":"0x9866D79EF3e9c0c22Db2b55877013e13a60AD478"}]' +git clone https://github.com/mitosis-org/chain +cd chain ``` -
- -
-๐Ÿณ Devnet Setup +Next, build the binary: ```bash -# Build Docker image -make devnet-build - -# Initialize chain -make devnet-init - -# Start all services -make devnet-up - -# Check status -docker logs mitosis-devnet-node-mitosisd-1 -cast block-number --rpc-url http://localhost:18545 - -# Create validator -make devnet-create-validator - -# Stop and clean -make devnet-down -make devnet-clean +make build ``` -
- -## ๐Ÿ”ง Tools & CLI - -### MITO CLI - -Powerful command-line interface for validator operations and blockchain interaction. +### Running Tests ```bash -# Install -go install github.com/mitosis-org/chain/cmd/mito@latest - -# Configure -mito config set-rpc https://rpc.mitosis.org -mito config set-contract --validator-manager 0xECF7658978A03b3A35C2c5B33C449D74E8151Db0 - -# Create validator -mito tx send validator create \ - --pubkey 0x1234... \ - --operator 0x5678... \ - --commission-rate 5% \ - --initial-collateral 1.5 \ - --account my-validator - -# Query validator -mito query validator info --address 0x1234... +make test ``` -[๐Ÿ“– **Full CLI Documentation**](cmd/mito/README.md) -## ๐Ÿค Contributing - -We welcome contributions from the community! Check out our [Contributing Guide](CONTRIBUTING.md) to get started. - -### Ways to Contribute - -- ๐Ÿ› **Report bugs** via [GitHub Issues](https://github.com/mitosis-org/chain/issues) -- โœจ **Suggest features** via [GitHub Discussions](https://github.com/mitosis-org/chain/discussions) -- ๐Ÿ“š **Improve documentation** (great for first-time contributors!) -- ๐Ÿงช **Write tests** and improve test coverage -- ๐Ÿ” **Security research** via our [Security Policy](SECURITY.md) - -### Development Workflow - -1. **Fork** the repository -2. **Create** a feature branch (`git checkout -b feature/amazing-feature`) -3. **Commit** your changes (`git commit -m 'feat: add amazing feature'`) -4. **Push** to the branch (`git push origin feature/amazing-feature`) -5. **Open** a Pull Request - -## ๐Ÿ’ฌ Community +### Contributing - - - - - - - -
+If you want to contribute, or follow along with contributor discussion, you can use our GitHub discussions and issues. -### ๐Ÿ’ญ **Discord** -Real-time discussions
-*Coming Soon* +- Our contributor guidelines can be found in [CONTRIBUTING.md](CONTRIBUTING.md). +- See our [Security Policy](SECURITY.md) for security-related contributions. -
+## Getting Help -### ๐Ÿฆ **Twitter** -Updates & announcements
-*Coming Soon* +If you have any questions: -
+- Open a discussion with your question, or +- Open an issue with the bug +- Check our documentation at [docs.mitosis.org](https://docs.mitosis.org) -### ๐Ÿ“ **GitHub** -Code & issues
-[mitosis-org/chain](https://github.com/mitosis-org/chain) +## Security -
- -### ๐Ÿ“– **Docs** -Technical documentation
-[docs.mitosis.org](https://docs.mitosis.org) - -
- -## ๐Ÿ“ License - -This project is licensed under the [Apache License 2.0](LICENSE). - -``` -Copyright 2024 Mitosis Labs - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -``` +See [SECURITY.md](SECURITY.md). -## ๐Ÿ™ Acknowledgments +## Acknowledgements -Special thanks to: -- [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) team for the robust blockchain framework -- [CometBFT](https://github.com/cometbft/cometbft) for Byzantine fault-tolerant consensus -- [Octane](https://github.com/omni-network/omni/tree/main/octane) for EVM-Engine API integration -- All our [contributors](https://github.com/mitosis-org/chain/graphs/contributors) ๐Ÿš€ +Mitosis is built on the shoulders of giants. We would like to thank: ---- +- **Cosmos SDK**: For providing the robust blockchain framework that powers our consensus layer +- **CometBFT**: For the battle-tested Byzantine fault-tolerant consensus mechanism +- **Octane**: For the EVM-Engine API integration that enables our modular architecture +- **Ethereum**: For the EVM specification and the vibrant ecosystem that inspired this project -
+## License -**[โญ Star this repo](https://github.com/mitosis-org/chain) โ€ข [๐Ÿด Fork it](https://github.com/mitosis-org/chain/fork) โ€ข [๐Ÿš€ Deploy it](https://docs.mitosis.org/deploy)** +Licensed under either of -*Built with โค๏ธ by the Mitosis community* +- Apache License, Version 2.0, ([LICENSE](LICENSE) or http://www.apache.org/licenses/LICENSE-2.0) -
+at your option. From b66aa0fcde39f3f78abca86a964e2dbf1ce2d141 Mon Sep 17 00:00:00 2001 From: Lee Suho Date: Wed, 25 Jun 2025 14:21:09 +0900 Subject: [PATCH 13/13] chore: update LICENSE year placeholder - Changed copyright year in LICENSE file from 2024 to [yyyy] [placeholder] for future updates. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 3beae9c..e77a1c2 100644 --- a/LICENSE +++ b/LICENSE @@ -190,7 +190,7 @@ file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 Mitosis Labs +Copyright [yyyy] [placeholder] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.