-
Notifications
You must be signed in to change notification settings - Fork 359
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
ZEC electrum crashes with AssertionError after ZEC hardfork was activated #181
Comments
Exact same behavior on our end as well. Any ideas/solutions ? |
not a dev, but i guess the deserializer for Zcash https://github.com/spesmilo/electrumx/blob/master/electrumx/lib/tx.py#L373 needs some changes because of the new v5 txes |
Someone I work with just updated our project for v5 ZEC txns. This might be informative: https://github.com/decred/dcrdex/blob/15df5a56d2e24e0e8fc211e70e5c45cb16a973b2/dex/networks/zec/tx.go#L467 (see the BTW, is there an Electrum wallet fork for ZEC (that is production ready)? I've seen https://github.com/zebra-lucky/electrum-zcash, but it has zero stars and I cannot tell if it's official and/or trusted in the Zcash community. |
use https://github.com/KomodoPlatform/atomicDEX-Desktop ... it's a wallet... and a DEX |
Nu5 transaction spec is in section 7.1 here - https://zips.z.cash/protocol/protocol.pdf Seems the Comparison of two simple transactions: v4 - https://zecblockexplorer.com/tx/29e854b05b0210cc86c7976c8f867c5034fb9ba1d1af37ae1437309a6b6e5a99
v5 - https://zecblockexplorer.com/tx/56e806faf4f65661fd2c9294ca3fbc65bc24eb102722a2a21c290ac2dc67b11f
It can get a little more complicated for orchard transactions etc. |
Hi! Everything that was deployed in NU5 is documented in ZIP 252. You should check there to see what changes need to be made to ElectrumX to be NU5 compatible (in particular, note that if ElectrumX tries to speak the Zcash P2P network protocol, it needs to be made compatible with ZIP 239; I don't know anything about ElectrumX so can't say if this is relevant). You've found the right part of the protocol spec for the v5 transaction format. It's also specified in ZIP 225. v5 transactions use a new txid calculation that is non-malleable, and a corresponding new signature digest algorithm. These are specified in ZIP 244. If you need reference code, we have the above two ZIPs implemented in Python as part of our structural test vector generator:
|
Almost done the fix:
like ca6abd8ef7d6ef158a4a35ea2c2c0cf122f2f664a88f8fa5b6fd79e48c5bed59. Need to polish few moments and will publish a draft of sources. Also will make a PR into zcash repo with fixed error in test_framework. |
Issue: spesmilo#181 Todo: clean-up mininode and other unused code in electrumx/lib/zcash, rewrite zcash_txid_v5 using only bytes object operations and hashes computation, probably, without full tx (re)construct.
@cipig can you try the implementation from my patch-issue-181 branch? 2All: patch-issue-181 is a working ElectrumX solution for ZEC at present. I tested it in my testlab - everything seems Ok. |
implementation works fine, electrumx server syncs and i also used that electrum for some swaps on AtomicDEX, so all good |
@DeckerSU can you please do a PR with your changes? Or is there something missing? |
this is the error
same error after restart, the last block that worked was
INFO:DB:height: 1,687,103
hardfork was
Activated at block 1687104, mined May 31, 2022 18:12 UTC+00:00
as of https://z.cash/upgrade/nu5/The text was updated successfully, but these errors were encountered: