Skip to content

Refactoring/rename binary ogd#42

Open
khalifaT wants to merge 8 commits intochore/open-source-preparationfrom
refactoring/rename-binary-ogd
Open

Refactoring/rename binary ogd#42
khalifaT wants to merge 8 commits intochore/open-source-preparationfrom
refactoring/rename-binary-ogd

Conversation

@khalifaT
Copy link
Collaborator

@khalifaT khalifaT commented Mar 12, 2026

Rename binary from evmd to ogd

📋 Summary

Complete rename of the main binary from evmd to ogd. All user-facing references updated while preserving Go module structure and internal type names for compatibility.

📝 Changes

Core Binary & Build System

  • ✅ Renamed command directory: evmd/cmd/evmd/evmd/cmd/ogd/
  • ✅ Updated binary name in Makefile: EXAMPLE_BINARY := ogd
  • ✅ Changed app name constant in evmd/app.go: const appName = "ogd"
  • ✅ Updated import path in main.go: evmd/cmd/ogd/cmd
  • ✅ Changed default home directory: ~/.evmd~/.ogd

Shell Scripts (10+ files)

  • local_node.sh - All evmd commands → ogd
  • multi_node_startup.sh - All evmd commands → ogd
  • test_deployment.sh - All evmd commands → ogd
  • scripts/run-solidity-tests.sh - Temp directory and comments
  • scripts/tests_compatibility_*.sh - Echo messages and log paths
  • ✅ All test scripts in tests/jsonrpc/scripts/ogd/

Docker & Container Configuration

  • ✅ Docker image: cosmos/evmdcosmos/ogd
  • ✅ Directory: contrib/images/evmd-env/contrib/images/ogd-env/
  • ✅ Dockerfile: Binary copy commands updated to use ogd
  • ✅ Container names: evmd-*ogd-*
  • ✅ Environment variables: EVMDHOMEOGDHOME, EVMD_URLOGD_URL
  • ✅ Service names in docker-compose.yml
  • ✅ Script directory: tests/jsonrpc/scripts/evmd/tests/jsonrpc/scripts/ogd/
  • ✅ Script files renamed:
    • start-evmd.shstart-ogd.sh
    • stop-evmd.shstop-ogd.sh
    • container-start-evmd.shcontainer-start-ogd.sh

CI/CD & Deployment

  • .github/workflows/aws-deploy.yml - Dockerfile path updated to ogd-env
  • ✅ Makefile targets updated: ogd-env, localnet-build-env

Documentation

  • evmd/README.md - Binary name in configuration table
  • tests/jsonrpc/README.md - All references to binary and paths
  • tests/systemtests/README.md - Binary paths and examples
  • precompiles/slashing/README.md & query.go - Path references (.evmd.ogd)
  • precompiles/staking/types.go - CLI example (evmd cometogd comet)
  • client/debug/debug.go - Example command updated
  • tests/solidity/test-helper.js - Messages and logging
  • tests/solidity/suites/precompiles/test/5_slashing/queries.js - Path comment
  • evmd/tests/network/util.go - Directory path in test setup

Configuration Files

  • evmd/config/config.go - Home directory path update

✅ Preserved (Intentionally Unchanged)

To maintain compatibility with upstream and avoid breaking changes:

Item Reason
github.com/cosmos/evm/evmd Go module path (breaking change if modified)
package evmd Go package declarations
type EVMD struct Go type names (breaking API change)
evmd/ directory name Matches module structure
evmDenom, EvmDenom variables Semantic meaning (EVM denomination, not binary name)
test-evmd Makefile target Internal test target name
coverage_evmd.txt Internal coverage file name
EVMD_DIR Makefile variable Directory reference
PACKAGES_EVMD variable Internal variable naming

🧪 Testing

Verified the following work correctly:

Local Build & Execution

✅ make clean
✅ make build
✅ ./build/ogd version
✅ make install
✅ which ogd
✅ ogd --help
✅ ogd config home  # Returns ~/.ogd
x unders test

