Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Dev] Feathercoin - P2Pool-Neoscrypt - Now Available

    Technical Development
    8
    88
    68273
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ghostlander
      ghostlander Regular Member last edited by

      Disable submitblock and let it use getblocktemplate to return block data. There is also getblockex, but it seems deprecated and unsupported now.

      1 Reply Last reply Reply Quote 0
      • lizhi
        lizhi last edited by

        Thank wrapper, I think I fixed the problem.

        fix .feathercoin/feathercoin.conf

        rpcuser=ftcpool
        rpcpassword=6qXvFmctiX6pM1Bm5QPs8tEv7Th2R5HHKK
        daemon=1
        server=1
        rpcport=19337
        port=19336
        

        Miner4.jpg

        start p2pool:

        python run_p2pool.py --net feathercoin --testnet  --feathercoind-p2p-port 19336 --feathercoind-rpc-port 19337 ftcpool 6qXvFmctiX6pM1Bm5QPs8tEv7Th2R5HHKK
        

        miner command:

        minerd -o http://pool.ftc-c.com:19327 -u ftcpool -p 123 -a neoscrypt

        1 Reply Last reply Reply Quote 0
        • lizhi
          lizhi last edited by

          A new problem. It will not work in mining three minutes later.

          after three minutes , Minerd.exe stop .

          some error information in p2pool log:

          2014-08-03 20:01:29.794448 > ---  ---
          2014-08-03 20:01:29.794660 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
          2014-08-03 20:01:29.794859 >     result = g.send(result)
          2014-08-03 20:01:29.795101 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/web.py", line 189, in render_GET
          2014-08-03 20:01:29.795300 >     res = yield self.func(*self.args)
          2014-08-03 20:01:29.795506 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/web.py", line 194, in 
          2014-08-03 20:01:29.795714 >     web_root.putChild('rate', WebInterface(lambda: p2pool_data.get_pool_attempts_per_second(node.tracker, node.best_share_var.value, decent_height())/(1-p2pool_data.get_average_stale_prop(node.tracker, node.best_share_var.value, decent_height()))))
          2014-08-03 20:01:29.795933 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/data.py", line 547, in get_pool_attempts_per_second
          2014-08-03 20:01:29.796147 >     assert dist >= 2
          2014-08-03 20:01:29.796346 > exceptions.AssertionError: 
          2014-08-03 20:01:37.216029 P2Pool: 0 shares in chain (0 verified/0 total) Peers: 0 (0 incoming)
          2014-08-03 20:01:37.216498  Local: 1388H/s in last 10.0 minutes Local dead on arrival: ~0.3% (0-2%) Expected time to share: 48.2 minutes
          2014-08-03 20:01:39.807271 > Error in DeferredResource handler:
          2014-08-03 20:01:39.807743 > Traceback (most recent call last):
          2014-08-03 20:01:39.808046 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/util/deferred_resource.py", line 24, in render
          2014-08-03 20:01:39.808327 >     defer.maybeDeferred(resource.Resource.render, self, request).addCallbacks(finish, finish_error)
          2014-08-03 20:01:39.808621 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 134, in maybeDeferred
          2014-08-03 20:01:39.808927 >     result = f(*args, **kw)
          2014-08-03 20:01:39.809153 >   File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
          2014-08-03 20:01:39.809357 >     return m(request)
          2014-08-03 20:01:39.809557 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
          2014-08-03 20:01:39.809813 >     return _inlineCallbacks(None, gen, Deferred())
          2014-08-03 20:01:39.810029 > ---  ---
          2014-08-03 20:01:39.810288 >   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
          2014-08-03 20:01:39.810492 >     result = g.send(result)
          2014-08-03 20:01:39.810693 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/web.py", line 189, in render_GET
          2014-08-03 20:01:39.810938 >     res = yield self.func(*self.args)
          2014-08-03 20:01:39.811144 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/web.py", line 194, in 
          2014-08-03 20:01:39.811350 >     web_root.putChild('rate', WebInterface(lambda: p2pool_data.get_pool_attempts_per_second(node.tracker, node.best_share_var.value, decent_height())/(1-p2pool_data.get_average_stale_prop(node.tracker, node.best_share_var.value, decent_height()))))
          2014-08-03 20:01:39.811594 >   File "/data/ftcc/p2pool-neoscrypt/p2pool/data.py", line 547, in get_pool_attempts_per_second
          2014-08-03 20:01:39.811815 >     assert dist >= 2
          2014-08-03 20:01:39.812024 > exceptions.AssertionError:
          
          1 Reply Last reply Reply Quote 0
          • Wellenreiter
            Wellenreiter Moderators last edited by

            Lizhi, the errors regarding webroot.putchild are normal as long as no other p2pool node has a worker connected. It simply can’t determine the global pool hash rate.

            To give an update on my tests:

            1. neoscrypt module for p2pool installed in python with profile 0

            2. used ghostlanders neoscrypt p2pool as basis and added the feathercoin infos in networks.py and bitcoin/networks.py

            3. forced the pool to use getblocktemplate, as suggested by ghostlander

            4. current log shows:

              2014-08-05 19:06:05.383892 Worker mrKP5thmnTRxV2Em8x3d8pamPXWHtv2Ed submitted share with hash > target:
              2014-08-05 19:06:05.384129 Hash:   67146109f860500455e07f9c06a298ec2bd85202c42c18bd0bd63bf0cb059a5e
              2014-08-05 19:06:05.384219 Target: a6c64b37894160e5d022dbf97e6abc74931804560e2db29defa7c64b378941

            5. implemented reversebyte to change from big endian to little endian for target.

            this changes the target, but as the Pow_hash has 2 bytes more than the target, it is always bigger than the target.

            I noticed, that Ghoslander has aa pcx p2pool running on his testnet, which is on neoscrypt, so I send him a message to ask what he has modified to get it running.

            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

            1 Reply Last reply Reply Quote 0
            • Wellenreiter
              Wellenreiter Moderators last edited by

              new commit on github, including reversebyte.py, which was missing.

              Still not working

              Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
              Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

              1 Reply Last reply Reply Quote 0
              • wrapper
                wrapper Moderators last edited by

                Great work guys!

                1 Reply Last reply Reply Quote 0
                • lizhi
                  lizhi last edited by

                  oh, it not work :-

                  1 Reply Last reply Reply Quote 0
                  • Wellenreiter
                    Wellenreiter Moderators last edited by

                    I spend half a day on the p2pool stuff again
                    no results
                    what I noticed is, that the p2pool neoscrypt module produces wrong results while the same code runs fine in the wallet, so it may be ‘just’ a problem of function calls and parameter transfer between python and C++.

                    also if I read it right, the Wallet code passes variables to the neoscrypt procedure, as in GetPowHash() in main.h, while the python passes pointer to structures??

                    Eample from wallet main.h:

                    /* Calculates block proof-of-work hash using either NeoScrypt or Scrypt */
                    uint256 GetPoWHash() const {
                    unsigned int profile = 0x0;
                    uint256 hash;
                    
                    /* All blocks generated up to this time point are Scrypt only */
                    if((fTestNet && (nTime < nTestnetSwitchV2)) ||
                    (!fTestNet && (nTime < nSwitchV2))) {
                    profile = 0x3;
                    } else {
                    /* All these blocks must be v2+ with valid nHeight */
                    int nHeight = GetBlockHeight();
                    if(fTestNet) {
                    if(nHeight < nTestnetFork)
                    profile = 0x3;
                    } else {
                    if(nHeight < nForkFour)
                    profile = 0x3;
                    }
                    }
                    
                    neoscrypt((unsigned char *) &nVersion, (unsigned char *) &hash, profile);
                    
                    return hash;
                    } 
                    

                    Example from p2pool/work.py:

                     
                    pow_hash = self.node.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(header))
                    

                    Where header is a dict in python.

                    Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                    Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                    1 Reply Last reply Reply Quote 0
                    • U
                      uncle_muddy administrators last edited by

                      Wellen,

                      I’m at the same point as you now :(

                      I get everything looking like it’s running well but nothing is accepted by the wallet, I’ll keep pluggin away but I’m some what in the dark here as my coding skills are limited in this area :(

                      UM

                      1 Reply Last reply Reply Quote 1
                      • Wellenreiter
                        Wellenreiter Moderators last edited by

                        The miner says ’ hash accepted’ , but in the p2pool log you will see entries like ‘worker xyz submitted share with hash > target’

                        Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                        Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                        1 Reply Last reply Reply Quote 1
                        • lizhi
                          lizhi last edited by

                          I spend half a day on the p2pool stuff again
                          no results
                          what I noticed is, that the p2pool neoscrypt module produces wrong results while the same code runs fine in the wallet, so it may be ‘just’ a problem of function calls and parameter transfer between python and C++.

                          also if I read it right, the Wallet code passes variables to the neoscrypt procedure, as in GetPowHash() in main.h, while the python passes pointer to structures??

                          Eample from wallet main.h:

                          /* Calculates block proof-of-work hash using either NeoScrypt or Scrypt */
                          uint256 GetPoWHash() const {
                          unsigned int profile = 0x0;
                          uint256 hash;
                          
                          /* All blocks generated up to this time point are Scrypt only */
                          if((fTestNet && (nTime < nTestnetSwitchV2)) ||
                          (!fTestNet && (nTime < nSwitchV2))) {
                          profile = 0x3;
                          } else {
                          /* All these blocks must be v2+ with valid nHeight */
                          int nHeight = GetBlockHeight();
                          if(fTestNet) {
                          if(nHeight < nTestnetFork)
                          profile = 0x3;
                          } else {
                          if(nHeight < nForkFour)
                          profile = 0x3;
                          }
                          }
                          
                          neoscrypt((unsigned char *) &nVersion, (unsigned char *) &hash, profile);
                          
                          return hash;
                          } 
                          

                          Example from p2pool/work.py:

                           
                          pow_hash = self.node.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(header))
                          

                          Where header is a dict in python.

                          I think it is in main.py.

                          if share.pow_hash
                          
                          1 Reply Last reply Reply Quote 1
                          • Wellenreiter
                            Wellenreiter Moderators last edited by

                            For testing I temporarily modified the neoscrypt.c of the p2pool neoscrypt module and defined the input value of the hashing procedure as constant in the c-code. It seems to calculate correctly.

                            Also the target on p2pool measured against seems to be fine.

                            I assume, that the return value from the neoscrypt module either has an overflow or is interpreted wrong. may be wrong type, little/big endian problem or whatever.

                            ------------- Edit---------------

                            Checked type of pow_hash and target in work.py -> both variables have type ‘long’

                            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                            1 Reply Last reply Reply Quote 1
                            • ghostlander
                              ghostlander Regular Member last edited by

                              If you switch CPUminer in debug mode with -D, you can see P2Pool asking for incorrect targets:

                              [2014-08-10 21:21:12] 1 miner threads started, using 'neoscrypt' algorithm.
                              [2014-08-10 21:21:15] Long-polling activated for http://prometheus.phoenixcoin.org:20554/long-polling
                              [2014-08-10 21:21:15] DEBUG: got new work in 3062 ms
                              [2014-08-10 21:21:16] DEBUG (little endian): hash
                              
                              1 Reply Last reply Reply Quote 1
                              • Wellenreiter
                                Wellenreiter Moderators last edited by

                                It is working now for long-poll.

                                No support for stratum at the moment, even if work is distributed, no valid blocks can be mined via stratum.

                                A new version is on github

                                Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                                Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                                1 Reply Last reply Reply Quote 1
                                • lizhi
                                  lizhi last edited by

                                  Yes, It work! >:D

                                  1 Reply Last reply Reply Quote 1
                                  • wrapper
                                    wrapper Moderators last edited by

                                    neoscrypt p2pool dev testing cpu mine phoenixcoin

                                    http://95.85.57.10:10554

                                    Longpoll works, so start minerd with ‘–no-stratum’

                                    useing Ghostlander’s Github (for minerd)

                                    https://github.com/g…r-neoscrypt.git

                                    1 Reply Last reply Reply Quote 0
                                    • lizhi
                                      lizhi last edited by

                                      Latest code pushed

                                      git clone git://github.com/wellenreiter01/p2pool-neoscrypt

                                      1 Reply Last reply Reply Quote 1
                                      • wrapper
                                        wrapper Moderators last edited by

                                        What is the status of the p2pool?

                                        Is there still a problem with stratum?

                                        Are we near to pushing some changes upstream? How far back can that go?

                                        That makes things easier running multicoin p2pools. That will mean the “central p2pool” distribution gets updated.

                                        1 Reply Last reply Reply Quote 0
                                        • Wellenreiter
                                          Wellenreiter Moderators last edited by

                                          Stratum suport still is not implemented, but longpoll runs stable, so this is not a show stopper for pooled neoscrypt mining.

                                          Due to the fact, that neoscrypt uses little endian data only, while other algorithms use big endian encoding, neoscrypt p2pool is not compatible with non-neoscrypt coins.

                                          Therefore two different versions of p2pool will exist in the futute, unless significant changes in the code is done to implement coin dependent encoding of data. These changes would need a couple of if-then clauses reducing the speed of p2pool operation, and/or increasing the load put un the underlaying host system.

                                          Another solutution would be to adapt neoscrypt to the big endian encoding used for other algorithms, but this would mean another hard fork for any coin productive with neoscrypt.

                                          Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                                          Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                                          1 Reply Last reply Reply Quote 1
                                          • Wellenreiter
                                            Wellenreiter Moderators last edited by

                                            Update:

                                            Stratum support works for minerd.

                                            It can be testet on

                                            • http://p2pool.neoscrypt.de:10554 ( German pool )

                                            • http://pool20.neoscrypt.de:10554 ( Dutch pool )

                                            GPU miner adaption is ongoing, but not working yet

                                            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                                            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post