z-classic / z-nomp

z-nomp is mining pool software for Zcash and Zclassic so you can create internet money in your home!
MIT License
288 stars 441 forks source link

Unshield no more than 100 ZEC at a time? Why not? #199

Open Tomas-M opened 7 years ago

Tomas-M commented 7 years ago

If a coin generates for example 125 units per block, z-nomp has hardcoded limit to unshield max 100 ZEC at a time so it is always delayed.

I would suggest to either remove the hardcoded limit of 100 ZEC, or make it configurable. It is in file lib/paymentProcessor.js

    var amount = satoshisToCoins(zBalance - 10000);
    // unshield no more than 100 ZEC at a time
    if (amount > 100.0)
        amount = 100.0;
Tomas-M commented 7 years ago

This is especially necessary for VOT coin, which has 125 VOT reward per block.

WaveringAna commented 7 years ago

this is because transactions can only be 10kb in size, and most equihash coins have a block reward of 12.5, each joinsplit takes about 1kb in size. The variable is just there to prevent transactions getting rejected for being too big

Tomas-M commented 7 years ago

Thanks for reply. Could be possibly better to take the result from RPC call getblocksubsidy (which returns block reward) and multiply it with 5 or 10 or so, instead of hardcoding 100.

Tomas-M commented 7 years ago

Anyway, since VoteCoin is forked from ZCash, it should have the same limits, but I see it does not. I was able to send unshielding transaction for 3000 VOT, which included 24 inputs, and block explorer reports it to be over 40KB in size without any problem.

@aayanl Can you confirm that you really need to limit a transaction size to 10KB ?

lludlow commented 7 years ago

https://github.com/zcash/zcash/blob/30d3d2dfd438a20167ddbe5ed2027d465cbec2f0/src/consensus/consensus.h#L18