Skip to content

Conversation

@aljo242
Copy link
Contributor

@aljo242 aljo242 commented Aug 28, 2025

Context

We updated to cometbft v1/v2 in the repo to future proof ourselves. ICL's new approach to comet and SDK compatibility will be similar to what we did with SDK v53. We want to break folks as minimally as possible, while focusing of delivering features.

Our new roadmap includes heavy investments in performance of the stack, both in cometbft and in the sdk. To do this, we want to unblock ourselves and downstream users from being broken in the future to adopt said features. Important things found in cometbft v1/v2 like BLS signatures etc will be backported and supported fully with this new approach

Process

git revert b71d0894f067f06e5c7acf4499156093aa076423

Summary by CodeRabbit

  • Documentation

    • Updated Unreleased notes: moved sr25519 removal under Breaking Changes and removed outdated CometBFT v2 migration guidance.
  • Chores/Build

    • Switched build to use the current CometBFT module version.
    • Refreshed protobuf dependencies to the Tendermint proto layout.
    • Consolidated proto update workflow and cleaned up related targets.

@aljo242 aljo242 requested a review from technicallyty August 28, 2025 21:57
@aljo242 aljo242 requested a review from Eric-Warehime August 28, 2025 21:57
@aljo242 aljo242 changed the title refactor!: investigate cometbft refactor: investigate cometbft Aug 28, 2025
@aljo242 aljo242 changed the title refactor: investigate cometbft refactor: bring cometbft back to v0.38.x family Aug 29, 2025
@aljo242 aljo242 marked this pull request as ready for review August 29, 2025 18:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

📝 Walkthrough

Walkthrough

