Commit Graph

540 Commits

Author SHA1 Message Date
cronicc aa3deddc8c
Zen fork9 sidechainversionfork (#63)
* Add support for fork9_sidechainversionfork:

* Add Horizen specific section in else if chain and remove now redundant code

* Refactor fork management for Horizen (forks and required data are now defined in s-nomp/coins/zen.json)

* Fix: typo

* Fix: regression introduced in 'Pers Auto (#61)'
2022-03-22 12:07:05 -05:00
Potato 4a608380cf
Pers Auto (#61) 2022-03-06 14:36:43 -06:00
devxz ab276ff7af
update gemlink blocktemplate (#60)
Co-authored-by: devzx <devzx@gemlink.org>
2022-02-22 19:38:11 -06:00
rdoria1 d86ae73f8f
Zendoo hard fork compatibility (#59)
* Added support for new type of blocks in zendoo

* Fixed synchronization with getSidechainMerkleRoots RPC calls

* Updated package.json

* Renamed RPC commands and removed initialization of merkleRoot an hashReserved

* Removed condition when hashReserved is taken from RPC

* Changed RPC command name

* Added check for coin and block version

* Replace string.contains with string.indexOf

* Replace string.contains with string.indexOf

* Changes after code review

* Change symbol for zen testnet

* Fix regression after code review

(node:40) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'version' of undefined
    at JobManager.processTemplate (/home/node/s-nomp/node_modules/stratum-pool/lib/jobManager.js:175:26)
    at /home/node/s-nomp/node_modules/stratum-pool/lib/pool.js:686:73
    at itemFinished (/home/node/s-nomp/node_modules/stratum-pool/lib/daemon.js:166:36)
    at /home/node/s-nomp/node_modules/stratum-pool/lib/daemon.js:180:17
    at parseJson (/home/node/s-nomp/node_modules/stratum-pool/lib/daemon.js:92:17)
    at IncomingMessage.<anonymous> (/home/node/s-nomp/node_modules/stratum-pool/lib/daemon.js:103:17)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

* Fixup

Co-authored-by: MarcoOl94 <marco.olivero94@libero.it>
Co-authored-by: cronicc <cronic@zensystem.io>
2021-10-05 12:49:47 -05:00
Potato 14e315eceb
Fix zcash changes to fundingstreams instead of founders addresses (#56) 2021-02-15 13:46:56 -06:00
cronicc b8d136786e
Bugfix: Use 'getblocksubsidy curHeight + 1' to determine coinbase tx vout amounts (#55)
Fixes a bug where invalid blocks are generated when a coin reaches a
SubsidyHalvingInterval block.

node-stratum-pool uses the 'getblocksubsidy' RPC call without the optional
'height' argument, which returns the block subsidy reward at the current
block height. Instead 'height' with the block height of the next block
needs to be passed to 'getblocksubsidy'.

As the values from 'getblocksubsidy' are used to set the amounts of coinbase
tx vouts, upon reaching the halving block height boundry, node-stratum-pool would
generate a block that doesn't take the halved block rewards into account, which
gets rejected by the coin daemon.
2020-11-24 06:37:14 -06:00
Jeremy Anderson b36b7792ae
Use correct varint value (#54)
Explanation of this code provided by blondefrogs:

The transactions in a block are places in a vector. To serialize a vector, we need to be able to read its contents, so it serializes the size of the vector first but we don't know the size, so it uses a variable called a varint. A varint is trying to serialize the size in as little bits as possible. If the size is below 0xfc, it will just serialize the size Otherwise, if the size is above 0xfc, it will serialize a 0xfd first, then the size.

Basically, before this fix, the stratum would submit an invalidly coded block to the node if there were between 127 - 253 transactions in the block.
2020-04-16 01:05:15 -05:00
Potato b12e0b7c79 Fix undefined rpcData.treasury (#52) 2019-09-09 11:04:49 -05:00
SnowGem e7243aaeaa Update treasury reward for SnowGem in Knowhere fork (#51) 2019-09-08 17:02:57 -05:00
Corey M 0f3c9f8942 Add Vidulum VITA Support (#48)
VDL will be activating VRS at block 430,000.
2019-08-06 13:40:37 -05:00
Potato d2635ca369 Ycash support (#46) 2019-07-16 20:23:33 -05:00
Beshoy Girgis e4d82751ab Add ZelHash Support (#45)
This update allows 125,4 (ZelHash) shares to validate.
2019-06-23 04:18:53 +02:00
Beshoy Girgis 575cbe1086
Fix nTime calculation (#44)
nTime is coming through as a reverse buffer and is properly being
parsed, but not properly being converted to an integer. Because of this,
the checks that follow could never be triggered. This change converts
the ntime buffer to a string before running it through parseInt. In
addition, an isNaN check was added for additional safety.
2019-06-22 21:06:06 -05:00
SnowGem 878a1deb35 update SnowGem reward code (#42) 2019-06-03 02:44:06 -05:00
Beshoy Girgis 217250995c
Fix GENX masternode payments (#39)
It looks like some copy+paste didn't get updated causing the same variable to be re-used. This should fix genx blocks post mn activation height.
2019-04-01 10:42:50 -05:00
Beshoy Girgis 97c65b0a41 Dependency update and add 403 check to rpc (#37) 2019-03-19 06:45:48 -05:00
Loki Taljaard 9b24a76010 Fixed bad total for GENX pre-masternode code (#38) 2019-03-18 10:34:49 -05:00
Loki Taljaard e80116c298 Genesis Masternode Adjustments (#36)
Adjusted the block formulation to allow for masternode blocks
2019-03-17 23:17:57 -05:00
Beshoy Girgis c472159498 Support customizable subsidy multiplier (#33)
BTH's getblocksubsidy returns satoshi which differs from other chains who
return full coins. With this change, we'll default to expecting full
coin but allow that to be overridden by setting subsidyMultipleOfSatoshi
in the coin's config file.
2019-02-19 11:44:35 -06:00
TheTrunk 6575df3e2e ZelCash nodes (#34)
This PR adds payouts to all three tier of zelnodes (zelcash masternodes). Information is taken directly from getblocktemplate rpc call. If there isn't an enabled zelnode, the information is undefined and payout goes to miners.

Payouts are paid even if they are not yet enforced by the spork. Enforcement of payouts will be activated through spork after 21st of Feb.

payZelNodes can either be set to true or to a timestamp (in seconds!) of when expected enforcement of zelnode rewards by spork activation is about to happen for automatic transition. When false or unspecified zelnode payouts wont be paid.

The expected time of zelnode payouts is around 25th of Feb (TBD) so pool operators update their backend and specify "payZelNodes": 1551103200 in their zel.json file and once that time passes zelnode payouts will be paid. This still checks if the conditions for payouts are present - so if daemon is not specifying a zelnode payout address with a value, the payout will go to miner and not to zelnode even if payZelNodes is active.
2019-02-19 12:12:37 -05:00
nlevo 5e7c303756 Handle ANON v2 (#35)
Handle new ANON v2 getblocktemplate with developement fee and superblocks
2019-02-19 02:13:16 -05:00
Nate Smith 9f7b5ee379 Version update (#17)
I feel changing from getinfo to getblockchaininfo deserves a version change.

I also removed the NPM link that links to a stratum-pool that is not this one.
2019-01-28 02:35:21 -06:00
cronicc c3c8e30890 Horizen 20% Treasury update (#32) 2019-01-14 05:41:21 -06:00
zzzpotato 96fe949b9a Revert verushash to use working commit (#31)
Verushash seems to have updated in the last couple days however has not updated s-nomp to work with it. This will use a previously working version temporarily until their devs can fix the issue and new s-nomp users will be able to build successfully.
2018-12-24 19:58:22 -06:00
Beshoy Girgis 4a63f2aba7
Fix undefined variable error (#30)
blockHeight is not defined and fails when `sapling` or `overwinter` are set to a block height in the coin config. I've updated the code to use the correct `rpcData.height`.
2018-12-04 14:13:04 -06:00
CryptoForge 751a756790 Move network parameters to the coin.json file (#29)
Update the transaction.js file to use the coin variable already passed in to create the json variable needed by the bitgo-utxo-lib. This way new coins can be added to s-nomp without a push to the bitgo-utxo-lib repo.
2018-12-03 02:39:50 -06:00
Beshoy Girgis 8f8cc35481
Fix version check for sapling/overwinter (#26)
As @CryptoForge suggests in
https://github.com/s-nomp/node-stratum-pool/issues/25, this fixes the if
statement to properly check for the desired version.

Closes #25
2018-11-07 05:58:11 -06:00
Nate Smith 9081e4c116
Update lib/transactions.js (#27)
* Update lib/transactions.js

patched rewards function to run without burn being set to true. added if statement to error catch empty reward recipients.

* Update lib/transactions.js

burn = 0 added to recipient loop so it clears on each run.

* Update lib/transactions.js

removed extra space

* Update lib/transactions.js

spacing fix

* Update lib/transactions.js

removed extra line

* Update lib/transactions.js

actually removed extra line.

* Update lib/transactions.js

spacing fix
2018-11-06 16:13:24 -05:00
Nate Smith 3daad16084 Add Sapling support (#22)
Thanks to VerusHash for the original code https://github.com/VerusCoin/node-stratum-pool
2018-10-29 06:03:30 -05:00
Beshoy Girgis 62f0706017
Report rejected shares (#24)
Summary:
Currently, s-nomp is not reporting rejected shares properly back to the
miner. This change modifies the response to the miner to properly report
errors.
2018-10-28 19:52:04 -05:00
hashtobewild 2ce4ff391c reverted adding conditional (#18)
bug/fixed-conditional-getinfo
2018-09-22 13:55:39 -04:00
hashtobewild 54e99cd03a SafeCash Support Added (#12)
This commit adds SafeCash support, has some minor changes to messages to make debugging easier and also updates the "getinfo" API usage to the newer calls.
2018-09-22 02:36:18 -05:00
cryptosharks131 a1be587ac2 Lowercase hex in registerSubmit instead of calling code (#13)
Update to enforce lowercase in registerSubmit to ensure any new code that utilizes that method is lowercase and protected from double share attacks.
2018-08-14 15:46:58 -05:00
Beshoy Girgis 4fe437284d
Rename to s-nomp (#9) 2018-08-12 20:47:41 -05:00
Beshoy Girgis e5abc7d3de
Make pool hex configurable (#8)
For too long we've been asked to edit transactions.js. NO MORE! A sister commit will be pushed to s-nomp that will complement this commit.
2018-08-11 05:23:38 -05:00
nettts 25904d97af
Removed boom and hoex packages (#7) 2018-08-09 15:34:03 -04:00
nettts 05997fb4ea
Feat/192 7 support (#6)
* 192,7 Solution Slice 4

* testing purposes only

* Lets try again with the slice

* Found correct size 6

* Removed testing branch

* Update package-lock.json

This is a copy of a fresh npm update from the root of z-nomp.

* Connected with equihashverify/sync-with-upstream

* Removed testing branch
2018-08-09 10:15:53 -04:00
Beshoy Girgis 4cb8bce9f6
Swap out bitcoinjs-lib for a version we maintain (#4)
A commit was merged upstream that caused all coins that don't have
support for overwinter to break. This is a problem so we've forked the
repo and are maintaining our own copy to ensure we don't merge updates
that break functionality.
2018-07-31 13:11:17 -05:00
Beshoy Girgis 295bb11363 Initial cleanup + Zen adjustments
It was a bit tricky to get ZEN to work as expected. In the process of
working through the issues, I refactored some of the code (initial
refactoring) and updated the packages.
2018-07-30 23:21:48 -05:00
Beshoy Girgis aa2a07ae2e Fixed overwinter bug 2018-07-30 23:21:48 -05:00
cronicc 62c5320161 Fix getblocksubsidy block reward calculation 2018-07-30 23:21:48 -05:00
cronicc 1736ab8c0a Zen Super Nodes treasury update 2018-07-30 23:21:48 -05:00
Beshoy Girgis 2540fa6e55 Updated package.json and link to equihashverify 2018-07-15 14:20:08 -05:00
Beshoy Girgis e30fe2c1fa Replaced hex with one that links to a wiki page. 2018-07-15 13:58:19 -05:00
Beshoy Girgis 75916ebf6a Add overwinter support 2018-07-08 03:59:50 -05:00
Beshoy Girgis 768db03a54 Elusive bug 2018-06-16 04:00:18 -05:00
Beshoy Girgis 91c3c9f1f4 Fixed invalid type 2018-06-16 03:56:34 -05:00
Beshoy Girgis ababe7510c Minor cleanup 2018-06-06 22:06:57 -05:00
Beshoy Girgis d21633c3c9 Added ability to override subsidy parameters since vision coin doesn't
return the correct values.
2018-05-31 02:04:50 -05:00
Beshoy Girgis 8f6f437763 Configurable equihash parameters 2018-05-26 20:42:32 -05:00