-
Notifications
You must be signed in to change notification settings - Fork 865
fix: respect existing genesis file #2868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
masih
left a comment
There was a problem hiding this 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.
cmd/seid/cmd/init.go
Outdated
| 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 { |
There was a problem hiding this comment.
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.
cmd/seid/cmd/init_test.go
Outdated
| func TestLoadOrWriteGenesis_ExplicitConfigWins(t *testing.T) { | ||
| dir := t.TempDir() | ||
| genFile := filepath.Join(dir, "genesis.json") | ||
| chainID := "atlantic-2" |
There was a problem hiding this comment.
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.
* 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)
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