elective-stereophonic
elective-stereophonic
Forking hell?..
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.1 Upgrade before block 2870000 is mandatory!

Author Topic: Forking hell?..  (Read 2089 times)

davidpbrown

  • Guest
Forking hell?..
« on: April 19, 2014, 11:11:11 am »

So, it seems that I had been forging on a fork!.. Local balances on accounts were going off on a tangent to those on the block explorers.

I worry that the network is not distributed enough that local dense groups could setup small forks and then later people more widely will see transactions fail. I don't know, if that's why there are suggestions of money disappearing from accounts, as if those were hacked; I wonder these events would look the same to the casual user.

How do we know that we are on the main chain?.. Is it simply a matter of trusting that the block explorers are on the main chain and then checking those reflect what we see as balance output from the client? One indicator perhaps I noted was that I was forging more than I'd expected would be the case - more frequently.

I'm in London, so I can imagine that my client perhaps finds peers local to me, neglects to retain those at a distance and then perhaps find enough balances in the area to create a fork. I'm no expect on how forks occur or how the network is distributed but having been on what I'm guessing was as fork for a while, expect this needs attention.

Do we know how the client finds; retains; and prefers peers? Is that purely random or done in a way that will have most clients look to peers that are as widely dispersed as possible? I wonder whether PoS is more liable to forking be larger accounts or by those that find themselves in groups, that are large balanced accounts relative to other groups of peers on the network.

The worry has to be obviously that any transaction might be put to a fork rather than to the main chain. Again not an expert, so I don't know how new transactions are broadcast to ensure they are included in fork and main chain, if that is a risk.

Is NXT fizzing with little bubbles and forks, perhaps partly because there aren't enough transactions to discourage that; or is it really one robust network?.. and how do we know that, what is maintaining that? How are clients more likely to fall towards the main chain?

I guess new clients look to a default set of nodes and so my approach now will be to download the blockchain fresh at each upgrade. The only odd action that might have caused this but I can't see how, is that I overwrote the old v11 with v12 and then with v13 to retain the existing data, which is I think the method suggested somewhere. Having put the old to one side and started afresh, I'm seeing the balances match the block explorers again.. which does mean I've lost NXT, though that's a small issue it might be an irritant to others.

Also, just to note that the v12 Java/update.html doesn't seem to offer the v13 as an upgrade and even having done that manually that v13 isn't showing as the latest; I expect that's something on a reference point that the clients look to, hasn't been updated.. would be a useful feature, if it worked. I expect having most people running the same client does matter or perhaps they are not mandatory.

:o
Logged

starik69

  • Sr. Member
  • ****
  • Karma: +11/-17
  • Offline Offline
  • Posts: 301
    • View Profile
Re: Forking hell?..
« Reply #1 on: April 19, 2014, 01:31:27 pm »

How do we know that we are on the main chain?..
Look at the base target. If it is constantly above several thousands % - you are on a fork. ::)
Do we know how the client finds; retains; and prefers peers? Is that purely random or done in a way that will have most clients look to peers that are as widely dispersed as possible?
Random. :)
Logged
NXT-R2U6-22MC-LQL2-22222 (648774468) - NXT | All versions of NXT client and more - https://mega.co.nz/#F!J1xmgAyC!cnaqdxHALLMGiS0hTPrhAg

davidpbrown

  • Guest
Re: Forking hell?..
« Reply #2 on: April 19, 2014, 02:20:28 pm »

So, how common are forks and is it well understood how those arise?.. Is there more we can do to avoid them??
Logged

allbits

  • Full Member
  • ***
  • Karma: +31/-3
  • Offline Offline
  • Posts: 221
    • View Profile
Re: Forking hell?..
« Reply #3 on: April 20, 2014, 01:59:37 am »

So, how common are forks and is it well understood how those arise?.. Is there more we can do to avoid them??

Can someone provide some more insight to these questions?
Logged

pf

  • Hero Member
  • *****
  • Karma: +161/-197
  • Offline Offline
  • Posts: 1340
    • View Profile
