MoneroOcean / node-cryptoforknote-util

NodeJS wrappers for Cryptonode/Forknote coins
11 stars 83 forks source link

Monero v15 compatibility: "Failed to parse block" in convert_blob() after hardfork. #19

Closed osensei closed 2 years ago

osensei commented 2 years ago

I've been doing some tests on a private testnet to ensure everything will work after the v15 fork.

As soon as the hardfork takes place, convert_blob() will break with the error message "Failed to parse block".

There's no PoW change this time, but it is my understanding that the block template is changing (I guess in part to include the new feature "view tags") and this might be breaking things.

In my current setup I've been using v4.0.2 since RandomX was implemented. I can build up to v7.0.2, but any version after that will fail to build (I believe it's due to the old nodejs version I'm running: v0.12.18). Despite that, I don't think there's been any change relevant to this issue in recent versions of this repo. Sorry if I'm mistaken.

If you get to fix this issue I would be grateful if you could backport the changes to v7.0.2 to make it compatible with nodejs v0.12.18. If it's trivial I guess I could try to backport it myself, but sadly I'm not proficient in C.

MoneroOcean commented 2 years ago

Thank you for report! This is something I would likely miss myself. Will look into this ASAP.

MoneroOcean commented 2 years ago

Can you please try the HEAD of this repo to see if it works? I do not have test environment to check myself quickly. Need to add some tests to this repo.

osensei commented 2 years ago

Thanks for the work you're putting into it.

I've tried building HEAD, but as I mentioned before, anything after tagged version v7.0.2 of this repo will fail to build on my current environment.

For the record, the pool software I'm running is based on the old zone117x/node-cryptonote-pool , not the one made by Snipa.

It seems that the problem I'm having when building is related to the dependency of module bignum 0.13.1.

Your repo builds fine in my environment up to tag v7.0.2, but it starts to fail from v8.0.0 onwards.

I'm attaching the output I'm getting when trying to build HEAD:

output.txt

MoneroOcean commented 2 years ago

I checked latest head and it seems to be at least not breaking things for the prefork monero daemon. Still more testing would be welcome from your side.

I checked and I can install thing module with node v12, so maybe issue is not really related to it? Try to delete node_modules and package-lock.json just in case and try to install it.

$ rm -rf node_modules/
$ which node
/usr/bin/node
$ which npm
/usr/bin/npm
$ node -v
v12.18.2
$ npm -v
6.14.8

$ npm install https://github.com/MoneroOcean/node-cryptoforknote-util/

+ cryptoforknote-util@11.2.3
added 33 packages from 27 contributors and audited 33 packages in 24.871s
...

OK
osensei commented 2 years ago

Thank you for this.

In my case it's actually v0.12, not v12 (yup, I know, pretty old). I've made several attempts to build it, but as I mentioned, anything after tag v7.0.2 of your repo won't build.

I was able to build it on more up-to-date environment running npm install https://github.com/MoneroOcean/node-cryptoforknote-util but not in the one my pool code is running, which prevents me from actually testing it.

That being said, j-berman has just updated this branch https://github.com/j-berman/node-cryptonote-util/tree/hf-15 and I can confirm it works both before and after the fork.

I know your repo has a lot more code related to other cryptocurrencies, but it may come in handy to take a look there and compare your changes, just in case.

Sorry I'm not able to test your repo and confirm whether it works or not.

Thanks again for your help.

MoneroOcean commented 2 years ago

In my case it's actually v0.12, not v12

Ouch :)

MoneroOcean commented 2 years ago

Anyway I think I implemented this in my repo as well. Will tag the latest commit and close this report. Thank you once again.