Skip to content

Commit

Permalink
- #72 jminer crashes if a plot file is actively being plotted
Browse files Browse the repository at this point in the history
- #73 listPlotFiles=true does not always show list
- prevent concurrent modification while creating real capacity lookup
- ensure lowestCommitted does not get updated with higher committed deadline due to bad timing
- removed obsolete properties triggerServer, recommitDeadlines, poc2ActivationBlockHeight
- some code cleanup and update to latest libs
- new version 0.5.3-SNAPSHOT
  • Loading branch information
de-luxe committed Jul 19, 2018
1 parent d99a8f6 commit 0f04d7c
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 651 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2017 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5
Copyright (c) 2015-2018 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 2 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This file has to be in the miner directory (same folder as '*.jar' file)
passPhrase=<YOUR PASS PHRASE>

# POC1 and POC2 - NOTICE
jminer supports POC2 since version 0.5.x
jminer still supports POC1

only use one type, POC1 or POC2 on one drive ('plotPath'), mixed will be skipped for now.

Expand Down Expand Up @@ -141,18 +141,6 @@ secretPhrase/password of solo mining burst-account

passPhrase=xxxxxxxxxxxxxx

### triggerServer (default: false)
on 'true' miner emulates open wallet gui, to prevent wallet server from
falling asleep (not sure if needed at all)

triggerServer=true

### recommitDeadlines (default: false)
recommits deadlines below 1200 3 times in a interval of 5 sec.
experimental feature to increase chance that deadline gets propagated
e.g. on short disconnect or connected peers busy etc.

recommitDeadlines=true


## OpenCL
Expand Down Expand Up @@ -224,7 +212,7 @@ thats the 'xx% done ...' info.

readProgressPerRound=16

### byteUnitDecimal (default:true)
### byteUnitDecimal (default:true)
switch between decimal units (true): TB/GB/MB (divided by 1000),
or binary units (false) TiB/GiB/MiB (divided by 1024) - https://en.wikipedia.org/wiki/Byte

Expand Down Expand Up @@ -286,18 +274,6 @@ by setting 'readerThreads=2', this will reduce mining speed but save memory.
readerThreads=10



## POC2

### poc2ActivationBlockHeight - (default:502000)
only adjust if the POC2 release fork gets delayed to a later block
>you can btw. test how your setup will behave after the POC2 fork
>with your current plotfiles. Just use a blockHeight from the past.
>No deadline will be confirmed! Just to check your read-times, cpu and memory usage.
poc2ActivationBlockHeight=502000





39 changes: 9 additions & 30 deletions jminer.default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# (openCL will also work with CPU in needed)
#
# Requirements:
# - Java8 (64bit recommend to use more memory) DO NOT USE Java9!
# - Java8 (64bit recommend to use more memory) DO NOT USE Java9/10!
# - openCL
#
# PLEASE DONATE
Expand All @@ -24,10 +24,8 @@
# NOTICE: your 'jminer.properties' hasn't got to contain all properties listed here
# as long there is a default/fallback defined, mentioned in here.
#
# POC1 and POC2
# jminer supports POC2 since version 0.5.x
# only use one type, POC1 or POC2 on one drive ('plotPath'), mixed will be skipped for now.
# ensure your POC2 plotfiles do not have staggersize in filename, or they will be treated like POC1.
# POC1 and POC2 -> jminer still supports POC1
# only use one type, POC1 or POC2 on one drive ('plotPath'), mixed will be skipped.
# POC1 filename: 'numericAccountId_startNonce_numberOfNonces_staggersize'
# POC2 filename: 'numericAccountId_startNonce_numberOfNonces'
# -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -66,6 +64,7 @@ listPlotFiles=
# dynamicTargetDeadline - 'true' will overrule 'targetDeadline' and 'forceLocalTargetDeadline' settings.
# (default:false) the miner will calculate the targetDeadline dynamic on poolMining:
# 'targetDL = 720 * netDiff / plotSizeInTiB' where 'netDiff = 18325193796 / baseTarget'
# as suggested by pocc pools.
# -----------------------------------------------------------------------------------
poolMining=

