Skip to content

Enhancement: TwapOracle::configure_oracle doesn't validate max_staleness #305

Description

@Jaydbrown

TwapOracle::configure_oracle (contracts/oracle/src/lib.rs) validates decimals > 38 but never validates max_staleness. If an admin sets max_staleness: 0, every submission becomes stale essentially immediately (get_twap_price's age <= config.max_staleness can basically never hold once even one ledger has passed), silently bricking the oracle for all readers — get_twap_price will return OracleStalePrice forever without any distinct error indicating the configuration itself is degenerate. A max_staleness == 0 check (mirroring the decimals guard) would surface this at configuration time instead.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions