I've been trying to figure out if it's at all possible to create a smart contract in Solana that will run a long-ish calculation (e.g. many sha256 iterations, or a KDF), maybe in parts, even though the calculation as a whole is obviously longer than the maximum compute budget for a transaction.
A CPI will not cut it since, as the docs say, the budget is transferred to the other program.
Any help on this issue would be appreciated. Thanks!
Well, that would mean structuring the programs instruction set to be a bit more orchestration.
You can then submit multiple transactions thereby 'chunking' up the CU consumption.
We did something similar to handle both data chunking and distributing the CU to process (validate proofs, etc.).