Expand Down Expand Up @@ -100,7 +99,7 @@ numericAccountId=xxxxxxxxxxxxxxx
poolServer=http://pool.com

# Winner
walletServer=https://wallet.burst-team.us
walletServer=https://wallet3.burst-team.us:2083
winnerRetriesOnAsync=
winnerRetryIntervalInMs=

Expand All @@ -113,18 +112,9 @@ winnerRetryIntervalInMs=
#
# passPhrase - secretPhrase/password of solo mining burst-account
# (required for solo)
#
# triggerServer - emulates open wallet, to prevent it from
# (default: false) falling asleep (not sure if needed at all)
#
# recommitDeadlines - recommits deadlines below 1200 3 times in a interval of 5 sec.
# (default: false) experimental feature to increase chance that deadline gets propagated
# e.g. on short disconnect or connected peers busy etc.
# -----------------------------------------------------------------------------------
soloServer=http://localhost:8125
passPhrase=xxxxxxxxxxxxxx
triggerServer=
recommitDeadlines=

# -----------------------------------------------------------------------------------
# - OpenCL -----------------------------------------------------------------------------
Expand Down Expand Up @@ -168,8 +158,8 @@ deviceId=
# (default:log/jminer.log.txt)
#
# logPatternConsole - only needed if you want to configure your own log pattern e.g.:
# logPatternFile %blue(%d{HH:mm:ss.SSS}) %green(%msg%n)
# would only show colored time and message
# logPatternFile logPatternConsole=%-5level- %d{HH:mm:ss} | %msg%n
# (default logback) would only show logLevel, time and message
# Docs: https://logback.qos.ch/manual/layouts.html#ClassicPatternLayout
# -----------------------------------------------------------------------------------
refreshInterval=2000
Expand All @@ -179,7 +169,7 @@ connectionTimeout=18000
debug=
writeLogFile=
logFilePath=
logPatternConsole=
logPatternConsole=%-5level%d{HH:mm:ss} | %msg%n
logPatternFile=

# -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -219,15 +209,4 @@ showSkippedDeadlines=
# by setting 'readerThreads=2', this will reduce mining speed but save memory.
# -----------------------------------------------------------------------------------
chunkPartNonces=
readerThreads=


# -----------------------------------------------------------------------------------
# - POC2 ----------------------------------------------------------------------------
# -----------------------------------------------------------------------------------
# poc2ActivationBlockHeight - only adjust if the POC2 release fork gets delayed to a later block
# (default:502000) 'you can test how your setup with current plotfiles would behave
# after the POC2 fork. Just use a blockHeight from the past.
# No deadline will be confirmed! Just to check your read-times, cpu and memory usage.'
# -----------------------------------------------------------------------------------
poc2ActivationBlockHeight=
readerThreads=
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>burstcoin</groupId>
<artifactId>burstcoin-jminer</artifactId>
<version>0.5.2-RELEASE</version>
<version>0.5.3-SNAPSHOT</version>
<packaging>jar</packaging>

<name>burstcoin-jminer</name>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>

Expand All @@ -24,7 +24,7 @@
<java.version>1.8</java.version>
<jocl-blast.version>1.3.0</jocl-blast.version>
<saphir-hash.version>3.0.3</saphir-hash.version>
<bcprov-jdk15on.version>1.59</bcprov-jdk15on.version>
<bcprov-jdk15on.version>1.60</bcprov-jdk15on.version>

<!-- only needed for older gpu -->
<!--<jocl.version>0.1.9</jocl.version>-->
Expand Down
2 changes: 1 addition & 1 deletion run.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java -jar -d64 -XX:+UseG1GC burstcoin-jminer-0.5.2-RELEASE.jar
java -jar -d64 -XX:+UseG1GC burstcoin-jminer-0.5.3-SNAPSHOT.jar
26 changes: 6 additions & 20 deletions src/main/java/burstcoin/jminer/JMinerCommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import burstcoin.jminer.core.network.event.NetworkPoolInfoEvent;
import burstcoin.jminer.core.network.event.NetworkResultConfirmedEvent;
import burstcoin.jminer.core.network.event.NetworkResultErrorEvent;
import burstcoin.jminer.core.network.event.NetworkStateChangeEvent;
import burstcoin.jminer.core.reader.Reader;
import burstcoin.jminer.core.reader.event.ReaderCorruptFileEvent;
import burstcoin.jminer.core.reader.event.ReaderDriveFinishEvent;
import burstcoin.jminer.core.reader.event.ReaderDriveInterruptedEvent;
Expand Down Expand Up @@ -63,7 +63,6 @@ public class JMinerCommandLine
private static final String G_UNIT = CoreProperties.isByteUnitDecimal() ? "GB" : "GiB";
private static final String M_UNIT = CoreProperties.isByteUnitDecimal() ? "MB" : "MiB";

private static long blockNumber;
private static int progressLogStep;
private static long previousRemainingCapacity = 0;
private static long previousElapsedTime = 0;
Expand All @@ -86,15 +85,11 @@ public void run(String... args)
LOG.info(" __ __ GPU assisted PoC-Miner");
LOG.info(" |__| _____ |__| ____ ___________ ");
LOG.info(" version | |/ \\| |/ \\_/ __ \\_ __ \\");
LOG.info(" 0.5.2 | | Y Y \\ | | \\ ___/| | \\/");
LOG.info(" 0.5.3 | | Y Y \\ | | \\ ___/| | \\/");
LOG.info(" /\\__| |__|_| /__|___| /\\___ >__| ");
LOG.info(" \\______| \\/ \\/ \\/");
LOG.info(" mining engine: BURST-LUXE-RED2-G6JW-H4HG5");
LOG.info(" openCL checker: BURST-QHCJ-9HB5-PTGC-5Q8J9");
LOG.info("-------------------------------------------------------");
LOG.info("NOTICE:");
LOG.info("1. Only use POC1 or POC2 per drive (plotPaths), mixed is not supported!");
LOG.info("2. POC2 plotfiles are detected by not having 'staggersize' in filename.");

// start mining
Network network = context.getBean(Network.class);
Expand All @@ -118,7 +113,7 @@ public void onApplicationEvent(RoundFinishedEvent event)
String bestDeadline = Long.MAX_VALUE == event.getBestCommittedDeadline() ? "N/A" : String.valueOf(event.getBestCommittedDeadline());
LOG.info("FINISH block '" + event.getBlockNumber() + "', "
+ "best deadline '" + bestDeadline + "', "
+ "connection '" + event.getNetworkQuality() + "%', "
+ "net '" + event.getNetworkQuality() + "%', "
+ "time '" + s + "s " + ms + "ms'");

showNetworkQualityInfo(event.getNetworkQuality());
Expand All @@ -145,7 +140,7 @@ public void onApplicationEvent(RoundStoppedEvent event)
String bestDeadline = Long.MAX_VALUE == event.getBestCommittedDeadline() ? "N/A" : String.valueOf(event.getBestCommittedDeadline());
LOG.info("STOP block '" + event.getBlockNumber() + "', " + String.valueOf(percentage) + "% done, "
+ "best deadline '" + bestDeadline + "', "
+ "connection '" + event.getNetworkQuality() + "%', "
+ "net '" + event.getNetworkQuality() + "%', "
+ "time '" + s + "s " + ms + "ms'");

showNetworkQualityInfo(event.getNetworkQuality());
Expand All @@ -157,7 +152,7 @@ public void onApplicationEvent(RoundStoppedEvent event)
@Override
public void onApplicationEvent(NetworkLastWinnerEvent event)
{
if(blockNumber - 1 == event.getLastBlockNumber())
if(Reader.blockNumber.get() - 1 == event.getLastBlockNumber())
{
LOG.info(" winner block '" + event.getLastBlockNumber() + "', '" + event.getWinner() + "'");
}
Expand All @@ -168,15 +163,6 @@ public void onApplicationEvent(NetworkLastWinnerEvent event)
}
});

context.addApplicationListener(new ApplicationListener<NetworkStateChangeEvent>()
{
@Override
public void onApplicationEvent(NetworkStateChangeEvent event)
{
blockNumber = event.getBlockNumber();
}
});

context.addApplicationListener(new ApplicationListener<RoundStartedEvent>()
{
@Override
Expand Down Expand Up @@ -325,7 +311,7 @@ public void onApplicationEvent(ReaderCorruptFileEvent event)
@Override
public void onApplicationEvent(ReaderDriveFinishEvent event)
{
if(blockNumber == event.getBlockNumber())
if(Reader.blockNumber.get() == event.getBlockNumber())
{
// calculate capacity
long doneBytes = event.getSize();
Expand Down
31 changes: 0 additions & 31 deletions src/main/java/burstcoin/jminer/core/CoreProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class CoreProperties
private static final Properties PROPS = new Properties();

// default values
private static final int DEFAULT_POC2_ACTIVATION_BLOCK_HEIGHT = 502000;
private static final int DEFAULT_CHUNK_PART_NONCES = 960000;
private static final int DEFAULT_PLATFORM_ID = 0;
private static final int DEFAULT_DEVICE_ID = 0;
Expand All @@ -58,11 +57,9 @@ public class CoreProperties
private static final boolean DEFAULT_BYTE_UNIT_DECIMAL = true;
private static final boolean DEFAULT_LIST_PLOT_FILES = false;
private static final boolean DEFAULT_SHOW_DRIVE_INFO = false;
private static final boolean DEFAULT_RECOMMIT_DEADLINES = false;
private static final boolean DEFAULT_SHOW_SKIPPED_DEADLINES = true;
private static final int DEFAULT_READER_THREADS = 0;
private static final boolean DEFAULT_DEBUG = false;
private static final boolean DEFAULT_TRIGGER_SERVER = false;
private static final boolean DEFAULT_WRITE_LOG_FILE = false;
private static final boolean DEFAULT_UPDATE_MINING_INFO = true;
private static final String DEFAULT_LOG_FILE_PATH = "log/jminer.log.txt";
Expand All @@ -79,7 +76,6 @@ public class CoreProperties
}
}

private static Integer poc2ActivationBlockHeight;
private static Integer readProgressPerRound;
private static Long refreshInterval;
private static Long connectionTimeout;
Expand Down Expand Up @@ -417,15 +413,6 @@ public static long getChunkPartNonces()
return chunkPartNonces;
}

public static int getPoc2ActivationBlockHeight()
{
if(poc2ActivationBlockHeight == null)
{
poc2ActivationBlockHeight = asInteger("poc2ActivationBlockHeight", DEFAULT_POC2_ACTIVATION_BLOCK_HEIGHT);
}
return poc2ActivationBlockHeight;
}

public static boolean isByteUnitDecimal()
{
if(byteUnitDecimal == null)
Expand Down Expand Up @@ -462,15 +449,6 @@ public static boolean isShowDriveInfo()
return showDriveInfo;
}

public static boolean isRecommitDeadlines()
{
if(recommitDeadlines == null)
{
recommitDeadlines = asBoolean("recommitDeadlines", DEFAULT_RECOMMIT_DEADLINES);
}
return recommitDeadlines;
}

public static boolean isShowSkippedDeadlines()
{
if(showSkippedDeadlines == null)
Expand All @@ -489,15 +467,6 @@ public static boolean isWriteLogFile()
return writeLogFile;
}

public static boolean isTriggerServer()
{
if(triggerServer == null)
{
triggerServer = asBoolean("triggerServer", DEFAULT_TRIGGER_SERVER);
}
return triggerServer;
}

public static boolean isDebug()
{
if(debug == null)
Expand Down
Loading

0 comments on commit 0f04d7c

Please sign in to comment.