Re: Forking hell?..
« Reply #4 on: April 20, 2014, 04:49:15 am »

I just watched this happen as well, creating a new thread about it.
Logged
---
NXT Multipool! Mine Scrypt, SHA, Keccak or X11 for NXT! http://hashrate.org
http://hashrate.org/getting_started for port info!

davidpbrown

  • Guest
Re: Forking hell?..
« Reply #5 on: April 20, 2014, 12:12:32 pm »

The other related question I had is, are transactions out of a wallet done as FIFO?..

Hoping someone does know the answer to these, even if it's just that it's a standing problem .. perhaps beyond NXT even.
Logged

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: Forking hell?..
« Reply #6 on: April 20, 2014, 01:10:04 pm »

Transactions within the same block are processed in order of their transaction id's, which is not related at all to their relative timestamps. Transactions in different blocks are processed in block order, even if their timestamps are in different order.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

davidpbrown

  • Guest
Re: Forking hell?..
« Reply #7 on: April 20, 2014, 01:18:40 pm »

Sorry, perhaps not clear, I was wondering about whether coins that were put to the wallet first are spent first. That would help perhaps with new coins that were forged on a fork not causing the whole wallet to seize up.
Logged

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: Forking hell?..
« Reply #8 on: April 20, 2014, 01:31:41 pm »

We don't really have this concept of a wallet with multiple addresses in it. Each address is just one account which has a balance, and each transaction adds or subtracts from this balance in the order transactions are applied. But once in the account, there is no distinction between coins that came from different transactions.

The account also keeps track of the unconfirmed balance which is reduced with the amount of any unconfirmed (not yet included in a block) transaction and is not allowed to drop negative, to prevent double spending transactions.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

ScripterRon

  • Hero Member
  • *****
  • Karma: +75/-2
  • Offline Offline
  • Posts: 523
    • View Profile
Re: Forking hell?..
« Reply #9 on: May 06, 2014, 07:33:08 pm »

My 1.0.0 NRS client appears to be off on a fork and is stuck at block 130491.  It hasn't corrected itself for an hour now.  Is it supposed to recover or do I need to delete the database and download the blockchain again?
Logged

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: Forking hell?..
« Reply #10 on: May 06, 2014, 07:58:07 pm »

Your node has 720 blocks to recover. :) After that, it sticks to its fork.
Logged

ScripterRon

  • Hero Member
  • *****
  • Karma: +75/-2
  • Offline Offline
  • Posts: 523
    • View Profile
Re: Forking hell?..
« Reply #11 on: May 06, 2014, 08:19:30 pm »

Your node has 720 blocks to recover. :) After that, it sticks to its fork.
Well, everything is correct until block 130491.  This block does not match what is on block explorer for that chain height.  I've stopped and restarted the node and it is not advancing.  The base target is now up to 954%, so I suppose I'll generate a block eventually for this orphan chain  ???

I guess I need to delete the database and restart.
Logged

EvilDave

  • Hero Member
  • *****
  • Karma: +341/-40
  • Offline Offline
  • Posts: 1789
    • View Profile
    • NXT Foundation
Re: Forking hell?..
« Reply #12 on: May 06, 2014, 09:22:01 pm »

I've probably spent days in total staring at the NRS interface, especially back in Dec/Jan, when we had forks on a daily basis.

The best (easily visible) indicators that u are forked are:

Base target. If it goes above 500% start worrying, panic @ 1000%

Unconfirmed transactions. There will often be a couple of unconfirmed, waiting for a block. 
More than a handful is a bad sign, 10 is panic time.

Bear in mind that the basic NRS browser interface will hang sometimes for no real reason, and only needs a refresh (F5) to bring it back up-to-date, so don't instantly assume that u r forking.
Logged
Nulli Dei, nulli Reges, solum NXT
NXT Donations: NXT-BNZB-9V8M-XRPW-3S3WD
We will ride eternal, shiny and chrome!
 

elective-stereophonic
elective-stereophonic
assembly
assembly