Docker

✅ make localnet-build-env
✅ docker images | grep cosmos/ogd
✅ docker run --rm --entrypoint="" cosmos/ogd ogd version
✅ docker-compose config  # Valid syntax
x unders test

Local Development

✅ ./local_node.sh -y --overwrite
✅ curl -X POST http://localhost:8545 -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
✅ Home directory created at ~/.ogd

Tests

✅ make test-unit
✅ cd evmd && go test ./...
x unders test

## 🔄 Upstream Sync Strategy

This fork permanently maintains `ogd` as the binary name, creating intentional divergence from upstream `cosmos/evm`.

### When Syncing Upstream

**Files with expected conflicts:**
- ✅ Shell scripts (`*.sh`)
- ✅ Makefiles
- ✅ Docker configurations
- ✅ Documentation files
- ✅ GitHub workflows

**Files that merge cleanly:**
- ✅ Core Go code (module structure preserved)
- ✅ Smart contracts and precompiles
- ✅ Proto definitions
- ✅ Most test files (unless they reference binary)

- Rename main binary from evmd to ogd throughout codebase
- Update CLI command references in all shell scripts
- Change home directory from .evmd to .ogd
- Update Docker container names and image references
- Rename script directory: tests/jsonrpc/scripts/evmd -> ogd
- Rename script files: start-evmd.sh, stop-evmd.sh, container-start-evmd.sh
- Update import path: evmd/cmd/evmd/cmd -> evmd/cmd/ogd/cmd
Changes:
- Update all test compatibility scripts (hardhat, viem, common)
- Update test_deployment.sh with ogd CLI commands
- Update docker-compose.yml: rename service, container, env vars
- Update tests/jsonrpc/README.md with ogd references
- Change temp directories and log paths in scripts
Changes:
- evmd/app.go: Change appName constant from 'evmd' to 'ogd'
- evmd/README.md: Update binary name in configuration table

Documentation updates:
- precompiles/slashing: Update .evmd -> .ogd paths in docs and code
- precompiles/staking: Update CLI example (evmd -> ogd comet)
- tests/systemtests: Update README with ogd binary references
- tests/solidity: Update test helper messages and path references
- client/debug: Update example command chain-id
                                               nces
Build/deployment updates:
- .github/workflows/aws-deploy.yml: Update Dockerfile path to ogd-env
- evmd/tests/network/util.go: Update node directory path
- tests/systemtests/chainupgrade: Update comment reference
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Renames the project’s primary executable from evmd to ogd across build tooling, CLI entrypoints, scripts, docker/test infrastructure, and user-facing docs while keeping the Go module/package structure under evmd/ for compatibility.

Changes:

  • Renamed/rewired the Go CLI entrypoint to build and execute as ogd (including default home directory updates to .ogd).
  • Updated system/solidity/jsonrpc test harnesses and scripts to invoke ogd instead of evmd.
  • Added ogd-env docker image scaffolding and updated CI to build from it.

Reviewed changes

