node-stratum-pool icon indicating copy to clipboard operation
node-stratum-pool copied to clipboard

Fixed block header

Open karlinnolabs opened this issue 7 years ago • 4 comments

Error generated in blockTemplate caused by use of UInt32 for a Int32 value.

buffer.js:784 throw TypeError('value is out of bounds'); ^ TypeError: value is out of bounds at TypeError () at checkInt (buffer.js:784:11) at Buffer.writeUInt32BE (buffer.js:848:5) at BlockTemplate.serializeHeader (/home/ubuntu/stratum-server/node_modules/stratum-pool/lib/blockTemplate.js:97:16) at JobManager.processShare (/home/ubuntu/stratum-server/node_modules/stratum-pool/lib/jobManager.js:224:32) at null. (/home/ubuntu/stratum-server/node_modules/stratum-pool/lib/pool.js:506:46) at EventEmitter.emit (events.js:117:20) at handleSubmit (/home/ubuntu/stratum-server/node_modules/stratum-pool/lib/stratum.js:159:15) at handleMessage (/home/ubuntu/stratum-server/node_modules/stratum-pool/lib/stratum.js:72:17) at /home/ubuntu/stratum-server/node_modules/stratum-pool/lib/stratum.js:232:25

karlinnolabs avatar Jun 25 '18 09:06 karlinnolabs

Where exactly does this edge case occur? While basically right, I would like to see where the unsigned bit could possibly be of interest?

HashUnlimited avatar Jul 10 '18 21:07 HashUnlimited

Came up with litecoin 0.16

karlinnolabs avatar Jul 25 '18 09:07 karlinnolabs

Nothing has changed in the block header with 0.16

The PR is correct, the version is an Int32, just there's nothing I can see influencing the behaviour at the current state as the affected bits are reserved for another ISM fork and will remain low as long as they aren't used. Are you sure that you have seen the issue on LTC or can it be another coin attempting to go to block version 5? There for I am trying to figure out if there could be another issue hidden somewhere before merging.

HashUnlimited avatar Jul 25 '18 10:07 HashUnlimited

I just upgraded from 0.10 to 0.16 on my mining box and stratum crashed out - I made this change and it works fine... Dunno what to say man I just fixed it for me and upstreamed because it's the nice thing to do :)

karlinnolabs avatar Jul 25 '18 13:07 karlinnolabs