diff --git a/internal/gui/assets/templates/index.html b/internal/gui/assets/templates/index.html
index 59b32233..7eb8e04d 100644
--- a/internal/gui/assets/templates/index.html
+++ b/internal/gui/assets/templates/index.html
@@ -58,14 +58,12 @@
Identify the Miner
-
The pool currently supports the miners and their associated linked firmwares listed
- below:
+
The pool currently supports the miners below:
diff --git a/pool/client.go b/pool/client.go
index 8c8f757a..6a2cb1e0 100644
--- a/pool/client.go
+++ b/pool/client.go
@@ -413,13 +413,6 @@ func (c *Client) handleSubscribeRequest(req *Request, allowed bool) error {
var resp *Response
switch miner {
- case ObeliskDCR1:
- // The DCR1 is not fully complaint with the stratum spec.
- // It uses a 4-byte extraNonce2 regardless of the
- // extraNonce2Size provided.
- resp = SubscribeResponse(*req.ID, nid, c.extraNonce1,
- ExtraNonce2Size, nil)
-
default:
// The default case handles mining clients that support the
// stratum spec and respect the extraNonce2Size provided.
@@ -880,35 +873,6 @@ func (c *Client) process() {
}
}
-// reversePrevBlockWords reverses each 4-byte word in the provided hex encoded
-// previous block hash.
-func reversePrevBlockWords(hashE string) string {
- var buf bytes.Buffer
- for i := 0; i < len(hashE); i += 8 {
- _, _ = buf.WriteString(hashE[i+6 : i+8])
- _, _ = buf.WriteString(hashE[i+4 : i+6])
- _, _ = buf.WriteString(hashE[i+2 : i+4])
- _, _ = buf.WriteString(hashE[i : i+2])
- }
- return buf.String()
-}
-
-// hexReversed reverses a hex string.
-func hexReversed(in string) (string, error) {
- const funcName = "hexReversed"
- if len(in)%2 != 0 {
- desc := fmt.Sprintf("%s: expected even hex input length, got %d",
- funcName, len(in))
- return "", errs.PoolError(errs.HexLength, desc)
- }
- var buf bytes.Buffer
- for i := len(in) - 1; i > -1; i -= 2 {
- _ = buf.WriteByte(in[i-1])
- _ = buf.WriteByte(in[i])
- }
- return buf.String(), nil
-}
-
// handleCPUWork prepares work for the cpu miner.
func (c *Client) handleCPUWork(req *Request) {
const miner = "CPU"
@@ -922,43 +886,6 @@ func (c *Client) handleCPUWork(req *Request) {
atomic.StoreInt64(&c.lastWorkTime, time.Now().Unix())
}
-// handleObeliskDCR1Work prepares work for the Obelisk DCR1.
-func (c *Client) handleObeliskDCR1Work(req *Request) {
- miner := "ObeliskDCR1"
- jobID, prevBlock, genTx1, genTx2, blockVersion, nBits, nTime,
- cleanJob, err := ParseWorkNotification(req)
- if err != nil {
- log.Errorf("%s: %v", miner, err)
- }
-
- // The DCR1 requires the nBits and nTime fields of a mining.notify message
- // as big endian.
- nBits, err = hexReversed(nBits)
- if err != nil {
- log.Errorf("%s: %v for nBits", miner, err)
- c.cancel()
- return
- }
- nTime, err = hexReversed(nTime)
- if err != nil {
- log.Errorf("%s: %v for nTime", miner, err)
- c.cancel()
- return
- }
-
- prevBlockRev := reversePrevBlockWords(prevBlock)
- workNotif := WorkNotification(jobID, prevBlockRev,
- genTx1, genTx2, blockVersion, nBits, nTime, cleanJob)
- err = c.encoder.Encode(workNotif)
- if err != nil {
- log.Errorf("%s: work encoding error, %v", miner, err)
- c.cancel()
- return
- }
-
- atomic.StoreInt64(&c.lastWorkTime, time.Now().Unix())
-}
-
// setHashRate updates the client's hash rate.
func (c *Client) setHashRate(hash *big.Rat) {
c.hashRateMtx.Lock()
@@ -1125,10 +1052,6 @@ func (c *Client) send() {
c.handleCPUWork(req)
log.Tracef("%s notified of new work", id)
- case ObeliskDCR1:
- c.handleObeliskDCR1Work(req)
- log.Tracef("%s notified of new work", id)
-
default:
log.Errorf("unknown miner for client: %s, "+
"message: %s", miner, req.String())
diff --git a/pool/client_test.go b/pool/client_test.go
index 93b31c94..ee20aa3d 100644
--- a/pool/client_test.go
+++ b/pool/client_test.go
@@ -6,7 +6,6 @@ package pool
import (
"bufio"
- "bytes"
"context"
"encoding/json"
"errors"
@@ -375,43 +374,6 @@ func testClientMessageHandling(t *testing.T) {
t.Fatalf("expected %s message method, got %s", SetDifficulty, req.Method)
}
- // Ensure an Obelisk DCR1 client receives a valid non-error
- // response when a valid subscribe request is sent.
- err = setMiner(client, ObeliskDCR1)
- if err != nil {
- t.Fatalf("unexpected set miner error: %v", err)
- }
-
- id++
- dcr1, dcr1Version := splitMinerID(dcr1ID)
- r = SubscribeRequest(&id, userAgent(dcr1, dcr1Version), "")
- err = sE.Encode(r)
- if err != nil {
- t.Fatalf("[Encode] unexpected error: %v", err)
- }
- select {
- case <-client.ctx.Done():
- t.Fatalf("client context done: %v", err)
- case data = <-recvCh:
- }
- msg, mType, err = IdentifyMessage(data)
- if err != nil {
- t.Fatalf("[IdentifyMessage] unexpected error: %v", err)
- }
- if mType != ResponseMessage {
- t.Fatalf("expected a subscribe response message, got %v", mType)
- }
- resp, ok = msg.(*Response)
- if !ok {
- t.Fatalf("expected subsribe response with id %d, got %d", *r.ID, resp.ID)
- }
- if resp.ID != *r.ID {
- t.Fatalf("expected subscribe response with id %d, got %d", *r.ID, resp.ID)
- }
- if resp.Error != nil {
- t.Fatalf("expected a non-error response, got %s", resp.Error.Message)
- }
-
// Ensure a CPU client receives a valid non-error response when a
// valid subscribe request is sent.
err = setMiner(client, CPU)
@@ -544,35 +506,6 @@ func testClientMessageHandling(t *testing.T) {
client.lastWorkTime)
}
- // Send a work notification to an Obelisk DCR1 client.
- err = setMiner(client, ObeliskDCR1)
- if err != nil {
- t.Fatalf("unexpected set miner error: %v", err)
- }
-
- select {
- case <-client.ctx.Done():
- t.Fatalf("client context done: %v", err)
- case client.ch <- r:
- }
-
- // Ensure the work notification received is unique to the DCR1.
- var dcr1Work []byte
- select {
- case <-client.ctx.Done():
- t.Fatalf("client context done: %v", err)
- case dcr1Work = <-recvCh:
- }
- if bytes.Equal(cpuWork, dcr1Work) {
- t.Fatalf("expected obelisk DCR1 work to be different from cpu work")
- }
-
- // Claim a weighted share for the Obelisk DCR1.
- err = client.claimWeightedShare()
- if err != nil {
- t.Fatalf("[claimWeightedShare (DCR1)] unexpected error: %v", err)
- }
-
// Ensure a CPU client receives an error response when
// a malformed work submission is sent.
err = setMiner(client, CPU)
@@ -872,40 +805,6 @@ func testClientMessageHandling(t *testing.T) {
t.Fatalf("expected no-error work submission response, got %v", resp.Error)
}
- // Ensure the pool processes Obelisk DCR1 work submissions.
- err = setMiner(client, ObeliskDCR1)
- if err != nil {
- t.Fatalf("unexpected set miner error: %v", err)
- }
-
- id++
- sub = SubmitWorkRequest(&id, "tcl", job.UUID, "00000000",
- "954cee5d", "6ddf0200")
- err = sE.Encode(sub)
- if err != nil {
- t.Fatalf("[Encode] unexpected error: %v", err)
- }
- var dcr1Sub []byte
- select {
- case <-client.ctx.Done():
- t.Fatalf("client context done: %v", err)
- case dcr1Sub = <-recvCh:
- }
- msg, mType, err = IdentifyMessage(dcr1Sub)
- if err != nil {
- t.Fatalf("[IdentifyMessage] unexpected error: %v", err)
- }
- if mType != ResponseMessage {
- t.Fatalf("expected a response message, got %v", mType)
- }
- resp, ok = msg.(*Response)
- if !ok {
- t.Fatalf("unable to cast message as response")
- }
- if resp.ID != *sub.ID {
- t.Fatalf("expected a response with id %d, got %d", *sub.ID, resp.ID)
- }
-
// Ensure the client gets terminated if it sends an unknown message type.
id++
r = &Request{
diff --git a/pool/difficulty.go b/pool/difficulty.go
index bf1c6a76..e17100d5 100644
--- a/pool/difficulty.go
+++ b/pool/difficulty.go
@@ -19,7 +19,6 @@ import (
// Supported mining clients.
const (
CPU = "cpu"
- ObeliskDCR1 = "obeliskdcr1"
NiceHashValidator = "nicehash"
)
@@ -28,7 +27,6 @@ var (
// corresponding hash rates.
minerHashes = map[string]*big.Int{
CPU: new(big.Int).SetInt64(5e3),
- ObeliskDCR1: new(big.Int).SetInt64(1.2e12),
NiceHashValidator: new(big.Int).SetInt64(20e10),
}
)
diff --git a/pool/hashdata_test.go b/pool/hashdata_test.go
index 8d5bed19..69e87571 100644
--- a/pool/hashdata_test.go
+++ b/pool/hashdata_test.go
@@ -14,7 +14,7 @@ import (
)
func testHashData(t *testing.T) {
- miner := ObeliskDCR1
+ const miner = CPU
extraNonce1 := "ca750c60"
ip := "127.0.0.1:5550"
now := time.Now()
diff --git a/pool/message.go b/pool/message.go
index f7dae635..b42cbe79 100644
--- a/pool/message.go
+++ b/pool/message.go
@@ -604,28 +604,6 @@ func GenerateSolvedBlockHeader(headerE string, extraNonce1E string,
copy(headerEB[288:296], []byte(extraNonce1E))
copy(headerEB[296:304], []byte(extraNonce2E))
- // The Obelisk DCR1 does not respect the extraNonce2Size specified in the
- // mining.subscribe response sent to it. It returns a 4-byte extraNonce2
- // regardless of the extraNonce2Size provided.
- // The extraNonce2 value submitted is exclusively the extraNonce2.
- // The nTime and nonce values submitted are big endian, they have to
- // be reversed to little endian before header reconstruction.
- case ObeliskDCR1:
- nTimeERev, err := hexReversed(nTimeE)
- if err != nil {
- return nil, err
- }
- copy(headerEB[272:280], []byte(nTimeERev))
-
- nonceERev, err := hexReversed(nonceE)
- if err != nil {
- return nil, err
- }
- copy(headerEB[280:288], []byte(nonceERev))
-
- copy(headerEB[288:296], []byte(extraNonce1E))
- copy(headerEB[296:304], []byte(extraNonce2E))
-
default:
desc := fmt.Sprintf("miner %s is unknown", miner)
return nil, errs.MsgError(errs.MinerUnknown, desc)
diff --git a/pool/miner_id.go b/pool/miner_id.go
index 8b9dcd5e..536c79c3 100644
--- a/pool/miner_id.go
+++ b/pool/miner_id.go
@@ -14,9 +14,8 @@ var (
// These miner ids represent the expected identifications returned by
// supported miners in their mining.subscribe requests.
- cpuID = "cpuminer/1.0.0"
- dcr1ID = "cgminer/4.10.0"
- nhID = "NiceHash/1.0.0"
+ cpuID = "cpuminer/1.0.0"
+ nhID = "NiceHash/1.0.0"
)
// minerIDPair represents miner subscription identification pairing
@@ -43,11 +42,9 @@ func newMinerIDPair(id string, miners ...string) *minerIDPair {
func generateMinerIDs() map[string]*minerIDPair {
ids := make(map[string]*minerIDPair)
cpu := newMinerIDPair(cpuID, CPU)
- obelisk := newMinerIDPair(dcr1ID, ObeliskDCR1)
nicehash := newMinerIDPair(nhID, NiceHashValidator)
ids[cpu.id] = cpu
- ids[obelisk.id] = obelisk
ids[nicehash.id] = nicehash
return ids
}
diff --git a/pool/share.go b/pool/share.go
index 87b9c4b0..f4606abf 100644
--- a/pool/share.go
+++ b/pool/share.go
@@ -18,8 +18,7 @@ import (
//
// (Hash of Miner X * Weight of LHM)/ Hash of LHM
var ShareWeights = map[string]*big.Rat{
- CPU: new(big.Rat).SetFloat64(1.0), // Reserved for testing.
- ObeliskDCR1: new(big.Rat).SetFloat64(1.0),
+ CPU: new(big.Rat).SetFloat64(1.0), // Reserved for testing.
}
// shareID generates a unique share id using the provided account, creation