this morning i went back to the question of how OpenGradient handles on-chain ML without the inference bottlenecking the blockchain itself....
heres the mechanic. when a user submits a transaction containing an inference request, it enters the inference mempool. the mempool simulates all pending transactions and extracts the inference requests. those get dispatched to the inference network for parallel execution. once results are avialable, the original transaction resumes with the pre-computed inference results already attached. the completed transaction is then included in the next block....
pre-computed.not delayed.
the part worth understanding is what PIPE actualy eliminates. without it, expensive ML computation would have to complete inside the block-building window-+which would either slow blocks dramatically or force developers to use oracles with settlement delays. PIPE removes b0th problems by running inference in parallel with the mempool, before block construction even starts....
i actualy find this clean in a narrow way. the atomic execution guarantee is the key property inference results are part of the same transaction, no oracle round-trip, no delayed settlement,no window where the result and the on-chain action are desynced(not getting synced)😅....
but i wont pretend parallel pre-execution is without tradeoffs. if an inference request in the mempool takes unexpectedly long, the transaction that depends on it has to wait. the paralelism helps throughput but doesnt eliminate individual latency for complex models....
about a year ago i was building something that needed ML output inside a smart contract call. ended up using an oracle pattern that created a two-transaction flow with a settlement gap i never fully trusted. the atomic execution property PIPE offers would have changed that design entirely....
what i still cant resolve is how PIPE handles inference requests that arrive mid-block-do they get defered to the next mempool cycle, and does that create predictable latency patterns that could be gamed??
