From 607317e3e76465ab9d50c242cc9474aacd20399c Mon Sep 17 00:00:00 2001 From: jjos2372 Date: Sun, 11 Jul 2021 22:03:20 -0300 Subject: [PATCH 1/6] Added a number of deadlines a miner can miss. --- dist/pool.properties | 3 +++ src/main/java/burst/pool/Launcher.java | 3 ++- src/main/java/burst/pool/miners/MinerMaths.java | 5 ++++- src/main/java/burst/pool/storage/config/Props.java | 10 ++++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/pool.properties b/dist/pool.properties index b4db0727..9a62e318 100644 --- a/dist/pool.properties +++ b/dist/pool.properties @@ -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 diff --git a/src/main/java/burst/pool/Launcher.java b/src/main/java/burst/pool/Launcher.java index ee91eb1a..74ffd5ce 100644 --- a/src/main/java/burst/pool/Launcher.java +++ b/src/main/java/burst/pool/Launcher.java @@ -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 { diff --git a/src/main/java/burst/pool/miners/MinerMaths.java b/src/main/java/burst/pool/miners/MinerMaths.java index 9318dcca..0566a3ec 100644 --- a/src/main/java/burst/pool/miners/MinerMaths.java +++ b/src/main/java/burst/pool/miners/MinerMaths.java @@ -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) { @@ -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; + } } /** diff --git a/src/main/java/burst/pool/storage/config/Props.java b/src/main/java/burst/pool/storage/config/Props.java index b2ca269b..92d00e9d 100644 --- a/src/main/java/burst/pool/storage/config/Props.java +++ b/src/main/java/burst/pool/storage/config/Props.java @@ -31,6 +31,7 @@ public class Props { public static final Prop nMin = new Prop<>("nMin", 1); // Must be ? public static final Prop maxDeadline = new Prop<>("maxDeadline", Long.MAX_VALUE); // Must be > 0 public static final Prop processLag = new Prop<>("processLag", 10); // Must be > 0 + public static final Prop graceDeadlines = new Prop<>("graceDeadlines", 2); // Must be > 0 public static final Prop pocPlusBlock = new Prop<>("pocPlusBlock", 878_000); public static final Prop feeRecipient = new Prop<>("feeRecipient", null); // Must be non null @@ -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); From 013ddd3ada27ac817276f3869ddecf9d0402c033 Mon Sep 17 00:00:00 2001 From: ipr0310 Date: Mon, 12 Jul 2021 06:51:44 -0400 Subject: [PATCH 2/6] Pagination updates --- react-pool/src/components/UI/blocksTable/index.js | 2 +- react-pool/src/components/UI/minersTable/index.js | 2 +- react-pool/src/pages/start-mining/StartMining.module.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/react-pool/src/components/UI/blocksTable/index.js b/react-pool/src/components/UI/blocksTable/index.js index fb9b2c39..dbce2a41 100644 --- a/react-pool/src/components/UI/blocksTable/index.js +++ b/react-pool/src/components/UI/blocksTable/index.js @@ -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); diff --git a/react-pool/src/components/UI/minersTable/index.js b/react-pool/src/components/UI/minersTable/index.js index a10fd216..ba8aed45 100644 --- a/react-pool/src/components/UI/minersTable/index.js +++ b/react-pool/src/components/UI/minersTable/index.js @@ -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); diff --git a/react-pool/src/pages/start-mining/StartMining.module.css b/react-pool/src/pages/start-mining/StartMining.module.css index f6a5acbe..0c1fd44a 100644 --- a/react-pool/src/pages/start-mining/StartMining.module.css +++ b/react-pool/src/pages/start-mining/StartMining.module.css @@ -63,6 +63,7 @@ border-radius: 8px; text-transform: none; font-size: 0.9rem; + color: white !important; } /* Media queries */ From 106abb3b06cfb5325d5f82db2a9f72917fe7a92a Mon Sep 17 00:00:00 2001 From: ipr0310 Date: Mon, 12 Jul 2021 07:32:15 -0400 Subject: [PATCH 3/6] Translation updates --- react-pool/public/assets/locales/de/translation.json | 3 ++- react-pool/public/assets/locales/en/translation.json | 1 + react-pool/public/assets/locales/es/translation.json | 3 ++- react-pool/public/assets/locales/fr/translation.json | 3 ++- react-pool/public/assets/locales/it/translation.json | 3 ++- react-pool/public/assets/locales/kr/translation.json | 1 + react-pool/public/assets/locales/nl/translation.json | 3 ++- react-pool/public/assets/locales/pl/translation.json | 3 ++- react-pool/public/assets/locales/pt/translation.json | 3 ++- react-pool/public/assets/locales/ru/translation.json | 3 ++- react-pool/public/assets/locales/tr/translation.json | 3 ++- react-pool/public/assets/locales/zh/translation.json | 5 +++-- react-pool/src/components/UI/blocksTable/index.js | 9 +++++++++ 13 files changed, 32 insertions(+), 11 deletions(-) diff --git a/react-pool/public/assets/locales/de/translation.json b/react-pool/public/assets/locales/de/translation.json index d12235cf..bf7b8de3 100644 --- a/react-pool/public/assets/locales/de/translation.json +++ b/react-pool/public/assets/locales/de/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/en/translation.json b/react-pool/public/assets/locales/en/translation.json index b1a4c282..eda9a8f8 100644 --- a/react-pool/public/assets/locales/en/translation.json +++ b/react-pool/public/assets/locales/en/translation.json @@ -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", diff --git a/react-pool/public/assets/locales/es/translation.json b/react-pool/public/assets/locales/es/translation.json index 138c45f9..c93c93f2 100644 --- a/react-pool/public/assets/locales/es/translation.json +++ b/react-pool/public/assets/locales/es/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/fr/translation.json b/react-pool/public/assets/locales/fr/translation.json index 45c4de37..939b2840 100644 --- a/react-pool/public/assets/locales/fr/translation.json +++ b/react-pool/public/assets/locales/fr/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/it/translation.json b/react-pool/public/assets/locales/it/translation.json index e7833fde..1bdc2151 100644 --- a/react-pool/public/assets/locales/it/translation.json +++ b/react-pool/public/assets/locales/it/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/kr/translation.json b/react-pool/public/assets/locales/kr/translation.json index faeee739..e9e213e9 100644 --- a/react-pool/public/assets/locales/kr/translation.json +++ b/react-pool/public/assets/locales/kr/translation.json @@ -21,6 +21,7 @@ "signatureS": "매니아 매니아를위한", "waiting": "기다리는...", "loading": "로드 중 ...", + "processing": "처리 중 ...", "updateYourMiner": "알 수 없음, 광부를 업데이트하십시오.", "viewMinerDetails": "광부 세부 정보보기", "viewMinerInExplorer": "탐색기에서 광부보기", diff --git a/react-pool/public/assets/locales/nl/translation.json b/react-pool/public/assets/locales/nl/translation.json index 2e067d1e..217b087a 100644 --- a/react-pool/public/assets/locales/nl/translation.json +++ b/react-pool/public/assets/locales/nl/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/pl/translation.json b/react-pool/public/assets/locales/pl/translation.json index 54accf49..bad494d6 100644 --- a/react-pool/public/assets/locales/pl/translation.json +++ b/react-pool/public/assets/locales/pl/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/pt/translation.json b/react-pool/public/assets/locales/pt/translation.json index 48679f80..95354da0 100644 --- a/react-pool/public/assets/locales/pt/translation.json +++ b/react-pool/public/assets/locales/pt/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/ru/translation.json b/react-pool/public/assets/locales/ru/translation.json index c3adff55..bc2100a1 100644 --- a/react-pool/public/assets/locales/ru/translation.json +++ b/react-pool/public/assets/locales/ru/translation.json @@ -137,5 +137,6 @@ "minersSharingLess": "Майнеры делят менее 20%", "languageName": "русский", "chooseLanguage": "Выберите язык", - "noBlocksWon": "Нет выигранных блоков, идите и возьмите их!" + "noBlocksWon": "Нет выигранных блоков, идите и возьмите их!", + "processing": "Обработка..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/tr/translation.json b/react-pool/public/assets/locales/tr/translation.json index ba18d022..7dfa0538 100644 --- a/react-pool/public/assets/locales/tr/translation.json +++ b/react-pool/public/assets/locales/tr/translation.json @@ -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..." } \ No newline at end of file diff --git a/react-pool/public/assets/locales/zh/translation.json b/react-pool/public/assets/locales/zh/translation.json index c1d7001e..3910df6f 100644 --- a/react-pool/public/assets/locales/zh/translation.json +++ b/react-pool/public/assets/locales/zh/translation.json @@ -28,7 +28,7 @@ "commitmentTiB": "抵押/TiB", "committedBalance": "抵押金额", "configurationWithMessages": "消息配置", - "configurationWithMessagesParagraph": "如果您已经加入了池,您可以通过<1>从miner帐户向矿池帐户发送未加密的文本消息来进一步配置它(在{processLag}}之后生效):", + "configurationWithMessagesParagraph": "如果您已经加入了池,您可以通过<1>从miner帐户向矿池帐户发送未加密的文本消息来进一步配置它(在{processLag}}之后生效):", "confirmedDeadline": "已确认DL", "copyURL": "复制链接", "currentDeadline": "当前 DL", @@ -137,5 +137,6 @@ "minersSharingLess": "矿工份额不到20%", "languageName": "普通话", "chooseLanguage": "选择语言", - "noBlocksWon": "没有赢得块,去拿它们!" + "noBlocksWon": "没有赢得块,去拿它们!", + "processing": "加工..." } \ No newline at end of file diff --git a/react-pool/src/components/UI/blocksTable/index.js b/react-pool/src/components/UI/blocksTable/index.js index dbce2a41..7e482528 100644 --- a/react-pool/src/components/UI/blocksTable/index.js +++ b/react-pool/src/components/UI/blocksTable/index.js @@ -160,6 +160,15 @@ const StickyHeadTable = (props) => { {cellValue} ); + // 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 ( From 923d7715820450c85f596020766f0e9ec28ec654 Mon Sep 17 00:00:00 2001 From: ipr0310 Date: Mon, 12 Jul 2021 08:27:35 -0400 Subject: [PATCH 4/6] Delete bookmark button translation --- react-pool/src/components/UI/outlinedTable/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/react-pool/src/components/UI/outlinedTable/index.js b/react-pool/src/components/UI/outlinedTable/index.js index 93de2286..3aaa204d 100644 --- a/react-pool/src/components/UI/outlinedTable/index.js +++ b/react-pool/src/components/UI/outlinedTable/index.js @@ -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"; @@ -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; @@ -77,7 +83,7 @@ const OutLinedTable = (props) => { return ( ); From 892d8055a23f9121fbed0e5d057900c3c59405ae Mon Sep 17 00:00:00 2001 From: ipr0310 Date: Mon, 12 Jul 2021 08:55:20 -0400 Subject: [PATCH 5/6] Bookmarked miner, username bug --- react-pool/public/index.html | 1 + react-pool/src/pages/home/index.js | 5 ++++- react-pool/src/utils/redux/actions/miners.js | 5 ++++- react-pool/src/utils/redux/store.js | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/react-pool/public/index.html b/react-pool/public/index.html index 8c7293d7..6db4febb 100644 --- a/react-pool/public/index.html +++ b/react-pool/public/index.html @@ -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 */ diff --git a/react-pool/src/pages/home/index.js b/react-pool/src/pages/home/index.js index 6e8f150c..ae213656 100644 --- a/react-pool/src/pages/home/index.js +++ b/react-pool/src/pages/home/index.js @@ -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; diff --git a/react-pool/src/utils/redux/actions/miners.js b/react-pool/src/utils/redux/actions/miners.js index 5a0a2014..06b65d71 100644 --- a/react-pool/src/utils/redux/actions/miners.js +++ b/react-pool/src/utils/redux/actions/miners.js @@ -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, { diff --git a/react-pool/src/utils/redux/store.js b/react-pool/src/utils/redux/store.js index b277ff4e..eb40a212 100644 --- a/react-pool/src/utils/redux/store.js +++ b/react-pool/src/utils/redux/store.js @@ -5,7 +5,7 @@ import thunk from "redux-thunk"; import rootReducer from "./reducers/index"; // Only use this module in dev mode -// import { composeWithDevTools } from "redux-devtools-extension/developmentOnly"; +import { composeWithDevTools } from "redux-devtools-extension/developmentOnly"; const initialState = {}; @@ -16,10 +16,10 @@ const store = createStore( initialState, // Only use this module in production mode - applyMiddleware(...middleware) + // applyMiddleware(...middleware) // Only use this module in dev mode - // composeWithDevTools(applyMiddleware(...middleware)) + composeWithDevTools(applyMiddleware(...middleware)) ); export default store; From 6aaca293be1f1ea4aa2f0b463a54e57a21f6f5cf Mon Sep 17 00:00:00 2001 From: ipr0310 Date: Mon, 12 Jul 2021 08:57:06 -0400 Subject: [PATCH 6/6] Redux update --- react-pool/src/utils/redux/store.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-pool/src/utils/redux/store.js b/react-pool/src/utils/redux/store.js index eb40a212..b277ff4e 100644 --- a/react-pool/src/utils/redux/store.js +++ b/react-pool/src/utils/redux/store.js @@ -5,7 +5,7 @@ import thunk from "redux-thunk"; import rootReducer from "./reducers/index"; // Only use this module in dev mode -import { composeWithDevTools } from "redux-devtools-extension/developmentOnly"; +// import { composeWithDevTools } from "redux-devtools-extension/developmentOnly"; const initialState = {}; @@ -16,10 +16,10 @@ const store = createStore( initialState, // Only use this module in production mode - // applyMiddleware(...middleware) + applyMiddleware(...middleware) // Only use this module in dev mode - composeWithDevTools(applyMiddleware(...middleware)) + // composeWithDevTools(applyMiddleware(...middleware)) ); export default store;