benjamin-wilson / public-pool

GNU General Public License v3.0
197 stars 57 forks source link

Duplicate shares #50

Closed Retropex closed 3 months ago

Retropex commented 3 months ago
QueryFailedError: SQLITE_ERROR: no such column: NaN
    at handler (/home/leo/public-pool/src/driver/sqlite/SqliteQueryRunner.ts:113:26)
    at Statement.errBack (/home/leo/public-pool/node_modules/sqlite3/lib/sqlite3.js:15:21) {
  query: 'UPDATE "client_entity" SET "hashRate" = NaN, "deletedAt" = ?, "updatedAt" = ? WHERE ("address" = ? AND "clientName" = ? AND "sessionId" = ?)',
  parameters: [
    undefined,
    '0NaN-aN-aN aN:aN:aN.NaN',
    'tb1**********************',
    'worker',
    'a25199b4'
  ],
  driverError: [Error: SQLITE_ERROR: no such column: NaN] {
    errno: 1,
    code: 'SQLITE_ERROR'
  },
  errno: 1,
  code: 'SQLITE_ERROR'
}
{"id":48,"result":null,"error":[22,"Duplicate share",""]}

getting duplicate share on testnet4 with a bitaxe ultra

benjamin-wilson commented 3 months ago

I'm not exactly sure how this code path was achieved but the underlying issue has been fixed by initializing hashrate to 0. https://github.com/benjamin-wilson/public-pool/commit/de2b41a3c1a98a328ef056bdfd1f7d7c6abb57c0

Retropex commented 3 months ago

Still getting it:

image

It also seems to not only be duplicate share bug but also discard valid share since the best difficulty miss match on the pool UI and bitaxe UI.

image image
benjamin-wilson commented 3 months ago

Does this only happen on testnet4?

Retropex commented 3 months ago

yes, it seems to work normally on mainnet:

image image
benjamin-wilson commented 3 months ago

Ah ok, I haven't tested it with testnet4 and is likely the problem. I'm going to close these issues and make a single one for that.