Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Isolate cosmos-sdk dependency in a separate Go submodule

Đang mở
#24 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra go.mod ở thư mục gốc và ranh giới submit/go.mod được đề xuất, sau đó xem xét cmd/apex/main.go và các tệp submit được liệt kê. Xác minh cách interface core có thể tránh các kiểu của cosmos-sdk và cách hai module sẽ được kiểm thử độc lập. Hoàn tất khi cosmos-sdk được cô lập trong submit/, core chỉ đọc có thể build mà không cần nó và interface submission vẫn có thể sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The core apex codebase must not import cosmos-sdk. All cosmos-sdk-dependent code (transaction construction, signing, gas estimation) must live in an isolated Go submodule with its own go.mod to prevent dependency contamination.

Problem

cosmos-sdk pulls in a massive transitive dependency tree:

  • cometbft (celestia's fork: celestiaorg/celestia-core)
  • iavl, cosmos-db, cosmos-proto
  • gRPC, protobuf, gogoproto
  • celestia-app's own forks of cosmos-sdk

Importing it into the core module would:

  • Bloat build times and binary size for read-only deployments that don't need tx submission
  • Create version pinning headaches against celestia's forked dependencies
  • Make upgrades painful — a celestia-app bump could break unrelated apex code
  • Bleed transitive deps into packages that have no business depending on them

Design

apex/
├── go.mod                      # core module — zero cosmos-sdk
├── cmd/apex/main.go
├── pkg/
│   ├── store/                  # SQLite — clean
│   ├── sync/                   # backfill, streaming — clean
│   ├── fetch/                  # DataFetcher, CelestiaNodeFetcher — clean
│   └── api/                    # JSON-RPC, gRPC server — clean
└── submit/
    ├── go.mod                  # separate Go module, imports cosmos-sdk here
    ├── go.sum
    ├── signer.go               # key loading, tx signing (SIGN_MODE_DIRECT)
    ├── msg.go                  # MsgPayForBlobs construction
    ├── gas.go                  # deterministic gas estimation
    ├── broadcast.go            # BroadcastTxSync + confirmation polling
    └── submit.go               # public API: Submit(blobs) -> TxResult
Boundary interface

The core module defines a submission interface with no cosmos-sdk types:

// In pkg/submit/iface.go (core module, no cosmos-sdk imports)
type BlobSubmitter interface {
    Submit(ctx context.Context, blobs []RawBlob, opts SubmitOpts) (*TxResult, error)
}

type RawBlob struct {
    Namespace []byte
    Data      []byte
}

type TxResult struct {
    TxHash   string
    Height   int64
    GasUsed  int64
    Code     uint32
    Error    string
}

The submit/ submodule implements this interface, converting RawBlob to cosmos-sdk types internally.

Build integration
  • cmd/apex/main.go imports submit/ only when submission is configured
  • Read-only deployments compile without the submodule (build tags or conditional import)
  • CI tests the core module and submit module independently

Related issues

  • #4 — Custom tx submission client (parent)
  • #8 — Nonce management (lives in submit/)
  • #9 — Keyring and signing (lives in submit/)
  • #17 — Gas estimation (lives in submit/)
  • #18 — Rate limiting / circuit breaker (can live in core, no cosmos-sdk needed)
  • #19 — Tx confirmation lifecycle (lives in submit/)
  • #5 — Multi-account support (lives in submit/)
Ngôn ngữ chính
Go
Star
4
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của evstack/apex

Tất cả issue của evstack/apex

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.