Building transactions through SelectorParams currently gets no feedback if they accidentally create dust outputs or include multiple OP_RETURN outputs. These mistakes only surface at relay time with opaque node rejections.
Implement a builder interface for SelectorParams that validates target outputs against configurable mempool standardness rules, cathching dust recipients, multiple OP_RETURN outputs, oversized OP_RETURN scripts, and missing required fields at construction time.
Proposed solution
Introduce a SelectorParamsBuilder as a separate type that validates and produces SelectorParams.
The SelectorParams::builder() chains methods and call .build() which validates against a configurable MempoolPolicy struct.
Context
See selector.rs L20–L27
Building transactions through
SelectorParamscurrently gets no feedback if they accidentally create dust outputs or include multipleOP_RETURNoutputs. These mistakes only surface at relay time with opaque node rejections.Implement a builder interface for
SelectorParamsthat validates target outputs against configurable mempool standardness rules, cathching dust recipients, multipleOP_RETURNoutputs, oversizedOP_RETURNscripts, and missing required fields at construction time.Proposed solution
Introduce a
SelectorParamsBuilderas a separate type that validates and producesSelectorParams.The
SelectorParams::builder()chains methods and call.build()which validates against a configurableMempoolPolicystruct.Context
See selector.rs L20–L27