File tree Expand file tree Collapse file tree
solver-order/src/implementations/standards Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ impl IntentHandler {
166166 }
167167 } ,
168168 Err ( e) => {
169+ tracing:: warn!(
170+ reason = %e,
171+ "Intent rejected during validation"
172+ ) ;
169173 self . event_bus
170174 . publish ( SolverEvent :: Discovery ( DiscoveryEvent :: IntentRejected {
171175 intent_id : intent. id ,
Original file line number Diff line number Diff line change @@ -238,6 +238,26 @@ impl OrderInterface for Eip7683OrderImpl {
238238 ) )
239239 } ) ?;
240240
241+ // Early validation: Check if the specific routes exist
242+ let supported_destinations: std:: collections:: HashSet < u64 > =
243+ supported_outputs. iter ( ) . map ( |info| info. chain_id ) . collect ( ) ;
244+
245+ for output in & order_data. outputs {
246+ let dest_chain = output. chain_id . to :: < u64 > ( ) ;
247+
248+ // Skip same-chain outputs as they don't need cross-chain routes
249+ if dest_chain == origin_chain {
250+ continue ;
251+ }
252+
253+ if !supported_destinations. contains ( & dest_chain) {
254+ return Err ( OrderError :: ValidationFailed ( format ! (
255+ "Route from chain {} to chain {} is not supported (oracle {} has no route to destination)" ,
256+ origin_chain, dest_chain, order_data. input_oracle
257+ ) ) ) ;
258+ }
259+ }
260+
241261 // Validate each output oracle
242262 for output in & order_data. outputs {
243263 let dest_chain = output. chain_id . to :: < u64 > ( ) ;
Original file line number Diff line number Diff line change @@ -267,7 +267,10 @@ impl SettlementService {
267267 }
268268 }
269269
270- supported_routes. insert ( input_info, valid_outputs) ;
270+ // Only insert if there are valid routes from this input oracle
271+ if !valid_outputs. is_empty ( ) {
272+ supported_routes. insert ( input_info, valid_outputs) ;
273+ }
271274 }
272275 }
273276 }
You can’t perform that action at this time.
0 commit comments