Skip to content

Bug: parseGovernorConfig / GovernorConfig type drop the on-chain max_duration_seconds field #532

Description

@Jaydbrown

File: src/governor.ts:60-77 (parseGovernorConfig), src/types/index.ts (GovernorConfig)

The on-chain GovernorConfig struct (contracts/governor/src/config.rs) is:

pub struct GovernorConfig {
    pub fee_bps: u32,
    pub fee_recipient: Address,
    pub min_duration_seconds: u64,
    pub max_duration_seconds: u64,   // <-- returned by DripGovernor::config()
    pub max_rate_per_second: i128,
    pub factory_address: Address,
}

parseGovernorConfig reads fee_bps, min_duration_seconds, max_rate_per_second,
fee_recipient and factory_address — but never reads max_duration_seconds, and
the SDK's GovernorConfig type has no field for it.

Impact

client.governor.getConfig() cannot tell a caller the protocol's maximum stream
duration, even though the contract enforces it (extend_duration /
top_up_and_extend reject durations over max_duration_seconds). A client that
wants to validate a stream length before submitting has no way to read the bound.

Suggested fix

Add maxDurationSeconds: number to GovernorConfig and parse
m['max_duration_seconds'] the same way as min_duration_seconds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority: highSignificant bug or missing guard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions