btccom / btcpool-ABANDONED

backend of pool.btc.com
https://pool.btc.com
MIT License
644 stars 408 forks source link

当找到solvedshare,ckb的nodebridge报错 #408

Closed loloxiao closed 4 years ago

loloxiao commented 4 years ago

nodebridge能正常向ckb节点提交share,但同时也报错 ERROR nodebridge::ckb] Failed to execute query: Server error: `ERROR 22001 (1406): Data too long for column 'nonce' at row 1', retrying

duguyifang commented 4 years ago

这个问题是由于nonce字段的长度不够导致的。需要扩展nonce字段长度到66字节。

SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP TABLE IF EXISTS `found_blocks`;
CREATE TABLE `found_blocks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `puid` int(11) NOT NULL,
  `worker_id` bigint(20) NOT NULL,
  `worker_full_name` varchar(50) NOT NULL,
  `height` int(11) NOT NULL,
  `is_orphaned` tinyint(4) NOT NULL DEFAULT '0',
  `is_uncle` tinyint(4) NOT NULL DEFAULT '0',
  `ref_uncles` varchar(255) NOT NULL DEFAULT '',
  `hash` char(66) NOT NULL DEFAULT '',
  `hash_no_nonce` char(66) NOT NULL,
  `nonce` char(66) NOT NULL,
  `rewards` decimal(35,0) DEFAULT NULL,
  `size` int(11) NOT NULL DEFAULT '0',
  `prev_hash` char(66) NOT NULL DEFAULT '',
  `network_diff` bigint(20) unsigned NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `rpc_error` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `hash` (`hash`),
  KEY `height` (`height`),
  UNIQUE KEY `unique_block`(`hash_no_nonce`,`nonce`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
lixinyuan1213 commented 4 years ago

nodebridge能正常向ckb节点提交share,但同时也报错 ERROR nodebridge::ckb] Failed to execute query: Server error: `ERROR 22001 (1406): Data too long for column 'nonce' at row 1', retrying

可以贴一下您提交到ckb节点提交的share的结构吗?我们一直没有提交成功,提交的结构是这样的{"job_id":1,"pow_hash":"0x6f13f5f674db8e3c88681f6aaa02c6602fe641d0bf03b676301075f64cc94257","work_id":240,"height":137989,"target":"0xe612180000000000000000000000000000000000000000000000000000","timestamp":1577263444247,"nonce":"9ed51bb95abf795ae22278c3fb315b88","userId":1,"workerId":11,"workerFullName":"ffffff"}