Expand description
flexpool’s local files, read the one way both binaries read them.
The domain crates are pure: they parse text and never open a file. This
crate does the opening, for the daemon (flexpoold) and the command line (flexpool) alike,
so neither binary depends on the other and the limits below exist once:
- every read is bounded, even if the file grows after its size was checked;
- a scenario’s data file is a relative path inside the scenario’s directory, symlinks included (market-replay/SR-003).
Constants§
- MAX_
JOURNAL_ BYTES - Largest alarm journal read.
- MAX_
PORTFOLIO_ BYTES - Largest portfolio file read.
- MAX_
SCENARIO_ BYTES - Largest scenario or data file read.
Functions§
- contained
- Resolves a scenario’s data file inside the scenario’s directory (market-replay/SR-003).
- fault_
problems - What a scenario names that the portfolio lacks: a fault’s asset, or a battery behind the grid operator’s congestion point.
- load_
portfolio - Reads and validates the portfolio in
dirand its optional edge file, returning every problem. - load_
scenario - Loads and validates a scenario file, collecting every problem (parse, data file, data).
- read_
capped_ utf8 - Reads at most
capbytes as UTF-8; a longer file is refused even if it grew after a size check (the read itself is bounded). - verify_
journal - Checks an alarm journal’s hash chain without starting anything; the number of records.