Skip to content
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

INN / ENT support #183

Merged
merged 3 commits into from Oct 26, 2017
Merged

INN / ENT support #183

merged 3 commits into from Oct 26, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 26, 2017

AltMinerNet added 3 commits October 26, 2017 16:35
Handle coinbase correctly for innova and eternity.
@tpruvot tpruvot merged commit 9ec57d8 into tpruvot:next Oct 26, 2017
ma7555 added a commit to ma7555/yiimp that referenced this pull request Dec 25, 2018
* "yiimp coin SYM generated" command for maintenance checkups

can be useful if blocknotify is not working or if the backend had issues..

basically search for missed generated blocks.. and create them if the second param is set

Note: to use with care, old blocks are purged from the db after some time...

* stratum: reduce the client auth rpc calls (#111)

* miners: avoid costly queries on the shares table

* stratum: ignore method mining.multi_version #175

* c-cex: fix missing variable

* VIVO support (tpruvot#179)

Add support for VIVO masternodes
https://bitcointalk.org/index.php?topic=2110690

* Fix for Nova trading (tpruvot#180)

Remove the check for poloniex or bittrex. Which stopped coins that also had polo or trex markets to fail to sell.

* livecoin: implement manual coindb labels via their api

+ poloniex trading possible issue... for zpool

* use new nicehash api domain

* security: remove all unserialize() funcs from code

* pool_ttf and bench fixes for more recent servers

* backend: more proper int overflow on pool_ttf #141

related to mysql 5.7, int(11) seems no more supported

* blocknotify-dcr: refresh glide and fix new build issue

+ reduce sunday min payout

* cli: enhance graphes holes maintenance task

* cryptopia: workaround for missing deposit addresses

* sql: set default value on triggers timestamps

* stratum: fix possible issue on client subscribe

* cli: maintenance function to fix an invalid user symbol

* stratum: prevent some negative values

* stratum: extra check for job id field (tpruvot#181)

* backend: prevent too long wallet versions

* sql: bookmarks creation issue with recent mysql

* hsr algo (x13 + custom hash)

* handle phi algo too

* api: use a new constant for api host

* cli: improve coin generated command for confirmed orphans

some unstable (or flooded) wallet chains like LUX may fork twice

* stratum: INN / ENT support (tpruvot#183)

Handle coinbase for innova and eternity.

* stratum: DSR masternodes (tpruvot#184)

https://bitcointalk.org/index.php?topic=2272607.msg23083239#msg23083239

Masternode payments enabled.

getblocktemplate:
"masternode": {
"payee": "D5rbtUcYuyDPdFpotGBvzoGjt9z81QoKpj",
"script": "76a91407d98dac0453c81cc78e7b0c834a574894d1afc388ac",
"amount": 500001496
},
"masternode_payments_started": true,
"masternode_payments_enforced": true,

so, should be new version (like on Dash 12.1)

coinbase.cpp (stratum on yiimp)

  strcmp(coind->symbol, "DASH") == 0 || strcmp(coind->symbol, "DASH-TESTNET") == 0) // Dash 12.1

-------
Ticker is DSR:
http://coinsmarkets.com/trade-BTC-DSR.htm

* stratum: disable useless client sort

its not required to sort them, and can cause some "race" issues

* binance public api (markets)

disabled by default, and not enough infos about symbols (no coin label etc)

* backend: recheck orphaned blocks status in the hour, for LUX

* polytimos algo

* stratum: crown systemnode coinbase (tpruvot#187)

* yiimp: add polytimos to algo list (tpruvot#188)

* stratum: truncate worker fields if too long

for recent mysql default constraints

* nicehash: disable last api calls if not wanted

* polytimos algo list fix

:/

* stratum: support ONEX/GBX/KZC nodes (tpruvot#189)

Including
* ONEX Cash (https://bitcointalk.org/index.php?topic=2393150.0)
* GoByte (https://bitcointalk.org/index.php?topic=2414021.0)
* KZCash (https://bitcointalk.org/index.php?topic=2312421.0)

* payments: bulk op to reset a failed currency payout

Generally happen if the wallet balance is too low,
but in some cases could be also a rpc timeout (CHC),
so it require to be manually checked by the admin in the wallet tx history.

* markets: disable nova by default, ignore cryptopia scrypt

nova is closing in a week... better to ignore it now.

* markets: add stocks.exchange public api

disabled by default, optional...

* tools: update coindb labels api

* tools: add coincap.io api for missing labels

* Squashed commit for segwit support:

commit c59abe5d203fabdabcca81ff5f9c6ff133cfae3b
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Tue Nov 28 11:13:52 2017 +0100

    segwit: show a segwit icon on blocks history

    + remove some inline styles...

commit b4a8639370e6837ebc5a2047e7c334e9f931abfc
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Tue Nov 28 09:55:40 2017 +0100

    segwit: cleanup + masternode case

    tested ok with BSD (block 400996), and with real BTX segwit txs (block 90958)

    also ok on VTC and GRS

commit 926dbd11757ebff7f7d4930266de9b9061c8ab16
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Sat Nov 25 18:41:01 2017 +0100

    sql: add segwit fields, and ui config

    and fill block segwit field if it contains segwit txs,
    an icon is added in the dashboard "last blocks" for these blocks

commit 0b13bf55e9dd1d2229d188f0f8382b27642b20da
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Sat Nov 25 13:47:20 2017 +0100

    segwit: include commitment in coinbase + .conf toggle

    tested ok on BTX, GRS and VTC with normal txs, but the commitment merkle hash maybe need some more love...

    so, to prevent useless bigger blocks, only generate segwit commitment if a segwit tx is present in mempool

    to check with real segwit txs... not seen any yet..

commit b508bc87943d9e426cda994c2f53c16c11e8d4c3
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Thu Mar 2 11:18:34 2017 +0100

    segwit: prepare the witness data, but disabled

    need more test, may affect the coinbase merkle and the miners...

commit 19bd3a83b9ddddd8b5ed4b7a1bdf8cf8c233e346
Author: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Date:   Thu Mar 2 10:30:29 2017 +0100

    stratum: handle and auto toggle segwit if supported

* explorer: show segwit txs + workaround for some missing ones

* explorer: show tx indices and truncate blocks with too much

* stratum: allow wallet filters in the .conf

Allow to create a stratum port for only one wallet

* markets: update yobit markets prices with a different base

note: market record should be created manually, experimental..

* stocks.exchange private api function

* dashboard: fix alt balances for multialgo coins

* cryptopia: new default min_btc_trade and withdraw_fee_btc

* benchs: ignore if already too much data per chip/algo

* yaamp_fee() comment a few unused sql queries (on shares)

* cli: allow to pass args with spaces

* cli: new bench command to query bench data avgs

* keccak: use mBTC/GH unit like blake

if needed (already mining) you can do that to update the pool estimate graph values :

UPDATE hashrate SET price=price*1000.0, rent=rent*1000 WHERE algo IN ('keccak','keccakc') AND price < 0.01;

* yobit: markets price typo + coinsmarkets server fake bid price

* stratum: prefer user coin first in yiimp mode

prevent a few shares on the "best" algo wallet on connect...

* stratum: ipset function to block botnets

can be (manually) used, if needed, in client_authorize

* New admin botnets view to list users with many ips

fast, global view (all algos) to link/check wallets

* mining html fix (tpruvot#195)

coin reward html end tag correction.

* stratum: reduce client algo & socket struct size

to reduce a bit the memory usage... require a make clean!

+ prevent null/local ips from bans.

* stratum: prevent double free on bad clients

* sql: prepare new stratums fields for multiple instances

will be used to show the right pid/port of one instance,
and add some stats to avoid users to use full ones...

* stratum: fill new port workers and symbol fields

* sql: also add a stratum start time column

time column is refreshed at regular interval by the process

* update keys.sample.php (tpruvot#199)

* cex.io rest-api (public + private)

no trading or markets yet, just made to query balances

* coinexchange: check wallet status and disable if offline

* dashboard: show the stratum's uptime

* stratum: possibility to change sql port

* kucoin exchange api + balances and icons

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>

* stratum: use new dash masternodes as default

remember to do a make clean... coind struct was changed

* stratum: prevent double auth & ignore invalid sockets

seems to works well, but not a normal case/behavior

* bittrex: update min trade (tpruvot#203)

* stratum: null ptr check on json arrays

* stratum: handle more old masternodes (tpruvot#204)

* home: update project description

* kucoin: daily check deposit addresses + typo on manual ticker update

* ui: remove css width % from footer (tpruvot#206)

Was bothering me a lot.

* stratum: hsr sm3 cleanup + rotl32 issue

* binance: auth rest api function

* binance: update balances

deposit addresses seems missing in their api

* stratum: initialize segwit flag

* lbry: change estimates in mBTC/GH like other sha algos

if needed (already mining) you can do that to update the pool estimate graph values:

UPDATE hashrate SET price=price*1000.0, rent=rent*1000 WHERE algo='lbry' AND price < 0.01;

* backend: drop old blocks from the db after 60 days

* stratum: pushing more old masternodes (tpruvot#210)

* stratum: handle proxy protocol (tpruvot#196)

Implemented PROXY v2 protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) so that stratum can be run behind an haproxy instance.

iptables/ipset still work if haproxy is run on local machine. if run on remote machine switch to using client_block_ipset() and periodically sync the ipset to the machine running haproxy.
haproxy must be configured with send-proxy-v2, version 1 does not work

* decred: listtransactions order is finally like others

* stratum: check coin filters early (tpruvot#211)

Avoid the override of global variables
g_stratum_max_cons, g_max_shares, g_stratum_segwit
by excluded coinds by checking the include/exclude filters earlier.

* new x16r algo, with stratum factor 256, like timetravel algos

beware: this algo may have a variable hashrate, unlike timetravel

its ignored from benchs for this reason

* benchs: ignore some weird device names and x16r algo

* stratum: fix altminer commit

* cexio: include btc in orders for the balance

to do like bitstamp...

* Add MAG (Magnet) masternode to oldmasternodes (tpruvot#213)

Greetings, I am head dev for Magnet masternode and noticed the change
made in coinbase.cpp for recent masternode RPC as default.
This change has disabled masternode payments on pools using MAG client.
So, we would like to add it to oldmasternodes list with this pull request.

* balances: fill the btc 'onsell' field too (locked)

and restore bitstamp & cexio behavior to act like other trading exchanges

todo: kraken if possible... real pain, need to parse open orders..

* stratum: avoid the use of getinfo

* yescryptR16 algo (tpruvot#217)

Algo yescryptR16 for Yenten [YTN] https://bitcointalk.org/?topic=2329470.0

stratum changes from https://github.com/bubasik/yiimp

* sql: add hasgetinfo and no_explorer fields to coins table

wallets without getinfo will be handled in a later commit...

ps: remember to restart memcached service after the db change..

* stratum: extra check for the haters

* update sample stratum rc.local tpruvot#225

* admin: fill servers dropdown with the db tpruvot#222

with proper html quotes...

* stratum: set PBS as old masternode tpruvot#220

* NH: new algos (tpruvot#229)

* stratum: allow to reopen wiped global logs

can be useful after a logrotate, to avoid restarting the stratums

* Update x16r.conf : error with port (tpruvot#232)

* stratum: allow more than 254 transactions in blocks

* stratum: allow to limit txs per block

* stratum: DNR v2 masternodes

* stats: rewrite pool graphes data with json_encode

* Add a5a algo for Andcoin

* stratum: auto detect 'old' masternodes rpc (tpruvot#236)

* stratum: add missing keccakc variant

* explorer: truncate huge txs json for site reliability

+ display x16r hashorder field

* markets: handle cryptobridge ticker

* cli: allow to search users by ip

* stratum: fill fds and server name/url in stratums table

meant to detect socket leaks before its too late...

* stratum: fix the major socket leak on bad auth

* stratum: min diff and anti-flood adjustments

* stratum: ignore possible dup on new user

This race case was causing a stratum exit  and should not

* stratum: debuglog on/off without code recompile

+ drop log CFLAGS comments in Makefile and old defines comments

* use memcache object method instead of low level method (tpruvot#234)

* memcache: fix param order in last commit

* memcache: revert commit for the backend job

* stratum: disable haproxy ip translation code by default

toggle it via the .conf or edit code to change overall defaults

* stratum: ensure all blocks are put in db (tpruvot#241)

may be important for pool op noobs who dunno what they do,
doesn't setup blocknotify or have server efficiency issues..

squashed commit of today's commits, sorry for the mess ;)

prevent job delays if no blocks were submitted
double check coin id on blocknotify
remove noblocknotify boolean
prevent notify debuglog on normal blocks

* stratum: be more strict with user string fields

* stratum: remove useless mysql escape + fix for stats

the custom check is already more secure than "unknown" mysql code

* stratum: function to track mem usage

+ bad client possible leak... but it is not the main one

* stratum: function to check hex strings validity

* stratum: also check early nonce is hexa

and remove double submit_bad++

* stratum: warning fix for recent gcc

was -Wunused-result, useless but...

* stratum: socket recv timeout config

With a default value set to 10mn, better than unlimited (0)

* stratum: STAK special coinbase, with SegWit support

untested, but compiled fine

* stratum: drop STAK unused vars + git file mode fix

* Add yescryptR32 (tpruvot#247)

YescryptR32 for coin WAVI
https://bitcointalk.org/index.php?topic=3146751.0

Tested on : https://lpool.name/pool/WAVI

* backend: avoid to clear earnings during payouts (tpruvot#249)

+ simplify payment code based on RavenMinerPool commit

* backend: protect also balances from renting clear

+ set an expiration to memcache lock, payment unlikely fails, but...

* emulate getinfo for wallets who copy bitcoin mistakes (tpruvot#250)

like vertcoin 0.12... for sure its more efficient sigh

* x12 algo + GCH multi-algos definition

* markets: handle cryptohub api, but only manually

their api is not complete enough to auto create the markets...

* markets: avoid useless api queries if exchange is not used

* x16s algo, shuffle variant (tpruvot#251)

see https://bitcointalk.org/?topic=3208091.0 for more explanations

* small x16s fixes, and stratum sample

* markets: handle graviex ticker (tpruvot#252)

manual only, so market row need to be created manually if really required.

* trading: auto set bittrex and bleutrade withdraw tx fee

* benchs: unique function to format devices labels

+ some new devices chips rules

* security: be more strict with algo param

* security: protect XSS seekers from their own hacks

* stratum: do more checks on stats device names

* explorer: add multi-algo support for ARG explorer (tpruvot#254)

* Fix graviex market url (tpruvot#257)

* graviex: use the right ticker bid/ask fields

* config: new server var to disable autocreation of coins

* stratum: correctly create blocks with 253-255 transactions (tpruvot#260)

According to [1], varints of 0xfd to 0xff are prefixed with 0xfd too.

[1]: http://learnmeabitcoin.com/glossary/varint

* explorer: only allow hexa chars in query params

* dashboard: some cleanup, remove unused state

* stratum: precheck addresses are valid base58

* stratum: pre-check bad usernames before db add

* stratum: log ip of new clients (tpruvot#262)

* yiimp: log ip in debug message for unknown address (tpruvot#263)

* stratum: add vitalium algo (tpruvot#261)

note: beware of the masterscams

* backend: prevent php bug on empty masternode payee field (LUX)

* stratum: support for Machinecoin 0.16 mn+segwit (tpruvot#265)

* stratum: also prepare normal optional mn+segwit

* Revert "stratum: support for Machinecoin 0.16 mn+segwit (tpruvot#265)"

This reverts commit a78ec34.

* stratum: merge P2SH superblock code to prevent duplicated code

* handle allium algo, kind of double lyra2

* allium: fix pool diff ratio, same as lyra2v2, cf cpuminer-opt

* stratum: fix superblock script order

was not easy to code without the future wallet code to test it ;)

* stratum: support for MAC P2SH masternodes too (tpruvot#266)

note: a field "isscript" should be added to getblocktemplate masternode/superblock objects
if the type of address can vary over time... 
Code may be refactored later (common func and p2sh fields in coind object)

* stratum: common p2sh_pack_tx func for p2sh masternodes

* backend: keep blocks history at least 7 days

* exchanges: ignore coins 'created' by tradesatoshi

they have a very huge amount of scams...

* coindb: avoid incapsuda html on cryptopia icons

* stratum: detect if master wallet is p2sh + mn started field

* stratum: fix client memory leak in yescrypt

* trading: don't send coins to exchange which have late tx already

* lyra2z: prevent filenames with different cases

+ rename blake2 to blake2s and reorder algo makefile

* ci: add travis config (tpruvot#212)

* stratum: check json version string ptr validity

* stratum: handle ismine check moved in getaddressinfo

* Revert "stratum: handle ismine check moved in getaddressinfo"

most wallets are not ready for that...

This reverts commit afc80e2.

* stratum: DGB getaddressinfo to check master wallet

* stratum: getaddressinfo doesnt return isvalid

* api: add mbtc_mh_factor (mBTC/MH) to status api

1000 means mBTC/GH
0.001  for mBTC/kH

* api: disable rental apis if not enabled

* rpc: prevent any dump command

* rpc: also prevent dangerous methods in core btc class

* stratum: check if blocknotify string param is set

* stratum: more string params checks

* handle phi2 algo

* explorer: support for DUO multialgo (tpruvot#272)

* stratum: reduce valid ntime range

* stratum: add aergo algo (tpruvot#274)

+ spaces fixes

* checkup: delete images containing cloudcrap scripts

<script src="/_Incapsula_Resource?...>

* history: prefer block algo field in case of algo change

will not be used in normal cases, but you can temporary display 2 coin algos with that :

in web/yaamp/modules/site/results/found_results.php
@@ -19,6 +19,10 @@ WriteBoxHeader("Last $count Blocks ($algo)");
 $criteria->condition .= " AND IFNULL(coin.visible,1)=1"; // ifnull for rental
+if($algo == 'phi2') {
+       $criteria->condition .= " AND t.algo IN(:algo,'phi')";
+       $criteria->params = array(':algo'=>$algo);
+} else
 if($algo != 'all') {

* explorer: better check of block PoS type

* stratum: dev/charity fees for coins with masternodes (tpruvot#276)

* blocks: prevent duplicated blocks in some conditions... (tpruvot#278)

Could happen if you run twice the blocks thread by mistake,
and if block was not notified (inserted asap as status 'new').. unlikely but..

* coindb: avoid html in retrieved icons

* phi2 changes to handle lux smart contracts

adds a smart contract roots field (stateroot+utxoroot) to mining.notify

like lbry do with their claimtrie.

These fields are optional, means there are 2 variants of the phi2 algo

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>

* stratum: remove duplicated code, merge issue

* stratum: ensure share params are all strings

* stratum: small clean up :) (tpruvot#279)

* stratum: handle p2sh addresses for all coinbase variants

allow to mine on non-legacy addresses....

* stratum: add sonoa algo (lol)

i let you choose a port if you want to use it...

* User wallet: disable deletion of current wallet (tpruvot#280)

* cli: payout redotx and confirmations

two new maintenance functions/sample

* exchanges: link gate.io public api

look like a proper api with currencies labels

but disabled by default, to reduce api calls on new setups...

* stratum: handle XSH multialgo pow_hash special field (tpruvot#281)

* Handle XSH algos in explorer (tpruvot#282)

* blocks: avoid delayed coin save + screenlog func

in some cases, there was issues to save correctly with the coin form.

* blocks: log to screen only abnormal delays

* screenlog: show hour in 24H format

* ui: show next payout eta as tooltip

* stratum: handle phi2 smart-contracts refunds

* Add hex algo...  (tpruvot#285)

made by XDNA Core developers

* hex: x16r like algos dont need GH/s

* markets: bit-z ticker api (tpruvot#288)

* API: WalletEx: payouts (optional) (tpruvot#291)

new config keys : YAAMP_API_PAYOUTS (def. false) and YAAMP_API_PAYOUTS_PERIOD (last 24h)

* api: fix foreach typo in commit d78a329

and show timestamps as int value

* wallet: show USD (tpruvot#295)

* add rainforest algo (tpruvot#297)


from https://github.com/bschn2/rainforest/blob/master/patches/yiimp-rainforest.diff

* blocks: avoid status change to orphan during reindex

* rpc: prevent backupwallet method (tpruvot#298)

* Add Dynamic Argon2d algorithm to YIIMP Stratum Pool (tpruvot#301)

- Use dynode instead of masternode for Dynamic
- Updates Argon2d hash library (https://github.com/P-H-C/phc-winner-argon2)
- Adds argon2d-dyn.conf sample template file
- Code contributed by @BigEvilSoloMiner from Discord.
- testing and contributions by @R3D5H1RT from Discord
- testing and support by @insaneITgeek from Discord.
- Dynamic test stratum pool: https://testpool.dualityblocks.com

* bitz: prevent api error if data field is not present

* exchange: handle crex24 public api

* crex24: private api query, update balances

* kucoin: some tickers may not have a sell field

* rc.local: rename lyra2z screen + add argon2d-dyn (tpruvot#307)

rename lyra2z screen + add argon2d-dyn and rainforest

* stratum: update DGB addy check to include multi-alogs (tpruvot#316)

* explorer: add GLT multi-algo (tpruvot#317)

* txhisto: fix a nullptr if bitcoin wallet not in db

* Add LBK3 algo to yiimp (tpruvot#319)

+ finitions

* Add x22i algo support, based on ccminer-x22i code, cleaned

Personal note: imo a factor for 256 would have been useful

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>

* stex: use new url of stocksexchange

* RIP: cyptohub, hacked...

This reverts commit b43e8da5ae869c953768f558a0b1b292fcd050de.

* screen addition for new algos x22i and lbk3 (tpruvot#322)

* trading: wrong balance fields for Cryptopia (tpruvot#323)

Fixing a typo in balance update:
$market->balance was updated by $balance->HeldForTrades but should be $balance-.Available
This caused properly updated balance in previous loop to be overwritten by wrong value.

* coinbene public api, optional

(disabled by default in settings table)

* add exosis algo (timetravel type) (tpruvot#326)

* Warnings & tests folder (tpruvot#327)

* exchange: handle escodex public api

disabled by default, edit settings table

* stratum: add diff_min and diff_max optional conf fields

* Preparation for DigiByte rpcencoding (tpruvot#289)

Since 6.16.3, listtransactions requires '*' in account field
And soon, it may require different rules for mining (algo)

* wallet: show worker names if no password/extra

can be useful for miners without password argument (like gominer)

* handle blake2b standard algo (not sia)

* stratum: add blake2b.c to sha3 makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant