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

Find out backward compatibility issue #114

Closed
ctindogarus4f opened this issue Feb 17, 2022 · 4 comments
Closed

Find out backward compatibility issue #114

ctindogarus4f opened this issue Feb 17, 2022 · 4 comments

Comments

@ctindogarus4f
Copy link
Contributor

ctindogarus4f commented Feb 17, 2022

Problem:
There was a backward compatibility error introduced at some point in the sputnik contracts and we need to find out the exact commit which introduced it.

How to find it?
Basically by picking random commits from https://github.com/near-daos/sputnik-dao-contract/commits/main and see where the error was introduced.

How to do it?
You need to follow the instructions below.

Instructions:

  1. Follow all the 10 instructions under https://github.com/near-daos/sputnik-dao-contract/blob/4f46375db940847be5962f99c0d38c1437f87176/release_process.md#1-1-using-personal-account-on-testnet but replace ctindogaru.testnet with your own testnet account.
  2. Next, pick a commit from https://github.com/near-daos/sputnik-dao-contract/commits/main. (we assume the commit is xsda21da)
  3. Go to the terminal and move to that snapshot in time: git checkout xsda21da
  4. Type cargo clean and wait for completion.
  5. Type cargo update and wait for completion.
  6. Type ./build and wait for completion.
  7. Follow the 7 steps under https://github.com/near-daos/sputnik-dao-contract/blob/4f46375db940847be5962f99c0d38c1437f87176/release_process.md#3-1-using-personal-account-on-testnet
  8. After completion, try again to type near view ctindogaru-dao.sputnik-factory.ctindogaru.testnet get_proposal '{"id": 0}’. Please make sure to replace ctindogaru.testnet with your own testnet account.
  9. If you get Cannot deserialize value with Borsh error, it means that commit id contains a backward compatible issue. Please create a new DAO by following these instructions, but make sure to replace ctindogaru-dao with another name and ctindogaru.testnet with your own testnet account.:
export COUNCIL='["ctindogaru.testnet"]'
export ARGS=`echo '{"config": {"name": "ctindogaru-dao", "purpose": "ctindogaru DAO", "metadata":""}, "policy": '$COUNCIL'}' | base64`
near call sputnik-factory.ctindogaru.testnet create "{\"name\": \"ctindogaru-dao\", \"args\": \"$ARGS\"}" --accountId sputnik-factory.ctindogaru.testnet --gas 150000000000000 --amount 10

Repeat instructions 2-8 until the errror does not show up anymore and you find the exact commit which introduced this backward compatible issue.
10. If you run out of funds in your wallet, please create a new account by typing near login and repeat instructions 1-9.

@ctindogarus4f
Copy link
Contributor Author

The guys from SQA will take care of this issue.

@GentBinakuSQA
Copy link

GentBinakuSQA commented Feb 17, 2022

The command

near call sputnik-factory.gentbinaku.testnet store $(eval "$BYTES") --base64 --accountId sputnik-factory.gentbinaku.testnet --gas 100000000000000 --amount 10

Fails and talking to @ctindogarus4f it has been suggested it can be only run on mac-os, unfortunately most of our teams runs on Ubuntu Linux

@TrevorJTClarke
Copy link
Contributor

teams runs on Ubuntu Linux

@GentBinakuSQA I had the same issue, created a PR near/near-cli#938 - hopefully it gets merged or you can use

@TrevorJTClarke
Copy link
Contributor

@ctindogarus4f using the scripts i created in PR #111 - I was able to test the recently merged #115 and confirm that backward compat is now working. Doing the final test of checking proposals does not have Borsh deserialize issues.
I believe we can close this, however there are yet a couple more backward compat issues to take care of that are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants