warp-contracts / warp

An implementation of the Arweave SmartWeave smart contracts protocol.
MIT License
159 stars 44 forks source link

expose Uint32Array to vm2 #301

Closed ocrybit closed 1 year ago

ocrybit commented 1 year ago

A couple of weeks ago, you made a modification to the vm2 settings to make it work with the WeaveDB contracts.

Unfortunately, it solved one issue but introduced a bunch of new problems in our contracts. We have been talking about it here https://github.com/weavedb/weavedb/issues/134.

I have rewritten the crypto libraries we were using to authenticate wallet addresses and figured out a way to make it all work with vm2.

You could expose Uint32Array in the same way you exposed Uint8Array since some crypto libraries depend on it, and you should be able to evaluate this new WeaveDB contract correctly. https://sonar.warp.cc/?#/app/contract/GFmHBdJmRlTAaCA7RpjY04vXPHc208S0pTuY72g1IBw

For the old WeaveDB contracts, you need to use warp-contracts@1.2.26 without vm2 turned on. But it's not as important for us to fix old ones as to make it future-proof with your updates since we've only made demo dapps so far (we can migrate the whole data to new contracts if necessary).

ocrybit commented 1 year ago

Yes, I agree. I've exposed all typed arrays with the new commit.

ppedziwiatr commented 1 year ago

Thanks for the PR! released in 1.2.36