-
Notifications
You must be signed in to change notification settings - Fork 30
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
example of range of use cases #8
Comments
👍 I like this list. I'm a bit thrown off by the 1+ addresses description though:
I'm having trouble groking this, but I do agree that packages should have the ability to have multiple on-chain objects, each with an address. As a thought experiment, I wonder if there's a 5th case, which might simply be an edge case of the 1+ example above:
I'm having trouble coming up with a great example, but this is something I've been asked for in the past. Users want two named, top-level on-chain objects of the same type. If this is something we want to support, we need to come up with a way to have an arbitrary list of deployed address and their types that isn't necessarily one-to-one with the contracts that exist in the package. |
I have some worries about the current approach of addresses in the manifest, mostly because I see the need of environments in a package. As others have stated, there might be packages with addresses on different chains and the argument "just publish them to a registry of the other chain" just works if that package is written solely for the "other chain". What about a package which is supposed to work cross chain and has to have information about multiple environments like a ETC-ETH relay? Currently we solve this problem in Dapple with environments: Suppose a package is written for two chains A and B and points to a deployed version of a contract C on both. Chains A and B can be identified by their genesis block hash + the latest observable block hash, which includes the deployed addresses:
and this makes space for environments:
this allows us do deterministically work with multiple environments in one package. Also this would make the manifest, registry agnostic, at least in terms of addresses. |
@mhhf could this be handled at the package manager level rather than at the manifest level? Here is my thinking. You've used the term environment so I'll stick with that. I'm thinking that environmental awareness would be better handled at the package manage implementation level than included within the manifest itself. My reasoning is as follows.
Thoughts on this? I really like the idea of the manifest not having cross-chain knowledge. This would allow each package manager to handle multi-chain environments however they would like and eliminate the nee |
I'm fine with handling this on the package manager level, however I'm not fine with mixing approaches. e.g having "some" addresses in the manifest. In this case we should move all addresses outside of the manifest.
I see the overhead as minimal but this is a subjective statement. There are objective reasons to follow this approach like not being required to build the registry on a chain in order for using manifests.
We don't need to build this consensus, since the chains are identified by their block hashes like shown here:
Every user and framework is then free to name environments arbitrary |
@mhhf I've re-read through this and I think this is a solid approach to defining chains and environments. What I'm thinking about now is whether it makes sense for a package manifest to have data about the package on more than one chain. Here is my thinking. If each manifest instead defines a single chain using the genesis+latest_block_hash approach, then each of the data structures gets flattened out to the following.
I've only just begun thinking about this so I'm unsure about whether this idea of having a manifest per chain causes problems elsewhere, but I do like that it simplifies the overall data contained in the manifest. |
My gut instinct is similar to @pipermerriam's approach. As well, the data in @pipermerriam's comment above shouldn't be added by the user, and instead by the packager. To put this in contrast, here's what npm stores for Truffle: https://registry.npmjs.org/truffle/ (you might want the JSON formatter chrome plugin). You'll notice this is way more data than what I've written in my |
That sounds like it could work, could you extend the examples to show how you would address two use cases:
https://github.com/ethpm/epm-spec/tree/master/use-cases/eth-usd-oracle-example/contracts
|
This is now fully documented in the readme. |
From: ethereum/EIPs#82
Perhaps another way to think of it is:
I think the "contract" vs "library" distinction is almost always a distraction because you can always hard-code addresses into libraries - there is no such category as "1 address with no state"
The text was updated successfully, but these errors were encountered: