You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
api: make pool-config and worker-selection methods required on SubstrateAdapter #884
In crates/libs/api/src/controllers/substrate/mod.rs, four methods on SubstrateAdapter still carry default implementations that return SubstrateError::Unsupported:
list_pool_configs (mod.rs:1609)
upsert_pool_config (mod.rs:1616)
disable_pool_config (mod.rs:1626)
select_ready_worker_node_api_target (mod.rs:1648 — already implemented by both DirectSubstrate and KubernetesSubstrate and forwarded by Substrate, making the trait default dead code)
crates/libs/api/src/controllers/substrate/AGENTS.md states that SubstrateAdapter operations must be required methods so the compiler enforces an explicit implementation on each substrate and a forwarding arm in impl SubstrateAdapter for Substrate, and notes that the Unsupported trait defaults on list_pool_configs, upsert_pool_config, and disable_pool_config are debt.
Why it matters
Default Unsupported bodies on SubstrateAdapter weaken compile-time exhaustiveness across substrates: a missing arm in impl SubstrateAdapter for Substrate or on a substrate implementation silently returns 501 Not Implemented instead of failing to compile.
Proposed approach
Remove the default bodies from list_pool_configs, upsert_pool_config, disable_pool_config, and select_ready_worker_node_api_target on trait SubstrateAdapter in crates/libs/api/src/controllers/substrate/mod.rs.
Add explicit list_pool_configs, upsert_pool_config, and disable_pool_config implementations to impl SubstrateAdapter for DirectSubstrate in crates/libs/api/src/controllers/substrate/direct.rs returning the same SubstrateError::Unsupported error.
Update crates/libs/api/src/controllers/substrate/AGENTS.md to remove the resolved trait-default debt reference.
Severity
Low (compile-time contract hardening; zero runtime behavior change).
Activity