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
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Setup Go
uses: actions/setup-go@v6
uses: actions/setup-go@v6.2.0
with:
go-version: ${{ steps.determine.outputs.version }}
cache: true
15 changes: 8 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Lumera SDK Agent Guide

## Architecture & Config
- `client.Client` (`client/client.go`) fans out to both `blockchain.Client` and `cascade.Client`; add new modules by extending `client.New` so options/config stay in lockstep.
- `client/config.go` hydrates timeouts, 50 MB gRPC limits, retry counts, and `WaitTx` knobs; use `DefaultConfig()` in samples/tests to avoid zero durations.
- `blockchain/client.go` enforces `ensureLumeraBech32Prefixes` and selects TLS using `shouldUseTLS`; follow this heuristic instead of forcing creds per call.
- `client.Client` ([client/client.go](../client/client.go)) fans out to both `blockchain.Client` and `cascade.Client`; add new modules by extending `client.New` so options/config stay in lockstep.
- Config defaults live in `client/config/config.go`; `Config.Validate()` hydrates timeouts, 50 MB gRPC limits, retry counts, and `WaitTx` knobs. Use `client.DefaultConfig()` (alias in `client/config_alias.go`) in samples/tests to avoid zero durations.
- TLS selection lives in `blockchain/base/client.go` (`shouldUseTLS`); follow this heuristic instead of forcing creds per call (unless `InsecureGRPC` is set).
- Address derivation uses `pkg/crypto.AddressFromKey` to avoid mutating global Bech32 config; do not call Cosmos prefix setters in SDK flows.
- `cascade/client.go` wraps the SuperNode SDK via `snconfig.NewConfig`; new Cascade entry points must reuse the same keyring/key name to share signatures.

## Transactions & Waiting
- `blockchain/tx.go` centralizes the tx lifecycle: build with `NewDefaultTxConfig`, resolve account/sequence, simulate gas (adds 30 % buffer), set min `ulume` fees (0.025 gas price), sign with `internal/crypto.SignTxWithKeyring`.
- `blockchain/base/tx.go` centralizes the tx lifecycle: build with `pkg/crypto.NewDefaultTxConfig`, resolve account/sequence, simulate gas (default 1.3x buffer), set min fees from `Config.GasPrice`/`Config.FeeDenom` (defaults set in `blockchain.New`), sign with `pkg/crypto.SignTxWithKeyring`.
- Always broadcast through `Client.Broadcast` + `WaitForTxInclusion`; the waiter (`internal/wait-tx`) prefers CometBFT websockets via `WaitTxConfig.RPCEndpoint` and falls back to gRPC polling.
- `blockchain.Client.ExtractEventAttribute` is how examples retrieve IDs; keep event parsing there so higher layers stay clean.

Expand All @@ -22,13 +23,13 @@
- `cascade.TaskManager` polls `snsdk.Client.GetTask` every second until `COMPLETED`/`FAILED`; extend this manager for new task types instead of bespoke loops.

## Keyring & Examples
- `internal/crypto.NewKeyring`, `GetKey`, and `NewDefaultTxConfig` wrap Cosmos keyring and proto registration; all examples (`examples/*`) show the expected bootstrapping/flag pattern.
- `ensureLumeraBech32Prefixes` seals global Bech32 config once; avoid calling Cosmos prefix setters elsewhere to prevent panics.
- `pkg/crypto.NewKeyring`, `GetKey`, and `NewDefaultTxConfig` wrap Cosmos keyring and proto registration; all examples (`examples/*`) show the expected bootstrapping/flag pattern.
- `pkg/crypto.AddressFromKey` derives bech32 addresses without mutating global prefixes; avoid calling Cosmos prefix setters elsewhere to prevent panics.

## Developer Workflows
- `make sdk` (same as `make build`) compiles all packages; `make examples` or `make example-<name>` drops binaries into `build/`.
- `make test` runs `go test -race -coverprofile=coverage.out ./...` and emits `coverage.html`; `make lint` requires `golangci-lint`.
- Stick to Go 1.25.1 (per `go.mod`) and respect the `replace` pins for CometBFT/Cosmos; update both blockchain + SuperNode deps together when bumping versions.
- Stick to Go 1.25.5 (per `go.mod`) and respect the `replace` pins for CometBFT/Cosmos; update both blockchain + SuperNode deps together when bumping versions.

