Skip to content

refactor: Removing dead code and making patch task more generic#22

Merged
bdchatham merged 2 commits intomainfrom
refactor/improve-patch-task
Mar 6, 2026
Merged

refactor: Removing dead code and making patch task more generic#22
bdchatham merged 2 commits intomainfrom
refactor/improve-patch-task

Conversation

@bdchatham
Copy link
Contributor

Summary

Redesigns the config-patch system as a generic TOML merge-patch mechanism and removes dead code across the seictl task implementations.

  • Generic config-patch: ConfigPatchTask now carries a Files map[string]map[string]any where keys are filenames (e.g. config.toml, app.toml) and values are arbitrary nested patches. The server-side ConfigPatcher applies each via recursive merge, replacing the old hardcoded PatchSet/parsePatchSet approach.
  • Direct config writes: discover-peers and configure-state-sync now write directly to config.toml via mergeAndWrite, eliminating the intermediate .sei-sidecar-peers.json and .sei-sidecar-statesync.json files and their readers.
  • Snapshot extract fix: Snapshot restoration now extracts to data/snapshots/ instead of the home directory root.
  • Dead code removed: signal.go, updatepeers.go, updatepeers_test.go, the legacy {region, chainId} param format in peer discovery, ReadPeersFile, ReadStateSyncFile, and SnapshotGenerationPatch.
  • Shared types: Extracted tendermintStatusResponse and tendermintBlockResponse into tendermint.go.
  • Bug fix: writeUploadState now propagates errors instead of silently swallowing them.

Files removed

  • sidecar/tasks/signal.go
  • sidecar/tasks/updatepeers.go
  • sidecar/tasks/updatepeers_test.go

@bdchatham bdchatham merged commit fbaedf2 into main Mar 6, 2026
4 checks passed
@bdchatham bdchatham deleted the refactor/improve-patch-task branch March 6, 2026 14:45
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.

2 participants