Add offchain package
π Summary
Begins formal separation of infrastructure and application logic.
Introduces offchain package that defines a top-level Env struct. This struct contains various APIs to off-chain services. Currently this includes only Datastore. Uses IPFS sidecar as test implementation.
Follow-up work:
- Define precompiles to interact with
Datastorefrom Solidity (in progress) - Migrate
cstore.EnginetoEnv
π References
https://docs.ipfs.tech/concepts/content-addressing https://github.com/multiformats/cid
- [x] I have seen and agree to CONTRIBUTING.md
Noticed that the tests fail: https://github.com/flashbots/suave-geth/actions/runs/7471328612/job/20331422338?pr=154#step:9:2848
I wanted to add some additional context on the IPFS sidecar, as I don't think I've done a very good job of explaining myself so far (cc @Ruteri) π
My reasons for proposing this change boil down to the following:
- Running an IPFS sidecar is very helpful for me to prototype fast.
- I am adding a feature flag to enable this, so it wonβt interfere with any dev or prod setups.
- We donβt have to keep IPFS. We can discuss when the time comes to enable the feature in prod.
If the above sounds reasonable to you guys (cc @ferranbt ), here is the course I have plotted for myself:
- [x] Fix the panic in the unit tests. (WIP)
- [x] Await one final review from you guys (possibly including a quick sync-up call?)
- [x] Proceed with follow-up PRs
Please LMK if there's any part of this that seems reckless or ill-advised. I am eager to ship, but I don't want to be the proverbial bull in the china shop! π
Okay, I think this is ready to go, pending approval.
I'm proceeding with the next PR: implementing precompiles to interact with the datastore.