The changelog moves sr25519 removal to the Breaking Changes section and removes the CometBFT v2 migration note. The Makefile switches CometBFT module/version resolution to the base module, replaces proto paths from cometbft/* to tendermint/*, rewrites proto fetch/update targets, and adjusts ldflags and phony targets accordingly.

Changes

Cohort / File(s) Summary
Changelog updates
CHANGELOG.md
- Removed CometBFT v2 migration note and import-path guidance from Unreleased
- Added Breaking Changes entry for sr25519 removal referencing CometBFT v1.x removal
- Removed sr25519 item from API Breaking Changes subsection
Build/version wiring
Makefile
- CMTVERSION now derives from github.com/cometbft/cometbft (not /v2)
- Updated ldflags -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(CMTVERSION)
Proto layout and URLs
Makefile
- Switched proto base URL to https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0/proto/tendermint
- Removed old cometbft proto path variables (CMT_VERSION_DIR, CMT_PROTO, cometbft/*)
- Added tendermint proto path vars: CMT_CRYPTO_TYPES, CMT_ABCI_TYPES, CMT_TYPES, CMT_VERSION, CMT_LIBS, CMT_P2P
Proto fetch/update workflow
Makefile
- Replaced proto-update-comet with proto-update-deps target
- Updated curl commands to fetch tendermint proto files (types, abci/types, version/types, crypto, libs/bits, p2p/types) with -sSL
- In Docker path, replaced buf dep update with buf mod update
Targets and phony declarations
Makefile
- .PHONY updated to remove proto-update-comet and keep proto-update-deps
- Proto-related targets now reference tendermint paths and removed obsolete per-proto constants

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant MK as Makefile: proto-update-deps
  participant GH as GitHub Raw (cometbft v0.38.0)
  participant FS as Local FS
  participant DK as Docker (buf)

  Dev->>MK: make proto-update-deps
  MK->>GH: curl -sSL proto/tendermint/.../*.proto
  GH-->>MK: .proto contents
  MK->>FS: Write tendermint proto files
  MK->>DK: buf mod update
  DK-->>MK: Module deps updated
  MK-->>Dev: Proto deps refreshed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/mega-revert

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
CHANGELOG.md (2)

42-49: Call out the CometBFT rollback as a Breaking Change (module path + proto namespace).

Given the repo is reverting from CometBFT v1/v2 to v0.38.x, add an explicit bullet here noting:

  • Go module path switched back to github.com/cometbft/cometbft (no /v2).
  • Protobuf namespaces switched from cometbft/* back to tendermint/*.
  • Action items for integrators (e.g., update imports, re-run proto generation).

This avoids ambiguity for downstreams.

Apply something like:

+* (deps/proto) Revert CometBFT to v0.38.x: module path is `github.com/cometbft/cometbft` (no `/v2`); protobuf packages moved back to `tendermint/*`. Downstreams must update imports and regenerate protos.

56-56: “comet/v2 PubKeys” reference is inconsistent with the v0.38.x rollback.

This feature description still mentions converting from comet/v2 PubKeys. Either:

  • Update wording to reflect v0.38.x types, or
  • Note that the helper handles v2 types for forward-compat while the SDK targets v0.38.x.

Without clarification, this conflicts with the PR’s objective.

-* (crypto) [#24861] add `PubKeyFromCometTypeAndBytes` helper function to convert from `comet/v2` PubKeys to the `cryptotypes.Pubkey` interface.
+* (crypto) [#24861] add `PubKeyFromCometTypeAndBytes` helper to convert CometBFT PubKeys to `cryptotypes.PubKey`. Note: when targeting v0.38.x, this helper remains for forward-compat with v1/v2 key encodings.
🧹 Nitpick comments (1)
Makefile (1)

15-16: Double-check TMCoreSemVer injection against CometBFT v0.38.x.

  • Path github.com/cometbft/cometbft/version.TMCoreSemVer matches v0.38.x; verify the symbol name hasn’t changed across patch versions.
  • Confirm go list -m github.com/cometbft/cometbft yields a tag with leading v (e.g., v0.38.10) so downstream uses get a consistent semver string.

If needed, tighten extraction to avoid empty results on replace directives:

-export CMTVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
+export CMTVERSION := $(shell go list -m -f '{{.Version}}' github.com/cometbft/cometbft)

Also applies to: 70-71

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between ca3d0fe and c3ffaf5.

⛔ Files ignored due to path filters (88)
  • api/cometbft/abci/v2/service.pulsar.go is excluded by !**/*.pulsar.go
  • api/cometbft/abci/v2/service_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cometbft/p2p/v1/conn.pulsar.go is excluded by !**/*.pulsar.go
  • api/cometbft/p2p/v1/pex.pulsar.go is excluded by !**/*.pulsar.go
  • api/cometbft/types/v2/canonical.pulsar.go is excluded by !**/*.pulsar.go
  • api/cometbft/types/v2/events.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/base/abci/v1beta1/abci.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/base/tendermint/v1beta1/query.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/base/tendermint/v1beta1/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/circuit/module/v1/module.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/circuit/v1/query.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/circuit/v1/query_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/circuit/v1/tx.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/circuit/v1/tx_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/circuit/v1/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/consensus/v1/query.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/consensus/v1/tx.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/evidence/module/v1/module.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/module/v1/module.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/v1/events.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/v1/genesis.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/v1/query.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/v1/query_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/group/v1/tx.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/group/v1/tx_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/group/v1/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/module/v1/module.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/event.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/genesis.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/nft.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/query.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/query_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/nft/v1beta1/tx.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/nft/v1beta1/tx_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/cosmos/staking/v1beta1/staking.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/store/streaming/abci/grpc.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/store/v1beta1/listening.pulsar.go is excluded by !**/*.pulsar.go
  • api/cosmos/tx/v1beta1/service.pulsar.go is excluded by !**/*.pulsar.go
  • api/go.mod is excluded by !**/*.mod
  • api/go.sum is excluded by !**/*.sum, !**/*.sum
  • api/tendermint/abci/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/abci/types_grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • api/tendermint/crypto/keys.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/crypto/proof.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/libs/bits/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/p2p/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/types/block.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/types/evidence.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/types/params.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/types/types.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/types/validator.pulsar.go is excluded by !**/*.pulsar.go
  • api/tendermint/version/types.pulsar.go is excluded by !**/*.pulsar.go
  • client/grpc/cmtservice/query.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • client/grpc/cmtservice/types.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • client/v2/go.mod is excluded by !**/*.mod
  • client/v2/go.sum is excluded by !**/*.sum, !**/*.sum
  • collections/go.mod is excluded by !**/*.mod
  • collections/go.sum is excluded by !**/*.sum, !**/*.sum
  • core/go.mod is excluded by !**/*.mod
  • core/go.sum is excluded by !**/*.sum, !**/*.sum
  • crypto/keys/bls12_381/keys.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • depinject/go.mod is excluded by !**/*.mod
  • depinject/go.sum is excluded by !**/*.sum, !**/*.sum
  • errors/go.mod is excluded by !**/*.mod
  • errors/go.sum is excluded by !**/*.sum, !**/*.sum
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
  • proto/buf.lock is excluded by !**/*.lock, !**/*.lock
  • proto/buf.yaml is excluded by !**/*.yaml
  • simapp/go.mod is excluded by !**/*.mod
  • simapp/go.sum is excluded by !**/*.sum, !**/*.sum
  • store/go.mod is excluded by !**/*.mod
  • store/go.sum is excluded by !**/*.sum, !**/*.sum
  • store/streaming/abci/grpc.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • store/types/listening.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • systemtests/go.mod is excluded by !**/*.mod
  • systemtests/go.sum is excluded by !**/*.sum, !**/*.sum
  • tests/go.mod is excluded by !**/*.mod
  • tests/go.sum is excluded by !**/*.sum, !**/*.sum
  • tests/systemtests/go.mod is excluded by !**/*.mod
  • tests/systemtests/go.sum is excluded by !**/*.sum, !**/*.sum
  • testutil/cli/cmt_mocks.go is excluded by !**/*_mocks.go
  • tools/benchmark/go.mod is excluded by !**/*.mod
  • tools/benchmark/go.sum is excluded by !**/*.sum, !**/*.sum
  • tools/confix/go.mod is excluded by !**/*.mod
  • tools/confix/go.sum is excluded by !**/*.sum, !**/*.sum
  • tools/cosmovisor/go.mod is excluded by !**/*.mod
  • tools/cosmovisor/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • Makefile (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: test-system-legacy
  • GitHub Check: test-system
  • GitHub Check: tests (00)
  • GitHub Check: test-e2e
  • GitHub Check: Analyze
  • GitHub Check: markdown-link-check
  • GitHub Check: Gosec
  • GitHub Check: golangci-lint
  • GitHub Check: Summary

* `x/crisis`
* [#24837](https://github.com/cosmos/cosmos-sdk/pull/24837) Update to using CometBFT v2.
* This update changes the import paths from `cometbft/cometbft` to `cometbft/cometbft/v2`. Users can use the [migration tool](./tools/migration/TODO) to automatically update their nodes.
* (crypto) [#24414](https://github.com/cosmos/cosmos-sdk/pull/24414) Remove sr25519 support, since it was removed in CometBFT v1.x (see: CometBFT [#3646](https://github.com/cometbft/cometbft/pull/3646)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Clarify sr25519 removal rationale vs. current dependency.

The note says sr25519 was removed in CometBFT v1.x, but we now depend on v0.38.x. Make it explicit that the SDK removes sr25519 regardless of the CometBFT version to maintain forward-compat and reduce maintenance. Link any migration/UPGRADING steps if applicable.

-* (crypto) [#24414] Remove sr25519 support, since it was removed in CometBFT v1.x (see: CometBFT #3646).
+* (crypto) [#24414] Remove sr25519 support in the SDK. Although the dependency is reverted to CometBFT v0.38.x, sr25519 remains removed to align with CometBFT ≥ v1.x (see: CometBFT #3646) and to simplify forward compatibility.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* (crypto) [#24414](https://github.com/cosmos/cosmos-sdk/pull/24414) Remove sr25519 support, since it was removed in CometBFT v1.x (see: CometBFT [#3646](https://github.com/cometbft/cometbft/pull/3646)).
* (crypto) [#24414] Remove sr25519 support in the SDK. Although the dependency is reverted to CometBFT v0.38.x, sr25519 remains removed to align with CometBFT v1.x (see: CometBFT #3646) and to simplify forward compatibility.
🤖 Prompt for AI Agents
In CHANGELOG.md around line 49, the note about removing sr25519 is ambiguous
because it references CometBFT v1.x while the project currently depends on
v0.38.x; update the changelog line to explicitly state that the SDK removes
sr25519 support proactively (independent of the current CometBFT dependency) to
maintain forward-compatibility and reduce maintenance burden, and append or link
to the relevant migration/UPGRADING notes or a short pointer to steps users must
take when migrating keys or validators.

Comment on lines +434 to +471
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0/proto/tendermint

proto-update-comet:
@echo "Updating Protobuf dependency: downloading cometbft.$(CMT_PROTO) files from CometBFT $(CMT_VERSION_DIR)"
CMT_CRYPTO_TYPES = proto/tendermint/crypto
CMT_ABCI_TYPES = proto/tendermint/abci
CMT_TYPES = proto/tendermint/types
CMT_VERSION = proto/tendermint/version
CMT_LIBS = proto/tendermint/libs/bits
CMT_P2P = proto/tendermint/p2p

proto-update-deps:
@echo "Updating Protobuf dependencies"

@mkdir -p $(CMT_ABCI_TYPES)
@curl -fsSL $(CMT_URL)/abci/$(CMT_PROTO)/service.proto > $(CMT_ABCI_TYPES)/service.proto
@curl -fsSL $(CMT_URL)/abci/$(CMT_PROTO)/types.proto > $(CMT_ABCI_TYPES)/types.proto
@curl -sSL $(CMT_URL)/abci/types.proto > $(CMT_ABCI_TYPES)/types.proto

@mkdir -p $(CMT_VERSION)
@curl -fsSL $(CMT_URL)/version/$(CMT_PROTO)/types.proto > $(CMT_VERSION)/types.proto
@curl -sSL $(CMT_URL)/version/types.proto > $(CMT_VERSION)/types.proto

@mkdir -p $(CMT_TYPES)
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/block.proto > $(CMT_TYPES)/block.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/canonical.proto > $(CMT_TYPES)/canonical.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/events.proto > $(CMT_TYPES)/events.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/evidence.proto > $(CMT_TYPES)/evidence.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/params.proto > $(CMT_TYPES)/params.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/types.proto > $(CMT_TYPES)/types.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/validator.proto > $(CMT_TYPES)/validator.proto
@curl -sSL $(CMT_URL)/types/types.proto > $(CMT_TYPES)/types.proto
@curl -sSL $(CMT_URL)/types/evidence.proto > $(CMT_TYPES)/evidence.proto
@curl -sSL $(CMT_URL)/types/params.proto > $(CMT_TYPES)/params.proto
@curl -sSL $(CMT_URL)/types/validator.proto > $(CMT_TYPES)/validator.proto
@curl -sSL $(CMT_URL)/types/block.proto > $(CMT_TYPES)/block.proto

@mkdir -p $(CMT_CRYPTO_TYPES)
@curl -fsSL $(CMT_URL)/crypto/$(CMT_PROTO)/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto
@curl -fsSL $(CMT_URL)/crypto/$(CMT_PROTO)/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
@curl -sSL $(CMT_URL)/crypto/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
@curl -sSL $(CMT_URL)/crypto/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto

@mkdir -p $(CMT_LIBS)
@curl -fsSL $(CMT_URL)/libs/bits/$(CMT_PROTO)/types.proto > $(CMT_LIBS)/types.proto
@curl -sSL $(CMT_URL)/libs/bits/types.proto > $(CMT_LIBS)/types.proto

@mkdir -p $(CMT_P2P)
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/conn.proto > $(CMT_P2P)/conn.proto
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/pex.proto > $(CMT_P2P)/pex.proto
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/types.proto > $(CMT_P2P)/types.proto
@curl -sSL $(CMT_URL)/p2p/types.proto > $(CMT_P2P)/types.proto

proto-update-deps:
@echo "Updating Protobuf dependencies: running 'buf dep update'"
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf dep update
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps proto-update-comet
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Pin proto source to the exact dependency version and fetch missing merkle proto; make downloads deterministic.

  • Hardcoding v0.38.0 risks mismatches if go.mod uses a different CMTVERSION.
  • Some v0.38 protos import tendermint/crypto/merkle/merkle.proto; it’s not fetched here.
  • Reuse the existing container wrapper $(protoImage) for consistency.
  • Add curl hardening (fail fast, retries).
-CMT_URL              = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0/proto/tendermint
+CMT_URL              = https://raw.githubusercontent.com/cometbft/cometbft/$(CMTVERSION)/proto/tendermint
 CMT_CRYPTO_TYPES     = proto/tendermint/crypto
+CMT_CRYPTO_MERKLE    = proto/tendermint/crypto/merkle
 CMT_ABCI_TYPES       = proto/tendermint/abci
 CMT_TYPES            = proto/tendermint/types
 CMT_VERSION          = proto/tendermint/version
 CMT_LIBS             = proto/tendermint/libs/bits
 CMT_P2P              = proto/tendermint/p2p
@@
 proto-update-deps:
 	@echo "Updating Protobuf dependencies"
 
 	@mkdir -p $(CMT_ABCI_TYPES)
-	@curl -sSL $(CMT_URL)/abci/types.proto > $(CMT_ABCI_TYPES)/types.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/abci/types.proto -o $(CMT_ABCI_TYPES)/types.proto
 
 	@mkdir -p $(CMT_VERSION)
-	@curl -sSL $(CMT_URL)/version/types.proto > $(CMT_VERSION)/types.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/version/types.proto -o $(CMT_VERSION)/types.proto
 
 	@mkdir -p $(CMT_TYPES)
-	@curl -sSL $(CMT_URL)/types/types.proto > $(CMT_TYPES)/types.proto
-	@curl -sSL $(CMT_URL)/types/evidence.proto > $(CMT_TYPES)/evidence.proto
-	@curl -sSL $(CMT_URL)/types/params.proto > $(CMT_TYPES)/params.proto
-	@curl -sSL $(CMT_URL)/types/validator.proto > $(CMT_TYPES)/validator.proto
-	@curl -sSL $(CMT_URL)/types/block.proto > $(CMT_TYPES)/block.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/types/types.proto -o $(CMT_TYPES)/types.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/types/evidence.proto -o $(CMT_TYPES)/evidence.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/types/params.proto -o $(CMT_TYPES)/params.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/types/validator.proto -o $(CMT_TYPES)/validator.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/types/block.proto -o $(CMT_TYPES)/block.proto
 
 	@mkdir -p $(CMT_CRYPTO_TYPES)
-	@curl -sSL $(CMT_URL)/crypto/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
-	@curl -sSL $(CMT_URL)/crypto/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/crypto/proof.proto -o $(CMT_CRYPTO_TYPES)/proof.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/crypto/keys.proto -o $(CMT_CRYPTO_TYPES)/keys.proto
+
+	@mkdir -p $(CMT_CRYPTO_MERKLE)
+	@curl -fSsL --retry 3 $(CMT_URL)/crypto/merkle/merkle.proto -o $(CMT_CRYPTO_MERKLE)/merkle.proto
 
 	@mkdir -p $(CMT_LIBS)
-	@curl -sSL $(CMT_URL)/libs/bits/types.proto > $(CMT_LIBS)/types.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/libs/bits/types.proto -o $(CMT_LIBS)/types.proto
 
 	@mkdir -p $(CMT_P2P)
-	@curl -sSL $(CMT_URL)/p2p/types.proto > $(CMT_P2P)/types.proto
+	@curl -fSsL --retry 3 $(CMT_URL)/p2p/types.proto -o $(CMT_P2P)/types.proto
 
-	$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update
+	$(protoImage) buf mod update
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0/proto/tendermint
proto-update-comet:
@echo "Updating Protobuf dependency: downloading cometbft.$(CMT_PROTO) files from CometBFT $(CMT_VERSION_DIR)"
CMT_CRYPTO_TYPES = proto/tendermint/crypto
CMT_ABCI_TYPES = proto/tendermint/abci
CMT_TYPES = proto/tendermint/types
CMT_VERSION = proto/tendermint/version
CMT_LIBS = proto/tendermint/libs/bits
CMT_P2P = proto/tendermint/p2p
proto-update-deps:
@echo "Updating Protobuf dependencies"
@mkdir -p $(CMT_ABCI_TYPES)
@curl -fsSL $(CMT_URL)/abci/$(CMT_PROTO)/service.proto > $(CMT_ABCI_TYPES)/service.proto
@curl -fsSL $(CMT_URL)/abci/$(CMT_PROTO)/types.proto > $(CMT_ABCI_TYPES)/types.proto
@curl -sSL $(CMT_URL)/abci/types.proto > $(CMT_ABCI_TYPES)/types.proto
@mkdir -p $(CMT_VERSION)
@curl -fsSL $(CMT_URL)/version/$(CMT_PROTO)/types.proto > $(CMT_VERSION)/types.proto
@curl -sSL $(CMT_URL)/version/types.proto > $(CMT_VERSION)/types.proto
@mkdir -p $(CMT_TYPES)
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/block.proto > $(CMT_TYPES)/block.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/canonical.proto > $(CMT_TYPES)/canonical.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/events.proto > $(CMT_TYPES)/events.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/evidence.proto > $(CMT_TYPES)/evidence.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/params.proto > $(CMT_TYPES)/params.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/types.proto > $(CMT_TYPES)/types.proto
@curl -fsSL $(CMT_URL)/types/$(CMT_PROTO)/validator.proto > $(CMT_TYPES)/validator.proto
@curl -sSL $(CMT_URL)/types/types.proto > $(CMT_TYPES)/types.proto
@curl -sSL $(CMT_URL)/types/evidence.proto > $(CMT_TYPES)/evidence.proto
@curl -sSL $(CMT_URL)/types/params.proto > $(CMT_TYPES)/params.proto
@curl -sSL $(CMT_URL)/types/validator.proto > $(CMT_TYPES)/validator.proto
@curl -sSL $(CMT_URL)/types/block.proto > $(CMT_TYPES)/block.proto
@mkdir -p $(CMT_CRYPTO_TYPES)
@curl -fsSL $(CMT_URL)/crypto/$(CMT_PROTO)/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto
@curl -fsSL $(CMT_URL)/crypto/$(CMT_PROTO)/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
@curl -sSL $(CMT_URL)/crypto/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
@curl -sSL $(CMT_URL)/crypto/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto
@mkdir -p $(CMT_LIBS)
@curl -fsSL $(CMT_URL)/libs/bits/$(CMT_PROTO)/types.proto > $(CMT_LIBS)/types.proto
@curl -sSL $(CMT_URL)/libs/bits/types.proto > $(CMT_LIBS)/types.proto
@mkdir -p $(CMT_P2P)
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/conn.proto > $(CMT_P2P)/conn.proto
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/pex.proto > $(CMT_P2P)/pex.proto
@curl -fsSL $(CMT_URL)/p2p/$(CMT_PROTO)/types.proto > $(CMT_P2P)/types.proto
@curl -sSL $(CMT_URL)/p2p/types.proto > $(CMT_P2P)/types.proto
proto-update-deps:
@echo "Updating Protobuf dependencies: running 'buf dep update'"
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf dep update
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps proto-update-comet
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/$(CMTVERSION)/proto/tendermint
CMT_CRYPTO_TYPES = proto/tendermint/crypto
CMT_CRYPTO_MERKLE = proto/tendermint/crypto/merkle
CMT_ABCI_TYPES = proto/tendermint/abci
CMT_TYPES = proto/tendermint/types
CMT_VERSION = proto/tendermint/version
CMT_LIBS = proto/tendermint/libs/bits
CMT_P2P = proto/tendermint/p2p
proto-update-deps:
@echo "Updating Protobuf dependencies"
@mkdir -p $(CMT_ABCI_TYPES)
@curl -fSsL --retry 3 $(CMT_URL)/abci/types.proto -o $(CMT_ABCI_TYPES)/types.proto
@mkdir -p $(CMT_VERSION)
@curl -fSsL --retry 3 $(CMT_URL)/version/types.proto -o $(CMT_VERSION)/types.proto
@mkdir -p $(CMT_TYPES)
@curl -fSsL --retry 3 $(CMT_URL)/types/types.proto -o $(CMT_TYPES)/types.proto
@curl -fSsL --retry 3 $(CMT_URL)/types/evidence.proto -o $(CMT_TYPES)/evidence.proto
@curl -fSsL --retry 3 $(CMT_URL)/types/params.proto -o $(CMT_TYPES)/params.proto
@curl -fSsL --retry 3 $(CMT_URL)/types/validator.proto -o $(CMT_TYPES)/validator.proto
@curl -fSsL --retry 3 $(CMT_URL)/types/block.proto -o $(CMT_TYPES)/block.proto
@mkdir -p $(CMT_CRYPTO_TYPES)
@curl -fSsL --retry 3 $(CMT_URL)/crypto/proof.proto -o $(CMT_CRYPTO_TYPES)/proof.proto
@curl -fSsL --retry 3 $(CMT_URL)/crypto/keys.proto -o $(CMT_CRYPTO_TYPES)/keys.proto
@mkdir -p $(CMT_CRYPTO_MERKLE)
@curl -fSsL --retry 3 $(CMT_URL)/crypto/merkle/merkle.proto -o $(CMT_CRYPTO_MERKLE)/merkle.proto
@mkdir -p $(CMT_LIBS)
@curl -fSsL --retry 3 $(CMT_URL)/libs/bits/types.proto -o $(CMT_LIBS)/types.proto
@mkdir -p $(CMT_P2P)
@curl -fSsL --retry 3 $(CMT_URL)/p2p/types.proto -o $(CMT_P2P)/types.proto
$(protoImage) buf mod update

@aljo242 aljo242 merged commit 727faf0 into main Aug 29, 2025
43 of 45 checks passed
@aljo242 aljo242 deleted the chore/mega-revert branch August 29, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants