Skip to content

Conversation

@troian
Copy link
Member

@troian troian commented Nov 10, 2025

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

@troian troian requested a review from a team as a code owner November 10, 2025 17:05
@github-actions github-actions bot added the C:CLI label Nov 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

Swaps direct genesis-file reading and tmhash-based hashing for a server-provided genesis document provider that supplies a Sha256Checksum; writes that checksum to state. Also updates a cosmos-sdk replacement version in go.mod.

Changes

Cohort / File(s) Summary
Genesis checksum provider change
cmd/akash/cmd/testnetify/testnetify.go
Replace direct file read + tmhash.Sum(json) with sdksrv.GetGenDocProvider(config) → call provider, use genDoc.Sha256Checksum as updatedChecksum, persist under GenesisDocHashKey; remove tmhash import.
Dependency replacement update
go.mod
Update github.com/cosmos/cosmos-sdk replacement version from akash.7 to akash.b.10.

Sequence Diagram

sequenceDiagram
    participant CLI as testnetify CLI
    participant Provider as sdksrv.GetGenDocProvider
    participant GenDoc as GenesisDoc
    participant DB as State DB

    rect rgb(235, 250, 235)
    Note over CLI,Provider: Provider-backed checksum flow
    CLI->>Provider: genDocProvider := GetGenDocProvider(config)
    CLI->>Provider: genDoc := genDocProvider()
    Provider->>GenDoc: load/build genesis doc
    GenDoc-->>Provider: return genDoc (includes Sha256Checksum)
    Provider-->>CLI: genDoc returned
    CLI->>DB: write genDoc.Sha256Checksum -> GenesisDocHashKey
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review testnetify.go for error handling around genDocProvider() and that Sha256Checksum semantics match prior storage/consumption.
  • Verify GenesisDocHashKey encoding/format remains compatible with consumers.
  • Confirm go.mod replacement bump to akash.b.10 does not require API adjustments elsewhere.

Possibly related PRs

Poem

🐇 I hopped to the genesis tree,
The provider hummed the checksum to me,
No loose file hashes to bind,
Sha256 stamped, I left it signed,
I wrote the key and danced with glee.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is a template with placeholder content ('Closes: #XXXX') and an unchecked Author Checklist, lacking substantive details about the changeset. Provide an actual description explaining the changes, their motivation, and critical files to review, rather than using the empty template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing genesis document provider usage with cosmos SDK's provider function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch testnetify1

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4715f2c and 28a221c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • cmd/akash/cmd/testnetify/testnetify.go (2 hunks)
  • go.mod (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod
⏰ 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). (8)
  • GitHub Check: network-upgrade
  • GitHub Check: sims
  • GitHub Check: tests
  • GitHub Check: coverage
  • GitHub Check: lint-go
  • GitHub Check: release-dry-run
  • GitHub Check: build-bins
  • GitHub Check: build-macos
🔇 Additional comments (2)
cmd/akash/cmd/testnetify/testnetify.go (2)

327-335: Code verified: genesis checksum field implementation is correct.

The new implementation properly retrieves the checksum from genDoc.Sha256Checksum. Verification confirms:

  • Sha256Checksum field exists on the ChecksummedGenesisDoc type
  • genDocProvider() returns ChecksummedGenesisDoc with the Sha256Checksum field
  • Type is []byte, consistent with all usages (SetSync and hex.EncodeToString)
  • All tmhash imports have been removed

The changes are clean, correct, and follow SDK patterns.


305-305: Genesis doc provider function is available and correctly used.

The change to sdksrv.GetGenDocProvider(config) is valid. GetGenDocProvider returns a closure with signature func() (*cmttypes.GenesisDoc, error), and it is correctly stored, called at line 329, and passed to node.LoadStateFromDBOrGenesisDocProvider at line 346. The Sha256Checksum field in GenesisDoc is the SHA-256 hash of the GenesisDoc serialization, which is properly accessed at line 330.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 853b18a and a527d64.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • cmd/akash/cmd/testnetify/testnetify.go (2 hunks)
  • go.mod (1 hunks)
🧰 Additional context used
🪛 golangci-lint (2.5.0)
cmd/akash/cmd/testnetify/testnetify.go

[error] 305-305: : # pkg.akt.dev/node/cmd/akash/cmd/testnetify
cmd/akash/cmd/testnetify/testnetify.go:305:27: undefined: sdksrv.GetGenDocProvider

(typecheck)

⏰ 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). (8)
  • GitHub Check: network-upgrade
  • GitHub Check: build-bins
  • GitHub Check: tests
  • GitHub Check: release-dry-run
  • GitHub Check: build-macos
  • GitHub Check: lint-go
  • GitHub Check: coverage
  • GitHub Check: sims
🔇 Additional comments (1)
cmd/akash/cmd/testnetify/testnetify.go (1)

327-335: Verify external dependency implementations for Sha256Checksum population and algorithm equivalence.

The code correctly accesses genDoc.Sha256Checksum and uses it as []byte (confirmed by hex.EncodeToString() usage). However, verification of the external cosmos-sdk and pkg.akt.dev/node implementations is required:

  1. Confirm sdksrv.GetGenDocProvider() populates Sha256Checksum correctly in cosmos-sdk v0.53.4-akash.b.8
  2. Verify the checksum algorithm in the genesis document provider matches the previous tmhash.Sum() implementation
  3. Ensure the field type on the returned genesis document object is []byte as expected

Signed-off-by: Artur Troian <troian@users.noreply.github.com>
@troian troian merged commit eba5456 into main Nov 10, 2025
18 checks passed
@troian troian deleted the testnetify1 branch November 10, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants