Dependency on Moonbeam crates #1118
-
Context 🗺️The Centrifuge Chain’s
The With the use case in mind, all the other enumerated pallets offers the necessary types and calls that allow us to build the complete encoded call that will be decoded and executed on the Moonbeam side. Problem 🐞Moonbeam is a Substrate-based chain just like the Centrifuge chain. However, whereas the latter depends on the official and original supporting framework crates from I.e, whereas That divergence in dependencies is a major trouble for cargo since we are essentially attempting to both pull crates directly from Workaround 🔨The workaround we found to get the Centrifuge chain to compile successfully with this setup involves forking Pros/Cons Whereas this is a simple solution, it is just as tedious, given that we either need to repeat this process for every new release of polkadot or we need to go through an enormous git conflict resolution, which may be aggravated shall any of the crates have changed their list of dependencies. Another con is the fact that we are dependant on Moonbeam to fully upgrade to a new release of polkadot, since we first need them to upgrade to said version in order for us to update this fork. Explored Alternatives ☑️
Alternative Options 🧗We can still try a few alternative options.
This is a more radical alternative and it involves dropping all the dependencies on the Moonbeam crates. To replace A con of this approach is that we need to manually keep a very close look on any change in the Moonbeam repo regarding the crates of interest. A way to mitigate this effort would involve setting up true end-to-end tests which would allow us to quickly verify whether our current solution still works against a specific version of Moonbeam. Another con is that it’s much more tedious to develop and therefore maintain such a solution.
A variation of the previous alternative which would mitigate the level of effort to develop and maintain such setup would involve simply copy the relevant crates to a separate, internal repository and - again - manually keep an eye on the original repository and stay up to date with any relevant change. A cons of this approach is that for every change, the level of effort to keep up with changes may vary since such change may involve a new dependency which would complicate the whole dependency model. And yet again, this setup would require us - rightfully so - to write true e2e tests to verify the latest revision works as expected. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
UpdateI went on re-exploring the So for example we can have both of these statements:
The first tells cargo that, shall there be multiple versions of The seconds tells cargo that shall there be any version from I managed to get But this is still a step in the right direction 🚀 |
Beta Was this translation helpful? Give feedback.
-
Update on the last message I managed to get the
|
Beta Was this translation helpful? Give feedback.
-
The I will try and use this wip setup and point directly to the official Moonbeam repo now. |
Beta Was this translation helpful? Give feedback.
-
Got it working in #1120 🥳 |
Beta Was this translation helpful? Give feedback.
Update
I went on re-exploring the
cargo patch
option and learned a few interesting things.First, it possible to use it to both state that we want to only use a specific revision of a crate within a specific source as well as to tell cargo to use a specific revision from a different source.
So for example we can have both of these statements:
The…