Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Vortex Contracts — Code Ownership and Review Routing
#
# This file establishes ownership of major repository areas and automatically
# routes PR review requests to contributors with relevant expertise.
#
# Process for becoming a CODEOWNER:
# 1. Demonstrate sustained contribution to an area (multiple non-trivial PRs)
# 2. Open an issue or propose a PR adding yourself as an owner
# 3. Gain approval from existing owners of that area
# 4. Update this file and merge with the approving PR
#
# GitHub's CODEOWNERS matching is last-match-wins: a file matching multiple
# patterns will be owned by the LAST pattern in this file that matches it.
# To verify a path's owner, run:
# git ls-files <path> | xargs -I {} git check-attr owners {}
#
# Reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
#
# ───────────────────────────────────────────────────────────────────────────

# Default fallback owner for any path not explicitly matched below
* @stellar-vortex-protocol/maintainers

# ───────────────────────────────────────────────────────────────────────────
# Core Contract Logic
# ───────────────────────────────────────────────────────────────────────────

# Intent settlement contract — the main on-chain logic
intent_settlement/src/ @stellar-vortex-protocol/intent-settlement-reviewers

# Proof registry contract — cross-chain proof handling
proof_registry/src/ @stellar-vortex-protocol/proof-registry-reviewers

# Solver registry contract — solver identity and configuration
solver_registry/src/ @stellar-vortex-protocol/solver-registry-reviewers

# ───────────────────────────────────────────────────────────────────────────
# Integration, Indexing, and Tooling
# ───────────────────────────────────────────────────────────────────────────

# Indexer and off-chain tooling
indexer/ @stellar-vortex-protocol/indexer-reviewers

# Example code and solver integration guides
examples/ @stellar-vortex-protocol/examples-reviewers

# ───────────────────────────────────────────────────────────────────────────
# Documentation
# ───────────────────────────────────────────────────────────────────────────

# Runbooks, design documents, integration guides
docs/ @stellar-vortex-protocol/docs-reviewers

# Main README
README.md @stellar-vortex-protocol/maintainers

# Governance and contribution documentation
GOVERNANCE.md @stellar-vortex-protocol/maintainers
CONTRIBUTING.md @stellar-vortex-protocol/maintainers

# Changelog
CHANGELOG.md @stellar-vortex-protocol/maintainers

# ───────────────────────────────────────────────────────────────────────────
# CI/CD, Build, and Configuration
# ───────────────────────────────────────────────────────────────────────────

# GitHub workflows and CI configuration
.github/workflows/ @stellar-vortex-protocol/ci-maintainers

# GitHub templates and configuration
.github/ @stellar-vortex-protocol/ci-maintainers

# Build and deployment scripts
*.sh @stellar-vortex-protocol/ci-maintainers
Makefile @stellar-vortex-protocol/ci-maintainers
justfile @stellar-vortex-protocol/ci-maintainers

# Dependency management
Cargo.lock @stellar-vortex-protocol/maintainers
Cargo.toml @stellar-vortex-protocol/maintainers

# ───────────────────────────────────────────────────────────────────────────
# Tests
# ───────────────────────────────────────────────────────────────────────────

# Test suites
tests/ @stellar-vortex-protocol/test-reviewers
98 changes: 98 additions & 0 deletions .github/ISSUE_TEMPLATE/governance-proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: Governance Proposal
about: Propose a protocol parameter change or admin action requiring deliberation
title: "[PROPOSAL] "
labels: governance-proposal
assignees: ""
---

## Proposal Summary

Brief one-sentence summary of the change (e.g., "Add USDT to destination token allowlist").

---

## Rationale

**Why is this change needed?** What problem does it solve? Who benefits?

Provide context: Is this a response to user feedback, a security improvement, an operational
optimization? Link any related issues, discussions, or audit findings.

---

## Scope

**What exactly is being changed?** Be specific.

Examples:
- "Call `propose_add_dst_token(USDT_SAC_ADDRESS)` where USDT_SAC_ADDRESS = `CBT...`"
- "Increase `MIN_BOND` from 50 USDC to 100 USDC via `set_config`"
- "Transfer admin control to a new 2-of-3 multisig account"

Include parameter names, old values, and new values. If multiple settings are being changed,
list each one explicitly.

---

## Trade-offs

**What do we gain? What do we give up?**

| Aspect | Benefit | Cost/Risk |
|--------|---------|-----------|
| User experience | ... | ... |
| Solver economics | ... | ... |
| Protocol security | ... | ... |
| Operational complexity | ... | ... |

Be honest about downsides. If there are none, say so explicitly.

---

## Affected Parties

**Who has a stake in this change?**

- [ ] Users (affected how?)
- [ ] Solvers (affected how?)
- [ ] Fee recipient / protocol treasury
- [ ] Integrators / dApp partners
- [ ] Other: ___

---

## Rollback Plan

**How would we undo this if it goes wrong?**

- Can it be reverted immediately (e.g., `remove_allowed_dst_token`)?
- Does reverting require another proposal cycle, or is it instant?
- Would reverting affect in-flight intents?

If there is no safe rollback path, state that explicitly and explain why the risk is acceptable.

---

## Compliance with Governance

By opening this proposal, I confirm that:

- [ ] This action requires a governance proposal (it is one of `propose_fee_recipient`,
`propose_admin_transfer`, `propose_upgrade`, `propose_add_dst_token`,
`propose_remove_dst_token`, or `set_config` — see `GOVERNANCE.md`).
- [ ] I have read `GOVERNANCE.md` and understand the 3-business-day discussion window
and 48-hour on-chain timelock.
- [ ] I am not requesting this as an emergency pause (which bypasses governance;
use `pause()` only for active incident response).

---

## Discussion

Leave this section empty. Stakeholders will comment below with questions, concerns, or support.

Once the 3-business-day discussion window closes and consensus is reached, an admin will:
1. Call the on-chain `propose_*` or `set_config` function.
2. Link the transaction hash in this issue as a comment.
3. The 48-hour timelock begins.
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,60 @@ concurrency:
cancel-in-progress: true

jobs:
changelog:
name: Changelog enforcement
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check CHANGELOG.md updated for source changes
shell: bash
run: |
# Skip check if PR has the 'no-changelog-needed' label
LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name' || true)
if echo "$LABELS" | grep -q "no-changelog-needed"; then
echo "✓ PR labeled 'no-changelog-needed' — changelog check skipped"
exit 0
fi

# Get list of changed files in this PR
CHANGED_FILES=$(git diff --name-only origin/main...HEAD)

# Check if any source files changed (intent_settlement/src/ or proof_registry/src/)
SOURCE_FILES_CHANGED=$(echo "$CHANGED_FILES" | grep -E '(intent_settlement/src/|proof_registry/src/)' || true)

if [ -z "$SOURCE_FILES_CHANGED" ]; then
echo "✓ No source files changed — changelog not required"
exit 0
fi

# Check if CHANGELOG.md was updated
CHANGELOG_CHANGED=$(echo "$CHANGED_FILES" | grep -E '^CHANGELOG\.md$' || true)

if [ -z "$CHANGELOG_CHANGED" ]; then
echo "❌ CHANGELOG enforcement failed"
echo ""
echo "Source files changed but CHANGELOG.md was not updated:"
echo "$SOURCE_FILES_CHANGED"
echo ""
echo "CONTRIBUTING.md requires: 'CHANGELOG.md updated under [Unreleased]'"
echo ""
echo "Options:"
echo " 1. Update CHANGELOG.md with your changes (preferred)"
echo " 2. Add 'no-changelog-needed' label if this PR is:"
echo " - Pure test-only changes"
echo " - Comment-only / documentation-only changes"
echo " - CI/tooling changes with no impact on contract behavior"
exit 1
fi

echo "✓ CHANGELOG.md was updated"
exit 0
env:
GH_TOKEN: ${{ github.token }}

fmt:
name: Formatting (${{ matrix.crate }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -291,6 +345,45 @@ jobs:
- name: Run mutation tests
run: cargo mutants --copy-target=false

integration-test:
name: Soroban standalone integration test
runs-on: ubuntu-latest
# Needs: contents: read (checkout only). The test runs a local Docker
# container and makes requests to it via HTTP — no GitHub API calls.
# Inherits workflow-level minimum.
services:
docker:
image: docker:dind
options: >-
--privileged
--health-cmd "docker ps"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust and Stellar CLI
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: intent_settlement
- name: Install Stellar CLI
run: cargo install --locked stellar-cli --features opt
- name: Install required tools
run: |
apt-get update
apt-get install -y docker.io curl jq
- name: Build contract
run: |
cd intent_settlement
stellar contract build
- name: Run end-to-end integration test
run: bash scripts/e2e-test.sh
timeout-minutes: 10

view-calls-sync:
name: Check view-calls collection sync (Issue #290)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -393,3 +486,4 @@ jobs:
echo "⚠️ Resource cost drift detected (advisory check)" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi

26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ first deploys to mainnet.

## [Unreleased]

### Added

- **CI: Enforce CHANGELOG.md updates (issue #294).** A new CI job verifies that
every PR changing `intent_settlement/src/` or `proof_registry/src/` includes a
corresponding update to `CHANGELOG.md`. An escape hatch (`no-changelog-needed`
label) exists for genuinely changelog-exempt changes (pure test-only,
comment-only, CI/tooling).
- **CI: Soroban standalone network integration test (issue #295).** A new CI job
runs a full end-to-end lifecycle test (`register_solver` → `submit_intent` →
`accept_intent` → `fill_intent`) against a local Soroban standalone network on
every PR. Exercises the real deployment, contract initialization, and CLI-invocation
path — catching issues that in-process unit tests miss. Includes a local test
script (`scripts/e2e-test.sh`) for debugging; documented in `CONTRIBUTING.md`.
- **`.github/CODEOWNERS` file establishing review routing (issue #296).** Maps
major repository areas (`intent_settlement/`, `proof_registry/`, `solver_registry/`,
`indexer/`, `docs/`, `.github/workflows/`, etc.) to code owners/teams. PRs
automatically request review from owners with relevant expertise. Documented
process for contributors to become owners in `CONTRIBUTING.md`.
- **Formalized off-chain governance process (issue #297).** New `GOVERNANCE.md`
documents the RFC and discussion process preceding on-chain proposals. Establishes
minimum 3-business-day discussion window before `propose_*` calls; describes what
requires a proposal (fee changes, admin transfers, upgrades, token allowlist changes),
emergency exception for `pause()`, and rollback planning. Includes GitHub issue
template for proposals (`.github/ISSUE_TEMPLATE/governance-proposal.md`). Referenced
from `CONTRIBUTING.md` and `README.md`.

### Changed

- **Storage layout — `SolverRecord` / `IntentRecord` (issue #187, #188).**
Expand Down
Loading
Loading