Skip to content

Conversation

@mojtaba-esk
Copy link
Contributor

Describe your changes and provide context

This PR is a followup for #2835 to handle a case where the user already has their own genesis file and does not want to remove them or overwrite them. Here is the slack comment by @masih that suggested this fix: https://sei-network-io.slack.com/archives/C06A3D4FWE5/p1770833867974669?thread_ts=1770803742.497719&cid=C06A3D4FWE5

Testing performed to validate your change

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 12, 2026, 3:25 PM

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.31%. Comparing base (f45028f) to head (64694f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2868   +/-   ##
=======================================
  Coverage   48.31%   48.31%           
=======================================
  Files         671      671           
  Lines       50580    50580           
=======================================
+ Hits        24438    24440    +2     
+ Misses      24001    24000    -1     
+ Partials     2141     2140    -1     
Flag Coverage Δ
sei-cosmos 48.13% <ø> (+<0.01%) ⬆️
sei-db 68.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@masih masih left a comment

Choose a reason for hiding this comment

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

Nice thank you for getting this sorted so quickly 🚀

No blockers; just minor comments.

return nil, errors.Wrap(err, "Failed to marshall default genesis state")
}
genDoc := &types.GenesisDoc{ChainID: chainID, AppState: appState}
if fi, err := os.Stat(genFile); err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto re DIR check. We probably can refactor the existing file checking to use here as well as above.

func TestLoadOrWriteGenesis_ExplicitConfigWins(t *testing.T) {
dir := t.TempDir()
genFile := filepath.Join(dir, "genesis.json")
chainID := "atlantic-2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would define this as const instead of var? Ditto for other such names constant in this file.

@masih masih requested a review from sei-will February 12, 2026 09:43
@mojtaba-esk mojtaba-esk merged commit 14d3478 into main Feb 12, 2026
40 checks passed
@mojtaba-esk mojtaba-esk deleted the mojtaba/respect-existing-genesis-file branch February 12, 2026 15:39
yzang2019 added a commit that referenced this pull request Feb 12, 2026
* main:
  chore: remove wasm dir on unsafe-reset (#2875)
  fix: respect existing genesis file (#2868)
  fix to halt due to reconstructing block from bad proposal (backported #2823) (#2873)
  chore(refactor): drop unused code (#2811)
  made the peer dialing less aggressive (backported #2799) (#2872)
  perf(store): lazy-init `sortedCache` in `cachekv.Store` (#2804)
  feat: embed genesis for well-known chains (#2835)
  fix: use MADV_RANDOM during loadtree (#2857)
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