Skip to content

Implement a configurable per-channel settlement trigger so nodes can automatically submit on-chain settlement when a channel's outstanding voucher value crosses a governance-set threshold #742

Description

@alpergundogdu

Currently nodes accumulate vouchers indefinitely until an operator manually triggers settlement; a large unsubmitted voucher balance is at risk if a client goes dark before the dispute window. An auto-settle threshold (in USDC or voucher count) configurable in node.toml would reduce operator exposure and align with the ADR 003 payment-channel lifecycle.


Filed via GitDailyReporterBot

Activity

  1. alpergundogdu commented on May 31, 2026

    @alpergundogdu
    ContributorAuthor

    Running a partial withdraw is also okay, as that solves the problem from a node's perspective.

    Client counterpart of this should be calling settle if the node is offline, potentially using on-chain proof via a log filter that the node is still active and/or bonded

  2. added
    design:economics
    kind:feature
    rust
    on May 31, 2026
  3. github-actions commented on May 31, 2026

    @github-actions

    🎯 Triage report

    This feature request asks for an auto-settlement trigger in the incentive crate: when a payment channel's outstanding voucher value (in USDC or by count) crosses a configurable threshold, the node should automatically submit the on-chain settlement rather than waiting for operator intervention. The motivation is to bound operator risk when a client goes dark before the dispute window closes. The config surface proposed is node.toml, aligning with ADR 003's payment-channel lifecycle.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature New automated behaviour in the incentive subsystem
    Labels enhancement, technical, economics, rust Rust implementation in crates/incentive; touches payment-channel economics; no ADR conflict detected
    Coding agent Suitable Requirements are well-scoped: add a threshold config key, wire it into the voucher-accumulation loop in crates/incentive, and trigger settlement when the threshold is crossed
    💡 Notes and suggestions

    Scope & implementation pointers

    • The relevant code is in crates/incentive — the voucher accumulation path and channel state machine are the primary touch points.
    • ADR 003 describes the payment-channel lifecycle; any settlement trigger must fit within its dispute-window and finality model. No ADR change appears needed for a purely operational trigger.
    • The config key should be added to the common/config-types schema (e.g., [incentive] auto_settle_threshold_usdc = ... and/or auto_settle_voucher_count = ...) so both the node config and any future CLI exposure pick it up cleanly.
    • Consider a sensible default (e.g., threshold = 0 / disabled) so existing deployments are unaffected.
    • The threshold check can be performed after each voucher is appended; a background task polling at a fixed interval is an alternative but adds latency.
    • Anti-panic policy: no .unwrap()/.expect() — use Result combinators throughout.

    Sub-tasks checklist

    • Add auto_settle_threshold_usdc (and optionally auto_settle_voucher_count) to the config schema in config-types or common
    • Load and expose the threshold in the incentive crate's channel manager
    • After each voucher accumulation, compare outstanding value against the threshold and trigger on-chain settlement if exceeded
    • Unit-test the trigger logic (happy path + edge cases: threshold=0 disables, exact boundary fires)
    • Update node.toml example / docs with the new keys
    • Verify no unwrap/expect introduced (cargo clippy)

    Generated by Agentic Triage for issue #742 · sonnet46 367.7K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:economicskind:featurerust

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions