Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Dev #216

Merged
merged 97 commits into from
Feb 21, 2018
Merged

Dev #216

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
5b7f09b
Log and record miner submitting block solution
Jan 10, 2018
629fba9
Fix top miner query
Jan 10, 2018
7218c5b
Don't expose disabled pools via API
Jan 10, 2018
5e8906a
External socket binding
Jan 11, 2018
a505c83
API Fix
Jan 11, 2018
c8000ed
WIP
Jan 11, 2018
26de06f
WIP
Jan 11, 2018
b3c63d2
Revert connect change
Jan 12, 2018
f3f40b7
Monero address validation fixes
Jan 12, 2018
01856f1
More Monero integrated address fixes
Jan 12, 2018
a0ff757
Better handling for invalid payment Ids
Jan 12, 2018
80e7279
Payout-batch address fix
Jan 12, 2018
80a154e
Actually detect network type in payout handler
Jan 12, 2018
3b352f1
Merge branch 'master' of https://github.com/coinfoundry/miningcore in…
Jan 14, 2018
c3d79c3
Support ZMQ block notify for Bitcoin family. Fixes #151.
Jan 15, 2018
db8cab8
Adjust Lyra2v2 Hashrate multiplier. Fixes #168
Jan 15, 2018
7690e50
Made RPC polling optional
Jan 15, 2018
4756203
Honor cancellation token in inner loop
Jan 15, 2018
9efb4b7
Add addresses
Jan 16, 2018
16bbcdc
Merge branch 'master' of https://github.com/coinfoundry/miningcore in…
Jan 16, 2018
7ce6655
Don't expose payment processing config extension data via API. Fixes …
Jan 16, 2018
e0dc273
Keep extra data in api result but sanitize it first
Jan 17, 2018
a4737a9
WIP
Jan 19, 2018
4493eff
PG command timeout
Jan 19, 2018
f19c7c9
Add support for ZEN and XVG
Jan 23, 2018
728c2ea
Return Coin POW Algorithm in API results
Jan 23, 2018
4f26ac3
Expose pool total miner earnings via API
Jan 23, 2018
b6634be
Improved LTC block explorer links
Jan 23, 2018
a93be43
Neoscrypt update
Jan 24, 2018
39b6709
Neoscrypt tests
Jan 24, 2018
318f151
Hashtest fix for neoscrypt
Jan 25, 2018
b04d53b
GBX & CRC
Jan 25, 2018
93c1cee
Neoscrypt fixes
Jan 25, 2018
f5f530d
Don't tie ZMQ block notify to a single address. Fixes #183
Jan 25, 2018
1c6112a
X17 hash integration
Jan 26, 2018
56d8d1e
Neoscrypt argument validation
Jan 26, 2018
af1d7b9
Drop paged retries from Monero Payments as those won't work anyway wh…
Jan 26, 2018
01a1f1a
WIP
Jan 26, 2018
bd41307
Interlocked WIP
Jan 26, 2018
d238210
Support Verge X17 variant
Jan 26, 2018
20c8f53
Make algo comparison case-insensitive
Jan 26, 2018
20a43f7
Added support for MaxActiveJobs Bitcoin Pool extra config
Jan 26, 2018
1bbe4be
Added logging
Jan 26, 2018
0603d13
WIP
Jan 26, 2018
d82ba4e
Merge branch 'master' of https://github.com/coinfoundry/miningcore in…
Jan 26, 2018
edc7759
Merge branch 'dev' of https://github.com/coinfoundry/miningcore into dev
Jan 26, 2018
1175dc0
Ignore redundant ZMQ block hash updates for the same block from multi…
Jan 26, 2018
e37603c
WIP
Jan 28, 2018
9921e08
WIP
Jan 28, 2018
ac17865
Disable suggest_difficulty for now
Jan 28, 2018
18dfca0
Job management change
Jan 28, 2018
8ee93ab
Runtime info logging
Jan 28, 2018
7c5047b
WIP
Feb 2, 2018
16e869f
WIP
Feb 2, 2018
69c4875
Fixed GBX, CRC
Feb 3, 2018
6c4fc32
Do not return stale miner performance stats via API
Feb 4, 2018
80053c3
WIP
Feb 4, 2018
2838c26
VarDiff maxDelta support
Feb 4, 2018
559fba4
Validate Monero PaymentID on login
Feb 10, 2018
1d3229b
WIP
Feb 10, 2018
4eb3382
Do not send work until login is complete. Fixes #204
Feb 10, 2018
09a68cd
BTCP prep
Feb 12, 2018
d203887
Restore Monero paged payout retries
Feb 12, 2018
c249bcb
Blake2s hash integration
Feb 13, 2018
ef82e27
Stats Pre-aggregation for performance critical APIs
Feb 13, 2018
410cd14
Support for Legacy Bitcoin daemons and more complete Verge (XVG) inte…
Feb 13, 2018
81b295e
Neoscrypt fix
Feb 14, 2018
c788a7b
Refactor
Feb 14, 2018
213b87c
Merge branch 'dev' of https://github.com/coinfoundry/miningcore into dev
Feb 14, 2018
a4eb2d1
Legacy daemon fix
Feb 15, 2018
ef387cb
WIP
Feb 15, 2018
1ac0c9b
improved POW/POS check
Feb 15, 2018
f2041c2
Disable bitcoin proof-of-stake auto-detect and moved to config parameter
Feb 15, 2018
fe120fa
WIP
Feb 15, 2018
70c4433
WIP
Feb 15, 2018
6894fad
Scrap stats pre-agg
Feb 16, 2018
a8f3899
WIP
Feb 16, 2018
10b168c
WIP
Feb 16, 2018
61d9937
Trigger based share pre-agg
Feb 17, 2018
a7e75b4
Fetch share counts from pre-aggregation table
Feb 17, 2018
b4d1afa
WIP
Feb 17, 2018
6e79ae7
Damn
Feb 17, 2018
45833f4
Logging submissions
Feb 18, 2018
be7215a
Verge hashing
Feb 18, 2018
c221d2f
WIP
Feb 18, 2018
7826cc4
Reward POS stuff
Feb 18, 2018
c3132b2
Verge Blockhasher fixes
Feb 19, 2018
323db8f
BlockRewardMultiplier
Feb 19, 2018
4b43e54
WIP
Feb 19, 2018
67372a3
Increase Pg Command Timeout
Feb 19, 2018
dc30c0b
WIP
Feb 19, 2018
e9d8729
WIP
Feb 21, 2018
df98b3c
Added payment audit-trail
Feb 21, 2018
2a1c7d8
WIP
Feb 21, 2018
80b2fcb
WIP
Feb 21, 2018
ee612c0
WIP
Feb 21, 2018
5433c7f
Cleanup
Feb 21, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MiningCore.Tests/Blockchain/Bitcoin/BitcoinJobTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void BitcoinJob_Should_Accept_Valid_Share()
var clock = new MockMasterClock { CurrentTime = DateTimeOffset.FromUnixTimeSeconds(1508869874).UtcDateTime };

job.Init(bt, "1", poolConfig, clusterConfig, clock, poolAddressDestination, BitcoinNetworkType.RegTest,
false, 1, sha256d, sha256d, sha256dReverse);
false, 1, 1, sha256d, sha256d, sha256dReverse);

// set clock to submission time
clock.CurrentTime = DateTimeOffset.FromUnixTimeSeconds(1508869907).UtcDateTime;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void BitcoinJob_Should_Not_Accept_Invalid_Share()
var clock = new MockMasterClock { CurrentTime = DateTimeOffset.FromUnixTimeSeconds(1508869874).UtcDateTime };

job.Init(bt, "1", poolConfig, clusterConfig, clock, poolAddressDestination, BitcoinNetworkType.RegTest,
false, 1, sha256d, sha256d, sha256dReverse);
false, 1, 1, sha256d, sha256d, sha256dReverse);

// set clock to submission time
clock.CurrentTime = DateTimeOffset.FromUnixTimeSeconds(1508869907).UtcDateTime;
Expand Down
2 changes: 1 addition & 1 deletion src/MiningCore.Tests/Blockchain/ZCash/ZCashJobTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void ZCashJob_Testnet_Validate_FoundersRewardAddress_At_Height()
var clock = new MockMasterClock { CurrentTime = DateTimeOffset.FromUnixTimeSeconds(1508869874).UtcDateTime };

job.Init(bt, "1", poolConfig, clusterConfig, clock, poolAddressDestination, BitcoinNetworkType.Test,
false, 1, sha256d, sha256d, sha256dReverse);
false, 1, 1, sha256d, sha256d, sha256dReverse);

bt.Height = 1;
Assert.Equal(job.GetFoundersRewardAddress(), "t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi");
Expand Down
16 changes: 16 additions & 0 deletions src/MiningCore.Tests/Crypto/HashingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ public void Blake_Hash_Should_Throw_On_Null_Input()
Assert.Throws<ArgumentNullException>(() => hasher.Digest(null));
}

[Fact]
public void Blake2s_Hash_Should_Match()
{
var hasher = new Blake2s();
var result = hasher.Digest(testValue2).ToHexString();

Assert.Equal("c3ee938582d70ccd9a323b6097357449365d1fdfbbe2ecd7ee44e4bdbbb24392", result);
}

[Fact]
public void Blake2s_Hash_Should_Throw_On_Null_Input()
{
var hasher = new Blake2s();
Assert.Throws<ArgumentNullException>(() => hasher.Digest(null));
}

[Fact]
public void Groestl_Hash_Should_Match()
{
Expand Down
4 changes: 3 additions & 1 deletion src/MiningCore/Api/ApiServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ private async Task GetMinerInfoAsync(HttpContext context, Match m)
return;
}

var perfMode = context.GetQueryParameter<string>("perfMode", "day");

var statsResult = cf.RunTx((con, tx) =>
statsRepo.GetMinerStats(con, tx, pool.Id, address), true, IsolationLevel.Serializable);

Expand All @@ -432,7 +434,7 @@ private async Task GetMinerInfoAsync(HttpContext context, Match m)
stats.LastPaymentLink = string.Format(baseUrl, statsResult.LastPayment.TransactionConfirmationData);
}

stats.Performance24H = GetMinerPerformanceInternal("day", pool, address);
stats.PerformanceSamples = GetMinerPerformanceInternal(perfMode, pool, address);
}

await SendJson(context, stats);
Expand Down
9 changes: 3 additions & 6 deletions src/MiningCore/Api/Extensions/MiningPoolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ public static PoolInfo ToPoolInfo(this PoolConfig pool, IMapper mapper, Persiste

private static string GetPoolAlgorithm(PoolConfig pool)
{
var result = pool.Coin.Algorithm;
string result = null;

if (string.IsNullOrEmpty(result))
{
if (CoinMetaData.CoinAlgorithm.TryGetValue(pool.Coin.Type, out var getter))
result = getter(pool.Coin.Type);
}
if (CoinMetaData.CoinAlgorithm.TryGetValue(pool.Coin.Type, out var getter))
result = getter(pool.Coin.Type, pool.Coin.Algorithm);

// Capitalize
if (!string.IsNullOrEmpty(result) && result.Length > 1)
Expand Down
2 changes: 1 addition & 1 deletion src/MiningCore/Api/Responses/GetMinerStatsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ public class MinerStats
public DateTime? LastPayment { get; set; }
public string LastPaymentLink { get; set; }
public WorkerPerformanceStatsContainer Performance { get; set; }
public WorkerPerformanceStatsContainer[] Performance24H { get; set; }
public WorkerPerformanceStatsContainer[] PerformanceSamples { get; set; }
}
}
6 changes: 5 additions & 1 deletion src/MiningCore/Blockchain/Bitcoin/BitcoinConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ public static class BitcoinCommands
public const string GetMiningInfo = "getmininginfo";
public const string GetPeerInfo = "getpeerinfo";
public const string ValidateAddress = "validateaddress";
public const string GetDifficulty = "getdifficulty";
public const string GetBlockTemplate = "getblocktemplate";
public const string GetBlockSubsidy = "getblocksubsidy";
public const string SubmitBlock = "submitblock";
public const string GetBlockchainInfo = "getblockchaininfo";
public const string GetBlock = "getblock";
public const string GetTransaction = "gettransaction";
public const string SendMany = "sendmany";

// Legacy commands
public const string GetInfo = "getinfo";
public const string GetDifficulty = "getdifficulty";
public const string GetConnectionCount = "getconnectioncount";
}
}
6 changes: 4 additions & 2 deletions src/MiningCore/Blockchain/Bitcoin/BitcoinJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class BitcoinJob<TBlockTemplate>
protected IMasterClock clock;
protected IHashAlgorithm coinbaseHasher;
protected double shareMultiplier;
protected decimal blockRewardMultiplier;
protected int extraNoncePlaceHolderLength;
protected IHashAlgorithm headerHasher;
protected bool isPoS;
Expand Down Expand Up @@ -239,7 +240,7 @@ protected virtual Script GenerateScriptSigInitial()

protected virtual Transaction CreateOutputTransaction()
{
rewardToPool = new Money(BlockTemplate.CoinbaseValue, MoneyUnit.Satoshi);
rewardToPool = new Money(BlockTemplate.CoinbaseValue * blockRewardMultiplier, MoneyUnit.Satoshi);

var tx = new Transaction();

Expand Down Expand Up @@ -411,7 +412,7 @@ protected virtual byte[] BuildRawTransactionBuffer()
public virtual void Init(TBlockTemplate blockTemplate, string jobId,
PoolConfig poolConfig, ClusterConfig clusterConfig, IMasterClock clock,
IDestination poolAddressDestination, BitcoinNetworkType networkType,
bool isPoS, double shareMultiplier,
bool isPoS, double shareMultiplier, decimal blockrewardMultiplier,
IHashAlgorithm coinbaseHasher, IHashAlgorithm headerHasher, IHashAlgorithm blockHasher)
{
Contract.RequiresNonNull(blockTemplate, nameof(blockTemplate));
Expand All @@ -436,6 +437,7 @@ public virtual void Init(TBlockTemplate blockTemplate, string jobId,
extraNoncePlaceHolderLength = BitcoinConstants.ExtranoncePlaceHolderLength;
this.isPoS = isPoS;
this.shareMultiplier = shareMultiplier;
this.blockRewardMultiplier = blockrewardMultiplier;

this.coinbaseHasher = coinbaseHasher;
this.headerHasher = headerHasher;
Expand Down
Loading