feat(autopilot-svm) PR09: settlement observation - #4754
Conversation
|
Claude finished @squadgazzz's task in 2m 50s —— View job PR Review: settlement observationThe design is clean — windows persisted in the DB, NOTIFY + reconnect re-seed for convergence, and timeouts upgraded to
Nothing blocking beyond the first item; the second is a heads-up for when multi-winner arrives.
|
8f29d7e to
5c1b874
Compare
03436e2 to
760fcae
Compare
…cle' into ilya/be-185-pr09-settlement-observation # Conflicts: # crates/autopilot-svm/src/tests.rs
…ot on the driver wire
…cle' into ilya/be-185-pr09-settlement-observation
…cle' into ilya/be-185-pr09-settlement-observation
…lement-observation # Conflicts: # crates/autopilot-svm/src/infra/executor.rs # crates/autopilot-svm/src/infra/mod.rs # crates/autopilot-svm/src/infra/observer.rs # crates/autopilot-svm/src/tests.rs
jmg-duarte
left a comment
There was a problem hiding this comment.
Description reads very AI-generated
There was a problem hiding this comment.
changing an existing migration sounds sus, im guessing it wasn't fully submitted before?
There was a problem hiding this comment.
Solana migrations are currently used only in the tests.
| for auction_id in self.tracker.open_windows().await? { | ||
| self.resolve(auction_id).await?; | ||
| } |
There was a problem hiding this comment.
join_all/try_join_all maybe? or it doesn't matter?
There was a problem hiding this comment.
This code runs only when the listener connects/reconnects, and usually finds zero or a few open windows. IMO, try_join_all would only add noise.
Updated as well |
Description
The loop currently dispatches a settlement and forgets it. Nothing checks whether the transaction ever landed.
Now every dispatch opens a window in
solana.settlement_executions. When the indexer records the settlement, a NOTIFY closes the window aslandedwith the signature. If the submission deadline passes first, the window closes astimeoutand logs an error. A settlement observed late still flips the window tolanded: chain truth wins, and the lateness stays visible in the slot columns.Windows live in the database and the listener re-checks all open ones on every (re)connect, so restarts and missed notifies lose nothing.
The indexer drives this because there is no blocking
/settleresponse to learn the outcome from, the driver answers at submission and landing is asynchronous.Temporary solutions:
solution_uidis the winner's driver-local id until competition persistence, and the timeout check runs per competition cycle, so on an idle chain a miss surfaces with the next auction.Changes
solana.settlementsgains anAFTER INSERTtrigger notifying with the auction id (V2 edited in place, the series is deployed nowhere)infra/observation.rsopens, lands, and times out the windows, and resolves notifies plus reconnect re-readsHow to test
New DB-backed tests: the trigger fires and the listener closes the window as landed, deadlines expire, and the mock-cycle test asserts a dispatch opens a window.