Post
Topic
Board Pools
Re: [600 TH] p2pool: Decentralized, DoS-resistant, Hop-Proof pool
by
jonnybravo0311
on 29/08/2014, 18:51:34 UTC
How often does p2pool query namecoind getblockaux? I would like to make sure the namecoind internal recalculation time step makes sense.
Kiss
Can anyone answer this for phelix?  I haven't been able to dig through the code thoroughly to find any polling time. You can start in work.py to see the calls to get the merged work (around line 62):
Code:
      # MERGED WORK

        self.merged_work = variable.Variable({})

        @defer.inlineCallbacks
        def set_merged_work(merged_url, merged_userpass):
            merged_proxy = jsonrpc.HTTPProxy(merged_url, dict(Authorization='Basic ' + base64.b64encode(merged_userpass)))
            while self.running:
                auxblock = yield deferral.retry('Error while calling merged getauxblock on %s:' % (merged_url,), 30)(merged_proxy.rpc_getauxblock)()
                self.merged_work.set(math.merge_dicts(self.merged_work.value, {auxblock['chainid']: dict(
                    hash=int(auxblock['hash'], 16),
                    target='p2pool' if auxblock['target'] == 'p2pool' else pack.IntType(256).unpack(auxblock['target'].decode('hex')),
                    merged_proxy=merged_proxy,
                )}))
                yield deferral.sleep(1)
        for merged_url, merged_userpass in merged_urls:
            set_merged_work(merged_url, merged_userpass)

        @self.merged_work.changed.watch
        def _(new_merged_work):
            print 'Got new merged mining work!'