## Conventions
- Errors wrap context with `fmt.Errorf("context: %w", err)` so callers can unwrap lower layers.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: go test -v ./...

- name: Create Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v2.5.0
with:
generate_release_notes: true
env:
Expand Down
69 changes: 34 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.25.5

// Pin compatible versions to prevent go mod tidy from updating
replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.50.14
github.com/envoyproxy/protoc-gen-validate => github.com/bufbuild/protoc-gen-validate v1.3.0
github.com/lyft/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v1.3.0
nhooyr.io/websocket => github.com/coder/websocket v1.8.7
Expand All @@ -19,15 +18,16 @@ require (
cosmossdk.io/math v1.5.3

// Lumera blockchain types (generated proto)
github.com/LumeraProtocol/lumera v1.9.1
github.com/LumeraProtocol/lumera v1.10.0

// SuperNode SDK for storage operations
github.com/LumeraProtocol/supernode/v2 v2.4.26
github.com/cometbft/cometbft v0.38.18
github.com/cosmos/cosmos-sdk v0.53.0
github.com/LumeraProtocol/supernode/v2 v2.4.27
github.com/cometbft/cometbft v0.38.20
github.com/cosmos/cosmos-sdk v0.53.5
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/v10 v10.3.0
github.com/cosmos/gogoproto v1.7.2
github.com/cosmos/ibc-go/v10 v10.5.0
github.com/ethereum/go-ethereum v1.15.11
github.com/stretchr/testify v1.11.1
go.uber.org/zap v1.27.0

Expand All @@ -36,14 +36,12 @@ require (
lukechampine.com/blake3 v1.4.1
)

require github.com/ethereum/go-ethereum v1.15.11

require (
cosmossdk.io/collections v1.3.0 // indirect
cosmossdk.io/collections v1.3.1 // indirect
cosmossdk.io/core v0.11.3 // indirect
cosmossdk.io/depinject v1.2.0 // indirect
cosmossdk.io/depinject v1.2.1 // indirect
cosmossdk.io/errors v1.0.2 // indirect
cosmossdk.io/log v1.6.0 // indirect
cosmossdk.io/log v1.6.1 // indirect
cosmossdk.io/schema v1.1.0 // indirect
cosmossdk.io/store v1.1.2 // indirect
cosmossdk.io/x/tx v0.14.0 // indirect
Expand All @@ -59,8 +57,8 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.14.1 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/bytedance/sonic v1.14.2 // indirect
github.com/bytedance/sonic/loader v0.4.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
Expand All @@ -72,26 +70,26 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.2 // indirect
github.com/cosmos/cosmos-db v1.1.3 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v1.2.4 // indirect
github.com/cosmos/iavl v1.2.6 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.16.0 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/desertbit/timer v1.0.1 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgraph-io/ristretto v0.2.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/getsentry/sentry-go v0.32.0 // indirect
github.com/getsentry/sentry-go v0.35.0 // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand All @@ -100,8 +98,7 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.5 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
github.com/google/btree v1.1.3 // indirect
Expand Down Expand Up @@ -147,10 +144,10 @@ require (
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
github.com/prometheus/client_golang v1.22.0 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.63.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/cors v1.11.1 // indirect
Expand All @@ -168,29 +165,31 @@ require (
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/zondax/golem v0.27.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
github.com/zondax/ledger-go v1.0.1 // indirect
go.etcd.io/bbolt v1.4.0-alpha.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/mock v0.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.15.0 // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/arch v0.17.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
golang.org/x/net v0.46.1-0.20251013234738-63d1a5100f82 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/term v0.36.0 // indirect
golang.org/x/text v0.30.0 // indirect
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/protobuf v1.36.10 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.2 // indirect
nhooyr.io/websocket v1.8.17 // indirect
pgregory.net/rapid v1.2.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
Loading