Skip to main content

MAX_IMPORTED_SKILLS

Constant MAX_IMPORTED_SKILLS 

Source
pub const MAX_IMPORTED_SKILLS: usize = 200;
Expand description

Maximum number of skills actually imported (i.e. written to the Store) from a single bundle. MAX_ENTRY_COUNT/capped_component_array bound how many components.skills entries are even LOOKED AT, but codex P1 (PR #2379 round 7) points out that’s still far too high a ceiling for the RPC handler’s write side: importing up to that many skills means up to that many separate synchronous Store transactions, each creating a permanent, globally-visible skill row — a compact malicious archive (well within the size caps) could otherwise monopolize the handler and pollute the installation’s skill catalog. A real bundle needs a handful to a few dozen skills at most.

Also reused by bundle.import.commit (Phase 3 spec §3.2, round 3) as the cap on include_skills’s length — the same reasoning applies to a client-supplied selection array as to the parser’s own component list: neither may drive more Store-write attempts than a real bundle could ever need.