Skip to content

Remove dead top-level [finalize] config (superseded by WorkStats filter) #938

@scarmuega

Description

@scarmuega

Summary

The pipeline-wide top-level [finalize] config is dead code: it deserializes and is stored in Context, but no stage ever reads it. The only working finalization mechanism is the WorkStats filter.

Details

FinalizeConfig is declared twice with the same three fields (until_hash, max_block_slot, max_block_quantity):

  • Live path — WorkStats filter (src/filters/work_stats.rs): builds its own FinalizeConfig from filter config, calls should_finalize(...) on every event, and ends the stage (gasket halts the daemon) when a condition is met. Fully implemented, unit-tested (src/framework/mod.rs:314-360), and used in E2E configs.
  • Dead path — top-level [finalize]: ConfigRoot.finalize (src/daemon/mod.rs:18) is moved into Context.finalize (src/daemon/mod.rs:97,104; src/framework/mod.rs:94) and never consumed. The work_stats bootstrapper signature is bootstrapper(self, _ctx: &Context) — the underscore confirms the context-level finalize is intentionally ignored. A [finalize] block in daemon.toml therefore silently does nothing.

Proposed change

Remove the dead config surface:

  • Drop finalize: Option<FinalizeConfig> from ConfigRoot (src/daemon/mod.rs) and Context (src/framework/mod.rs).
  • Remove the now-unused plumbing in run_daemon (src/daemon/mod.rs:97,104).
  • Remove the finalize: None lines in src/bin/oura/dump.rs:52 and src/bin/oura/watch.rs:49.
  • Keep FinalizeConfig + should_finalize (still used by the WorkStats filter).

Docs

The v2 docs have already been corrected to stop advertising a top-level [finalize] block and route finalization through the WorkStats filter (companion docs PR on branch docs/v2-fitness-fixes).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions