Skip to content

Commit

Permalink
Merge pull request #35 from signum-network/develop
Browse files Browse the repository at this point in the history
Recent fixes
  • Loading branch information
jjos2372 authored Jul 12, 2021
2 parents 7a4706f + 7bbf594 commit 781b1b2
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 20 deletions.
3 changes: 3 additions & 0 deletions dist/pool.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ maxDeadline = 1000000000
# short lived network forks.
processLag = 10

# How many deadlines a miner can miss without having its shared capacity penalized
graceDeadlines = 2

# The block to activate PoC+
pocPlusBlock = 878000

Expand Down
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Miner teilen sich weniger als 20%",
"languageName": "Deutsch",
"chooseLanguage": "Wählen Sie eine Sprache",
"noBlocksWon": "Es sind keine Blöcke gewonnen, holen Sie sie!"
"noBlocksWon": "Es sind keine Blöcke gewonnen, holen Sie sie!",
"processing": "Wird bearbeitet..."
}
1 change: 1 addition & 0 deletions react-pool/public/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"signatureS": "for enthusiasts by enthusiasts",
"waiting": "Waiting...",
"loading": "Loading...",
"processing": "Processing...",
"updateYourMiner": "Unknown, update your miner",
"viewMinerDetails": "View miner details",
"viewMinerInExplorer": "View miner in explorer",
Expand Down
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Mineros compartiendo menos del 20%",
"languageName": "Español",
"chooseLanguage": "Elija un idioma",
"noBlocksWon": "No hay bloques ganados, ¡ve por ellos!"
"noBlocksWon": "No hay bloques ganados, ¡ve por ellos!",
"processing": "Procesando..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Mineurs partageant moins de 20%",
"languageName": "Français",
"chooseLanguage": "Choisissez une langue",
"noBlocksWon": "Il n'y a pas de blocs gagnés, allez les chercher !"
"noBlocksWon": "Il n'y a pas de blocs gagnés, allez les chercher !",
"processing": "Traitement..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Minatori che condividono meno del 20%",
"languageName": "Italiano",
"chooseLanguage": "Scegli una lingua",
"noBlocksWon": "Non ci sono blocchi vinti, andate a prenderli!"
"noBlocksWon": "Non ci sono blocchi vinti, andate a prenderli!",
"processing": "In lavorazione..."
}
1 change: 1 addition & 0 deletions react-pool/public/assets/locales/kr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"signatureS": "매니아 매니아를위한",
"waiting": "기다리는...",
"loading": "로드 중 ...",
"processing": "처리 중 ...",
"updateYourMiner": "알 수 없음, 광부를 업데이트하십시오.",
"viewMinerDetails": "광부 세부 정보보기",
"viewMinerInExplorer": "탐색기에서 광부보기",
Expand Down
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Mijnwerkers delen minder dan 20%",
"languageName": "Nederlands",
"chooseLanguage": "Kies een taal",
"noBlocksWon": "Er zijn geen blokken gewonnen, ga ze halen!"
"noBlocksWon": "Er zijn geen blokken gewonnen, ga ze halen!",
"processing": "Verwerken..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Górnicy dzielący mniej niż 20%",
"languageName": "Polskie",
"chooseLanguage": "Wybierz język",
"noBlocksWon": "Nie ma wygranych bloków, zdobądź je!"
"noBlocksWon": "Nie ma wygranych bloków, zdobądź je!",
"processing": "Przetwarzanie..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Mineradores compartilhando menos de 20%",
"languageName": "Português",
"chooseLanguage": "Escolha um idioma",
"noBlocksWon": "Não há blocos ganhos, vá pegá-los!"
"noBlocksWon": "Não há blocos ganhos, vá pegá-los!",
"processing": "Em processamento..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Майнеры делят менее 20%",
"languageName": "русский",
"chooseLanguage": "Выберите язык",
"noBlocksWon": "Нет выигранных блоков, идите и возьмите их!"
"noBlocksWon": "Нет выигранных блоков, идите и возьмите их!",
"processing": "Обработка..."
}
3 changes: 2 additions & 1 deletion react-pool/public/assets/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "Madenciler %20'den daha azını paylaşıyor",
"languageName": "Türk",
"chooseLanguage": "Bir Dil Seçin",
"noBlocksWon": "Kazanılan blok yok, git onları al!"
"noBlocksWon": "Kazanılan blok yok, git onları al!",
"processing": "İşleme..."
}
5 changes: 3 additions & 2 deletions react-pool/public/assets/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"commitmentTiB": "抵押/TiB",
"committedBalance": "抵押金额",
"configurationWithMessages": "消息配置",
"configurationWithMessagesParagraph": "如果您已经加入了池,您可以通过<1>从miner帐户向矿池帐户发送未加密的文本消息来进一步配置它(在{processLag}}之后生效):",
"configurationWithMessagesParagraph": "如果您已经加入了池,您可以通过<1>从miner帐户向矿池帐户发送未加密的文本消息来进一步配置它</1>(在{processLag}}之后生效):",
"confirmedDeadline": "已确认DL",
"copyURL": "复制链接",
"currentDeadline": "当前 DL",
Expand Down Expand Up @@ -137,5 +137,6 @@
"minersSharingLess": "矿工份额不到20%",
"languageName": "普通话",
"chooseLanguage": "选择语言",
"noBlocksWon": "没有赢得块,去拿它们!"
"noBlocksWon": "没有赢得块,去拿它们!",
"processing": "加工..."
}
1 change: 1 addition & 0 deletions react-pool/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
background-position: top center !important;
background-repeat: no-repeat !important;
background-size: 100% !important;
transition: all 0.1s ease-in !important;
}

/* Media queries, only used for myBody class */
Expand Down
11 changes: 10 additions & 1 deletion react-pool/src/components/UI/blocksTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const StickyHeadTable = (props) => {

// Pagination
const [page, setPage] = useState(0);
const [rowsPerPage, setRowsPerPage] = useState(isMobile ? 35 : 50);
const [rowsPerPage, setRowsPerPage] = useState(isMobile ? 50 : 100);

const handleChangePage = (event, newPage) => {
setPage(newPage);
Expand Down Expand Up @@ -160,6 +160,15 @@ const StickyHeadTable = (props) => {
{cellValue}
</Typography>
);
// Check if user is in Reward+fees or Pool Share Column
} else if (
column.id === "reward" ||
column.id === "poolShare"
) {
// Check if block is processing
if (cellContent === "Processing...") {
cellContent = t("processing");
}
}

return (
Expand Down
2 changes: 1 addition & 1 deletion react-pool/src/components/UI/minersTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const StickyHeadTable = (props) => {

// Pagination
const [page, setPage] = useState(0);
const [rowsPerPage, setRowsPerPage] = useState(50);
const [rowsPerPage, setRowsPerPage] = useState(isMobile ? 50 : 100);

const handleChangePage = (event, newPage) => {
setPage(newPage);
Expand Down
8 changes: 7 additions & 1 deletion react-pool/src/components/UI/outlinedTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";

// React translations
import { useTranslation } from "react-i18next";

// Styling
import styles from "./outlinedTable.module.css";

Expand All @@ -13,6 +16,9 @@ import Spinner from "../Spinner/index";
import MinerDeadLinesGraph from "../../miner/minerDeadlines/index";

const OutLinedTable = (props) => {
// Translations details
const { t } = useTranslation();

const { isLoading, data, notFoundLabel, onClickLastItem } = props;

let content = null;
Expand Down Expand Up @@ -77,7 +83,7 @@ const OutLinedTable = (props) => {
return (
<Grid item className={styles.tableItem} key={key}>
<Button className={styles.optionBtn} onClick={onClickLastItem}>
{item.label}
{t(item.label)}
</Button>
</Grid>
);
Expand Down
5 changes: 4 additions & 1 deletion react-pool/src/pages/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ const Home = (props) => {
let dataToRender = [];

bookMarkedMiner.data.map((item) => {
return dataToRender.push({ ...item, title: t(item.title) });
// Check if item exist
if (item && item !== null && item !== undefined) {
return dataToRender.push({ ...item, title: t(item.title) });
}
});

bookMinerData = dataToRender;
Expand Down
1 change: 1 addition & 0 deletions react-pool/src/pages/start-mining/StartMining.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
border-radius: 8px;
text-transform: none;
font-size: 0.9rem;
color: white !important;
}

/* Media queries */
Expand Down
5 changes: 4 additions & 1 deletion react-pool/src/utils/redux/actions/miners.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ export const selectBookmarkedMiner =

// Bookmarked Miners Data
const responseData = [
response.name && response.name.trim()
response.name &&
response.name !== null &&
response.name !== undefined &&
response.name.trim() !== ""
? { title: "username", value: response.name, type: "info" }
: null,
{
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/burst/pool/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static void main(String[] args) { // todo catch exception
// Set the default prefix
SignumUtils.setAddressPrefix(propertyService.getBoolean(Props.testnet) ? "TS" : "S");

MinerMaths minerMaths = new MinerMaths(propertyService.getInt(Props.nAvg) + propertyService.getInt(Props.processLag), propertyService.getInt(Props.nMin));
MinerMaths minerMaths = new MinerMaths(propertyService.getInt(Props.nAvg) + propertyService.getInt(Props.processLag),
propertyService.getInt(Props.nMin), propertyService.getInt(Props.graceDeadlines));
NodeService nodeService = NodeService.getUseBestInstance(true, Constants.USER_AGENT, propertyService.getStringList(Props.nodeAddresses));
StorageService storageService = null;
try {
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/burst/pool/miners/MinerMaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MinerMaths {
public static final long GENESIS_BASE_TARGET = 18325193796L;
private final double[] alphas;

public MinerMaths(int nAvg, int nMin) {
public MinerMaths(int nAvg, int nMin, int nGrace) {
alphas = new double[nAvg];
for (int i = 0; i < nAvg; i++) {
if (i < nMin-1) {
Expand All @@ -22,6 +22,9 @@ public MinerMaths(int nAvg, int nMin) {
}
}
alphas[nAvg-1] = 1d;
for (int i = 1; i <= nGrace; i++) {
alphas[nAvg - 1 - i] = 1d;
}
}

/**
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/burst/pool/storage/config/Props.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class Props {
public static final Prop<Integer> nMin = new Prop<>("nMin", 1); // Must be ?
public static final Prop<Long> maxDeadline = new Prop<>("maxDeadline", Long.MAX_VALUE); // Must be > 0
public static final Prop<Integer> processLag = new Prop<>("processLag", 10); // Must be > 0
public static final Prop<Integer> graceDeadlines = new Prop<>("graceDeadlines", 2); // Must be > 0
public static final Prop<Integer> pocPlusBlock = new Prop<>("pocPlusBlock", 878_000);

public static final Prop<SignumAddress> feeRecipient = new Prop<>("feeRecipient", null); // Must be non null
Expand Down Expand Up @@ -121,8 +122,13 @@ public static void validateProperties(PropertyService propertyService) {
}

int processLag = propertyService.getInt(Props.processLag);
if (processLag < 0) {
throw new IllegalArgumentException("Illegal processLag: " + processLag + " (Must be > 0)");
if (processLag < 1) {
throw new IllegalArgumentException("Illegal processLag: " + processLag + " (Must be > 1)");
}

int graceDeadlines = propertyService.getInt(Props.graceDeadlines);
if (graceDeadlines < 0) {
throw new IllegalArgumentException("Illegal graceDeadlines: " + graceDeadlines + " (Must be >= 0)");
}

SignumAddress feeRecipient = propertyService.getSignumAddress(Props.feeRecipient);
Expand Down

0 comments on commit 781b1b2

Please sign in to comment.