-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add offchain package #154
Add offchain package #154
Conversation
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:
If the above sounds reasonable to you guys (cc @ferranbt ), here is the course I have plotted for myself:
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. |
iface "github.com/ipfs/kubo/core/coreiface" | ||
) | ||
|
||
type Env struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env
feels a little non-descriptive, as in it doesn't really convey a meaning (offchain.Env) 🤔
What is this for, eventually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's meant to contain the "offchain environment", i.e. the collection of APIs and services that we export to SUAPPs for off-chain data/computation. Ordinarily, I'd agree that Env
doesn't convey a lot of meaning, but I think it actually is an "offchain environment" in this case.
📝 Summary
Begins formal separation of infrastructure and application logic.
Introduces
offchain
package that defines a top-levelEnv
struct. This struct contains various APIs to off-chain services. Currently this includes onlyDatastore
. Uses IPFS sidecar as test implementation.Follow-up work:
Datastore
from Solidity (in progress)cstore.Engine
toEnv
📚 References
https://docs.ipfs.tech/concepts/content-addressing
https://github.com/multiformats/cid