diff --git a/public/_head.html b/public/_head.html index 30fdff9..f7f6338 100644 --- a/public/_head.html +++ b/public/_head.html @@ -30,6 +30,9 @@ if (params.get("apiToken")) { localStorage.setItem("apiToken", params.get("apiToken")); } + if (params.get("devmode")) { + localStorage.setItem("devmode", params.get("devmode")); + } ORC_AUTH_TOKEN = localStorage.getItem("apiToken"); {{end}} diff --git a/public/js/tabulator.js b/public/js/tabulator.js index 08d2777..bf897a5 100644 --- a/public/js/tabulator.js +++ b/public/js/tabulator.js @@ -266,6 +266,11 @@ const minipoolsDef = { if (data.ggpSlashAmt > 0) { row.getElement().style.backgroundColor = "#ff0000bf"; } + if (data.blsPubkeyAndSig === "0x") { + if (/y|1/.test(window.localStorage.getItem("devmode"))) { + row.getElement().style.backgroundColor = "#e0dd06"; + } + } }, columns: [ { width: 20, formatter: "responsiveCollapse", headerSort: false }, @@ -398,6 +403,18 @@ const minipoolsDef = { minWidth: 5000, responsive: 9, }, + { + title: "BLSPubkey", + field: "blsPubkey", + minWidth: 5000, + responsive: 9, + }, + { + title: "BLSSig", + field: "blsSig", + minWidth: 5000, + responsive: 9, + }, { title: "Snowtrace", field: "owner", diff --git a/public/js/transformers.js b/public/js/transformers.js index 8f4e641..969fefe 100644 --- a/public/js/transformers.js +++ b/public/js/transformers.js @@ -1,4 +1,5 @@ import { pipeAsyncFunctions, formatters, bigToNumber, unfuckEthersObj } from "/js/utils.js"; +import { utils as ethersUtils } from "https://esm.sh/ethers@5.7.2"; // process each obj through a pipeline of fns async function transformer(fns, objs) { @@ -8,11 +9,25 @@ async function transformer(fns, objs) { return xobjs; } +function decodeBLS(blob) { + let data; + try { + data = ethersUtils.defaultAbiCoder.decode(["bytes", "bytes"], blob); + } catch (err) { + console.log("error decoding BLS", blob); + data = [null, null]; + } + return data; +} + async function fixupMinipool(obj) { obj.nodeAddr = obj.nodeID; obj.nodeID = await formatters.nodeAddrToId(obj.nodeAddr); obj.status = formatters.formatMPStatus(obj.status); obj.txID = await formatters.toCB58(obj.txID); + const blob = decodeBLS(obj.blsPubkeyAndSig); + obj.blsPubkey = blob[0]; + obj.blsSig = blob[1]; obj.errorCode = formatters.formatErrorMsg(obj.errorCode);