Skip to content

Comments

Namecoin testnet beta#19

Open
jonasbits wants to merge 8 commits intonamecoin:masterfrom
snowlab:namecoin-testnet-beta
Open

Namecoin testnet beta#19
jonasbits wants to merge 8 commits intonamecoin:masterfrom
snowlab:namecoin-testnet-beta

Conversation

@jonasbits
Copy link

I would like to create a new branch on namecoin/libcoin. The branch would be namecoin-testnet-beta, the beta part is to indicate that it still uses some hacks to let it sync.

the next commit will have the changes to become testnet
testnet uses irc channel #namecoinTEST without any numbers at the end,
getinfo now returns testnet:true, auxpow at height 4042
known bug:
rpc user:pass needs to be in lowercase base64
v:a -> djph

new feature:
coinexplorer have got new rpc calls to handle names in the namecoin
chains
…able sync

now this code should not interfere with any other chain then namecoin
testnet
persistence was warning when purge depth is 1 using FULL setting (zero),
--version and --help now works, and RPC method "help" is no longer
intercepted wrongly
@domob1812
Copy link
Contributor

I'm fine with having this as a separate branch. However, you could just as well ask @gronager to merge the changes to upstream already if it fully works. I think that some "hacks" are allowed for this, and actually the official code also contains certain "hacks" to get around old bugs in the blockchain.

I just pushed the latest upstream changes to namecoin/namecoin - could you please try a rebase of your patch? I think that should remove the upstream changes shown here from your history. Thanks!

@JeremyRand
Copy link
Member

@domob1812 My main concern with the hacks is that if we don't understand why they're necessary, then they could be exploited to produce a blockchain fork later. Any chance you could look at the hacks in this beta and see if you can figure out an underlying bug?

@domob1812
Copy link
Contributor

I can try, although I'm not sure if I'll find anything. In any case, I'm not too concerned with forks of testnet - it will at least be very useful to test things, like my upcoming work on name_new & friends! But I understand your concerns and am fine to have this as a branch first.

The pull request wants to merge into the master branch - is there a way to create one to merge into a new branch? Or should I do this from the Git command-line? BTW, the history is clean now - thanks for rebasing, or possibly it got fixed automatically when I pushed the latest commits.

@JeremyRand
Copy link
Member

@domob1812 keep in mind that some people test weird transactions on testnet, which means that blockchain forks on testnet could indicate an exploitable vulnerability on mainnet. That's one reason I'd really like to see the hacks resolved.

(slightly off topic) By the way, my offer of matching bounties 1:1 up to $50 for name_new etc. still holds. I'm a little frustrated no one is taking me up on the offer... is there a better place I can point this out with better visibility? I mentioned on Reddit but this was right in the middle of the BitShares troll spam attack over there, so I think not many people saw it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a useful addition in general. You should propose it to upstream libcoin as pull request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

/M

On Sep 23, 2014, at 9:55 AM, Daniel Kraft notifications@github.com wrote:

In applications/coinexplorer/coinexplorer.cpp:

@@ -394,6 +394,14 @@ int main(int argc, char* argv[])
server.registerMethod(method_ptr(new GetConnectionCount(node)));
server.registerMethod(method_ptr(new GetDifficulty(node)));
server.registerMethod(method_ptr(new GetInfo(node)));

  • // Register Node methods specific to Namecoin
  • /*if (conf.chain().adhere_names()) {
  •        server.registerMethod(method_ptr(new NameShow(node)));
    
  •        server.registerMethod(method_ptr(new NameHistory(node)));
    
  •        server.registerMethod(method_ptr(new NameScan(node)));
    
  •        server.registerMethod(method_ptr(new NameFilter(node)));
    
  •    }*/
    

This seems like a useful addition in general. You should propose it to upstream libcoin as pull request.


Reply to this email directly or view it on GitHub.

@domob1812
Copy link
Contributor

@jonasbits + @JeremyRand: Are you still interested in this? I think I understand now where the hack in BlockChain::append comes from. khal's code that checks whether the time to the last block is larger than 20 minutes has a bug - he does this by subtracting two unsigneds. Consequently, the minimum difficulty should be applied also when the new block's timestamp is earlier than the preceding block's. (Which can happen in practice.) This "extra rule" is not adhered to by libcoin.

I had the same problem with the rebased client. When fixed, all PoW syncs fine until the end of the testnet chain.

@gronager
Copy link
Contributor

So a good test for the issue is to use the (namecoin)testnet ?

If that is the case I should add support for testnet as well...

/M

On Nov 18, 2014, at 5:59 AM, Daniel Kraft notifications@github.com wrote:

@jonasbits + @JeremyRand: Are you still interested in this? I think I understand now where the hack in BlockChain::append comes from. khal's code that checks whether the time to the last block is larger than 20 minutes has a bug - he does this by subtracting two unsigneds. Consequently, the minimum difficulty should be applied also when the new block's timestamp is earlier than the preceding block's. (Which can happen in practice.) This "extra rule" is not adhered to by libcoin.

I had the same problem with the rebased client. When fixed, all PoW syncs fine until the end of the testnet chain.


Reply to this email directly or view it on GitHub.

@domob1812
Copy link
Contributor

@gronager: I'm not sure I understand which issue you are talking about. The "hack" I mention is an additional change that this patch introduces just to make the Namecoin testnet work. If you don't (yet) support this chain, no "issue" or "hack" is present. But yes, I think that including a version of this patch (after cleaning it up) would be very nice - so that Namecoin testnet support is included in libcoin proper.

@jonasbits
Copy link
Author

@domob1812 Have you commited the extra rule yet, I cant find it in your repository.

@domob1812
Copy link
Contributor

No, not yet (at least not for libcoin). I just wanted to share my understanding. ;) I can commit a fix, though, if you don't want to work on it yourself.

@jonasbits
Copy link
Author

Can you point me to the change you did in namecore? Would love to figure this out for libcoin --nametest

@domob1812
Copy link
Contributor

Of course: https://github.com/domob1812/namecore/blob/master/src/pow.cpp#L33

Let me know if you don't succeed, then I can give it a try in a few days. But I'm sure you can fix it yourself! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants