Skip to content
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

Cosmwasm 0.9 #262

Merged
merged 144 commits into from
Jun 30, 2020
Merged

Cosmwasm 0.9 #262

merged 144 commits into from
Jun 30, 2020

Conversation

reuvenpo
Copy link
Contributor

@reuvenpo reuvenpo commented Jun 18, 2020

This PR, in isolation, is too big to comprehend. What follows is an explanation of how i assemebled its contents:

Background

The cosmwasm/, go-cosmwasm/, and x/compute and cmd/ directories in this repository (enigmampc/SecretNetwork) started as copies of the CosmWasm/cosmwasm, CosmWasm/go-cosmwasm, and CosmWasm/wasmd repositories respectively, at their v0.7.0 release.
We have since then modified these repositories considerably, according to our custom needs, but in parallel to this, the CosmWasm team kept developing their own projects, fixing bugs, and adding features.
During this period, I (@reuvenpo) also contributed significant amounts of code to their repositories, and helped bring these components to a production-ready state.

Merge Strategy

The time has now come to finally merge all of the work done on both sides back into a coherent version in our repository.
In order to do this, I cloned the three CosmWasm repositories under our namespace:
enigmampc/cosmwasm, enigmampc/go-cosmwasm, and enigmampc/wasmd.

For the go-cosmwasm and wasmd repositories, I first checked out the v0.7.0 tag, created a new branch called enigma-master, and then replaced the content there with the relevant content from commit 213e32c in this repository. This represented a squash of all the work we did into one commit. I then used the usual git merge tool to perform most of the work, and manually resolved the couple-dozed conflicts that did occur (I merged a commit a little after 0.9.0-alpha1). Later I also tweaked a few lines where necessary because of slight API changes.

For the cosmwasm repository though, a simple approach like that was not possible, because of the huge amount of work that was put into it on both sides. I worked off of a recent commit in the repository (after 0.9.0-alpha1), creating a branch called enigma-master, and started manually copying over the custom content from the SecretNetwork. Most of the code was a simple copy-paste, as we kept our work mostly in separate repositories (This includes enclave-ffi-types, wasmi-runtime, and most of sgx-vm/wasmi). For the rest though (most of the changes in the vm/sgx-vm directory), I had to do some re-engineering and adjusting to get things to work together again. I gotta say that thanks to the improvements and cleanup on the CosmWasm side, as well as 2-3 months of experience with the codebase on my part, made the result much better and cleaner than the original way we modified their codebase.

As this merge process took some time, the SecretNetwork repository has had ~170 new commits pushed to its develop branch, I went back to the first "squash" commit i made in go-cosmwsam and wasmd and added another commit in each, representing the changes from 213e32c to 5164b14. I then merged that commit back into the enigma-master branch in each repository. In the cosmwasm repository the changes in that span of commits were almost exclusive to files that i did not change, so i just copied over the new versions of those files to the enigma-master branch.

You can track the difference between our versions and the original versions here:
cosmwasm, go-cosmwasm, wasmd.

Notes

The content here is copied from these commits:
https://github.com/enigmampc/cosmwasm/tree/716f67bbd5fd99750a2a311dbca96ed91175e097
https://github.com/enigmampc/go-cosmwasm/tree/45f82e530a69f1635f246e03954c65e17b762d91
https://github.com/enigmampc/wasmd/tree/e69b1aae31effbd8cfc3567d13d97634fb0d3ba2

The first 3 commits in this PR represent copying from each of those repositories (although in a different order)

In the future, if we need to pull in changes from the CosmWasm repositories again, we will place one more "squash" commit with all our changes from this point onto the enigma-master branches of the forked repositories, and then perform a git merge of the new content from the upstream repositories. we will then copy the result as one commit back in this repo.

For each repository, I recommend configuring one directory with both the original and the fork as remotes. It makes these merges much easier.

Future work on this PR

The following commits will be focused on making everything work together again. This will first include making sure everything just compiles together again, and then we will start working on filling in all the missing implementation details that connect our custom code to the new features and ABIs of the upstream version.
List of issues detailing the required work.

CC: #126 #151

@assafmo
Copy link
Member

assafmo commented Jun 18, 2020

Re "Conflicting files x/compute/internal/keeper/testdata/contract.wasm": Take the newer one, the one in develop is a v0.7 contract.

@Cashmaney Cashmaney changed the title Cosmwasm 0.9 WIP: Cosmwasm 0.9 Jun 18, 2020
@Cashmaney Cashmaney changed the title WIP: Cosmwasm 0.9 Cosmwasm 0.9 Jun 30, 2020
Cashmaney
Cashmaney previously approved these changes Jun 30, 2020
@Cashmaney Cashmaney merged commit 4b34e94 into develop Jun 30, 2020
@assafmo assafmo deleted the cosmwasm-0.9 branch June 30, 2020 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CosmWasm v0.10 dev Critical path development tasks enhancement New feature or request p-high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants