Skip to content

autobahn: feed persistent_state_dir into data WAL (CON-256)#3483

Merged
wen-coding merged 3 commits into
mainfrom
wen/feed_persistent_state_dir_into_data
May 21, 2026
Merged

autobahn: feed persistent_state_dir into data WAL (CON-256)#3483
wen-coding merged 3 commits into
mainfrom
wen/feed_persistent_state_dir_into_data

Conversation

@wen-coding

@wen-coding wen-coding commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The data layer's block and commitqc WALs were constructed with utils.None[string](), making them no-ops: writes returned success but nothing landed on disk, and NewState loaded an empty WAL on every restart.

The autobahn config file already has persistent_state_dir and it was already wired into the consensus layer. Reuse the same value for the data layer's WAL (via cfg.Consensus.PersistentStateDir) — the two layers write to distinct subdirs under the same root. No new struct field; once BlockDB has a writer the data WAL will go away entirely (TODO in code).

This will enable Upgrade (Major) test for Autobahn. Right now it's stuck because the previous states are lost upon restart.

Visible changes

  • gen-autobahn-config --persistent-state-dir flag now defaults to data/autobahn (was: field absent, persistence off). Pass --persistent-state-dir= to disable.
  • A relative persistent_state_dir in autobahn.json is now rootified against --home at load time, matching other tendermint config paths.

Test plan

  • Autobahn Upgrade Module (Major) passes (was deadlocking before)
  • Autobahn Upgrade Module (Minor) passes
  • CometBFT Upgrade Module Major/Minor still pass

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 21, 2026, 3:16 PM

@wen-coding wen-coding force-pushed the wen/feed_persistent_state_dir_into_data branch from 1a0bc73 to ac772c0 Compare May 21, 2026 04:16
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.08%. Comparing base (b5fdb12) to head (336de10).

Files with missing lines Patch % Lines
...int/cmd/tendermint/commands/gen_autobahn_config.go 0.00% 4 Missing ⚠️
sei-tendermint/node/setup.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3483      +/-   ##
==========================================
+ Coverage   59.06%   59.08%   +0.01%     
==========================================
  Files        2187     2187              
  Lines      182294   182286       -8     
==========================================
+ Hits       107676   107697      +21     
+ Misses      64953    64943      -10     
+ Partials     9665     9646      -19     
Flag Coverage Δ
sei-chain-pr 63.65% <14.28%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/internal/p2p/giga_router.go 69.75% <100.00%> (ø)
sei-tendermint/node/setup.go 69.23% <0.00%> (-0.45%) ⬇️
...int/cmd/tendermint/commands/gen_autobahn_config.go 15.38% <0.00%> (-1.01%) ⬇️

... and 46 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.

@wen-coding wen-coding force-pushed the wen/feed_persistent_state_dir_into_data branch 2 times, most recently from 21a8b57 to 5e450da Compare May 21, 2026 04:34
The data layer's block and commitqc WALs were constructed with
utils.None[string](), making them no-ops: writes returned success but
nothing landed on disk, and NewState loaded an empty WAL on every
restart. Single-node restarts survived only by peer-fed PushQC; a
coordinated cluster restart had no recovery path because every node
had simultaneously lost its in-memory data.

The autobahn config file already has persistent_state_dir, and it was
already wired into the consensus layer. Thread the same value into
the data layer:

- gen_autobahn_config: add --persistent-state-dir flag with default
  "data/autobahn" so persistence is on out of the box; pass an empty
  value to opt into in-memory-only mode.
- node/setup.go: rootify the loaded persistent_state_dir against
  cfg.RootDir when it's relative, matching how other tendermint
  config paths are resolved.
- p2p.GigaRouterConfig: add PersistentStateDir field. NewGigaRouter
  propagates it into cfg.Consensus.PersistentStateDir so the consensus
  and data layers share a single source of truth (they use distinct
  subdirs under the root: inner / blocks / commitqcs for consensus,
  globalblocks / fullcommitqcs for data).
- p2p/giga_router.go: pass cfg.PersistentStateDir to data.NewDataWAL
  instead of utils.None.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding force-pushed the wen/feed_persistent_state_dir_into_data branch from 5e450da to 9c25c24 Compare May 21, 2026 04:37
@wen-coding wen-coding marked this pull request as ready for review May 21, 2026 04:42
@cursor

cursor Bot commented May 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Enables on-disk persistence for Autobahn’s data-layer WALs and changes the default behavior of gen-autobahn-config to persist state, which can affect restart/recovery and filesystem paths.

Overview
Autobahn persistence is now enabled end-to-end by default. gen-autobahn-config adds a --persistent-state-dir flag (default data/autobahn) and writes it into the generated config; passing an empty value disables persistence.

The Giga (Autobahn) router now initializes the data-layer WALs using cfg.Consensus.PersistentStateDir instead of None, so global block and commit-QC WALs actually survive restarts. When loading Autobahn config, a relative persistent_state_dir is now resolved against the node --home directory to match other Tendermint path handling.

Reviewed by Cursor Bugbot for commit 336de10. Bugbot is set up for automated code reviews on this repo. Configure here.

@wen-coding wen-coding added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit b295d4f May 21, 2026
45 checks passed
@wen-coding wen-coding deleted the wen/feed_persistent_state_dir_into_data branch May 21, 2026 15:53
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