Copilot reviewed 32 out of 38 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/systemtests/chainupgrade/v4_v5.go Updates chain-upgrade system test references for renamed binary.
tests/systemtests/README.md Updates systemtest instructions/examples to use ogd.
tests/solidity/test-helper.js Updates logging/messages for renamed binary during solidity tests.
tests/solidity/suites/precompiles/test/5_slashing/queries.js Updates comment path to .ogd home directory.
tests/jsonrpc/scripts/stop-networks.sh Updates orchestration script to stop ogd instead of evmd.
tests/jsonrpc/scripts/start-networks.sh Updates orchestration script to start ogd instead of evmd.
tests/jsonrpc/scripts/run-compat-test.sh Updates JSON-RPC compat runner to use cosmos/ogd and .ogd data dir.
tests/jsonrpc/scripts/ogd/stop-ogd.sh Adds/updates ogd stop script for JSON-RPC testing.
tests/jsonrpc/scripts/ogd/start-ogd.sh Adds/updates ogd start/init script for JSON-RPC testing.
tests/jsonrpc/scripts/ogd/container-start-ogd.sh Adds/updates container entry script to initialize/start ogd.
tests/jsonrpc/docker-compose.yml Renames compose service/image to ogd and updates volumes/env.
tests/jsonrpc/README.md Updates JSON-RPC compatibility docs to refer to ogd paths/scripts.
test_deployment.sh Updates devnet deployment script commands/messages to ogd.
scripts/tests_compatibility_viem.sh Updates viem compatibility script messaging for ogd.
scripts/tests_compatibility_hardhat.sh Updates hardhat compatibility script messaging for ogd.
scripts/tests_compatibility_common.sh Updates shared compatibility helpers to use ogd log naming/messages.
scripts/run-solidity-tests.sh Updates solidity test runner temp dir/messages for ogd.
precompiles/staking/types.go Updates CLI comment example to ogd.
precompiles/slashing/query.go Updates .ogd home path in documentation comment.
precompiles/slashing/README.md Updates .ogd home path reference in docs.
multi_node_startup.sh Updates multi-node script commands/messages to ogd.
local_node.sh Updates local node script commands/messages to ogd.
evmd/tests/network/util.go Updates network test directory layout reference to ogd.
evmd/config/config.go Changes default node home from .evmd to .ogd.
evmd/cmd/ogd/main.go Switches main entrypoint import/execute name to ogd.
evmd/cmd/ogd/cmd/testnet_utils_test.go Adds tests for config override parsing/apply behavior.
evmd/cmd/ogd/cmd/testnet_utils.go Adds reflection-based config override application for testnet configs.
evmd/cmd/ogd/cmd/testnet_test.go Adds tests for validator power parsing behavior.
evmd/cmd/ogd/cmd/testnet.go Updates CLI examples/flags/help text from evmd to ogd.
evmd/cmd/ogd/cmd/root.go Updates root command Use to ogd.
evmd/cmd/ogd/cmd/creator.go Adds app creator/export wiring for the ogd command package.
evmd/app.go Updates application name constant to ogd.
evmd/README.md Updates user-facing readme binary name to ogd.
contrib/images/ogd-env/wrapper.sh Adds wrapper script for ogd-env image.
contrib/images/ogd-env/Dockerfile Adds docker build for ogd-env image.
client/debug/debug.go Updates example CLI usage to --chain-id ogd-1.
Makefile Renames build output binary to ogd and updates systemtest copy steps.
.github/workflows/aws-deploy.yml Updates AWS deploy workflow to build using ogd-env Dockerfile.
Comments suppressed due to low confidence (1)

evmd/tests/network/util.go:169

  • This changes the per-validator node directory from .../<moniker>/evmd to .../<moniker>/ogd, but the same test network package still creates and uses .../<nodeDirName>/evmd elsewhere (e.g. evmd/tests/network/network.go sets nodeDir to .../evmd). This inconsistency will likely cause genesis/config files to be written to one directory and read from another. Either update the rest of the network test harness to use ogd consistently or keep this directory name as evmd to match the existing layout.
		nodeDir := filepath.Join(outputDir, vals[i].Moniker, "ogd")
		gentxsDir := filepath.Join(outputDir, "gentxs")

		cmtCfg.Moniker = vals[i].Moniker
		cmtCfg.SetRoot(nodeDir)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Makefile Outdated
git checkout v0.5.0
make build
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/v0.5
cp $(BUILDDIR)/$(EXAMPLE_BINARY) ./tests/systemtests/binaries/v0.5
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

build-v05 checks out tag v0.5.0 and runs make build there, which will produce the legacy binary name (very likely build/evmd). However this recipe then copies $(BUILDDIR)/$(EXAMPLE_BINARY) (now ogd), so the copy will fail and downstream system upgrade tests won’t have the legacy binary. Consider hardcoding the legacy filename for this target (or invoking make build EXAMPLE_BINARY=evmd while on v0.5.0) and then copying the resulting build/evmd into ./tests/systemtests/binaries/v0.5/.

Suggested change
cp $(BUILDDIR)/$(EXAMPLE_BINARY) ./tests/systemtests/binaries/v0.5
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/v0.5

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 22
upgradeHeight int64 = 12
upgradeName = "v0.5.0-to-v0.6.0" // must match UpgradeName in evmd/upgrades.go
upgradeName = "v0.5.0-to-v0.6.0" // must match UpgradeName in ogd/upgrades.go
)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The comment references ogd/upgrades.go, but the UpgradeName constant is currently defined in evmd/upgrades.go. This comment should match the actual file location to avoid confusion during future upgrades/refactors.

Copilot uses AI. Check for mistakes.
Comment on lines 40 to 42
legacyBinary := systest.WorkDir + "/binaries/v0.5/ogd"
sut.SetExecBinary(legacyBinary)
sut.SetTestnetInitializer(systest.InitializerWithBinary(legacyBinary, sut))
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The system upgrade test now expects the legacy (v0.5) binary to be at .../binaries/v0.5/ogd, but the build-v05 Makefile target checks out v0.5.0 and will most likely produce the legacy binary as evmd (not ogd). This mismatch will cause the chain upgrade scenario to fail when it tries to start the legacy chain. Either keep the legacy binary path as .../evmd for v0.5, or ensure the build-v05 step renames/copies the legacy binary to ogd in that folder.

Copilot uses AI. Check for mistakes.
Comment on lines 32 to 35
# evmd is a separate module under ./evmd
EVMD_DIR := evmd
EVMD_MAIN_PKG := ./cmd/evmd
EVMD_MAIN_PKG := ./cmd/ogd

Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

PR description mentions updating localnet/docker targets for the renamed binary/image, but the top-level Makefile still has localnet targets that reference contrib/images evmd-env and cosmos/evmd (see Makefile lines ~364-370). This looks like an incomplete rename and will prevent make localnet-build-env / make localnet-start from producing/using the cosmos/ogd image as intended.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 39 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

contrib/images/ogd-env/Dockerfile:35

  • The image build still copies /work/build/evmd into the runtime image, but make build now outputs build/ogd (see root Makefile). This will make the Docker build fail (or produce an image without an ogd binary on PATH), breaking localnet-build-env and the JSON-RPC scripts that run ogd .... Update the artifact paths (and the linkage check) to use the new binary name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 395 to 399
mkdir -p ./tests/systemtests/binaries/v0.5
git checkout v0.5.0
make build
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/v0.5
cp $(BUILDDIR)/$(EXAMPLE_BINARY) ./tests/systemtests/binaries/v0.5
git checkout -
Comment on lines 39 to 41

legacyBinary := systest.WorkDir + "/binaries/v0.5/evmd"
legacyBinary := systest.WorkDir + "/binaries/v0.5/ogd"
sut.SetExecBinary(legacyBinary)
COPY contrib/images/ogd-env/wrapper.sh /usr/bin/wrapper.sh
COPY test_deployment.sh /usr/bin/test_deployment.sh
COPY multi_node_startup.sh /usr/bin/multi_node_startup.sh
COPY --from=evmd-builder /work/build/evmd /evmd/
Copy link
Collaborator

Choose a reason for hiding this comment

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

this could be an issue due to workdir diff

@khalifaT khalifaT marked this pull request as ready for review March 13, 2026 13:11
@khalifaT khalifaT force-pushed the chore/open-source-preparation branch from b4335d9 to 910ac9b Compare March 13, 2026 13:35
@khalifaT khalifaT mentioned this pull request Mar 13, 2026
4 tasks
@rahulghangas rahulghangas mentioned this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants