iri icon indicating copy to clipboard operation
iri copied to clipboard

Transaction resolves to incorrect ledger balance (thousands of time)

Open mjollnir14 opened this issue 8 years ago • 28 comments

The following event keeps my iri blocked, this gets back after several restarts systematically and I got thousands of this same line in logs:

Jan 04 02:21:31 osiris IRI[18344]: 01/04 02:21:31.480 [Solid Milestone Tracker] INFO com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4151698081495

I think this is the issue preventing my node to keep in sync with LastMilestone.

iota@osiris:~$ uname -a Linux osiris 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux iota@osiris:~$ ./status.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 596 100 570 100 26 56846 2592 --:--:-- --:--:-- --:--:-- 63333 { "appName": "IRI", "appVersion": "1.4.1.4", "jreAvailableProcessors": 12, "jreFreeMemory": 368470240, "jreVersion": "1.8.0_151", "jreMaxMemory": 7249854464, "jreTotalMemory": 710410240, "latestMilestone": "ID9RSTSRZEMSJKZCXTRAOQABOIETYGMIAOMYMXIPFYUUHWGYXVXQSTPMWMOX9ICBCQVDPQRUOBOAZ9999", "latestMilestoneIndex": 319322, "latestSolidSubtangleMilestone": "CWWMMLIJKXBLPFDWEUG9MKOQTXLHABVFTMUFUS9LDWUVHIGRCEKBK9FOAIRHLQVOOQPMYIBPJPMKA9999", "latestSolidSubtangleMilestoneIndex": 319189, "neighbors": 5, "packetsQueueSize": 0, "time": 1515029209112, "tips": 273, "transactionsToRequest": 0, "duration": 1 }

iota@osiris:~$ java -version java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

ExecStart=/usr/bin/nice -n 15 /usr/bin/java -XX:+DisableAttachMechanism -Xmx7777m -Djava.net.preferIPv4Stack=true -jar iri-compiled.jar -c iota.ini

mjollnir14 avatar Jan 04 '18 01:01 mjollnir14

I hava the same question, and I delete the db data and sync the data again, there is still the question

yanchang-gyc avatar Jan 04 '18 03:01 yanchang-gyc

Same issue with https://github.com/Pomyk/iri fork

mjollnir14 avatar Jan 04 '18 12:01 mjollnir14

As far as I know, the reason for this is that your node wasn't fully synced over the past couple days when we did some network changes on our end. The result is that you should bootstrap from a new db (e.g. the iota.partners one) for the time being.

@alon-e ^

th0br0 avatar Jan 04 '18 12:01 th0br0

Do you mean the snapshot from last weekend? I did DL an hourly after the COO was back online.. Maybe I've been too fast and got an older snapshot... I'll try that again now

mjollnir14 avatar Jan 04 '18 12:01 mjollnir14

Same issue with current hourly snapshot:

iota@osiris:~$ ls -l IOTA.partners-mainnetdb.tar.gz
-rw-r--r-- 1 iota iota 9345594523 Jan  4 13:07 IOTA.partners-mainnetdb.tar.gz
iota@osiris:~$ md5sum IOTA.partners-mainnetdb.tar.gz
c9d96760529b7d26d9553cab5be18b06  IOTA.partners-mainnetdb.tar.gz

Jan 04 14:35:07 osiris IRI[17352]: 01/04 14:35:07.571 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:11 osiris IRI[17352]: 01/04 14:35:11.895 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 25 , toReply = 0 / totalTransactions = 3705617
Jan 04 14:35:12 osiris IRI[17352]: 01/04 14:35:12.634 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:17 osiris IRI[17352]: 01/04 14:35:17.756 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:22 osiris IRI[17352]: 01/04 14:35:22.581 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:26 osiris IRI[17352]: 01/04 14:35:26.896 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 24 , toReply = 0 / totalTransactions = 3705643
Jan 04 14:35:27 osiris IRI[17352]: 01/04 14:35:27.584 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:30 osiris IRI[17352]: 01/04 14:35:30.549 [Latest Milestone Tracker] INFO  com.iota.iri.Milestone - Latest milestone has changed from #319700 to #319701
Jan 04 14:35:32 osiris IRI[17352]: 01/04 14:35:32.649 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:36 osiris IRI[17352]: 01/04 14:35:36.897 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 26 , toReply = 0 / totalTransactions = 3705648
Jan 04 14:35:37 osiris IRI[17352]: 01/04 14:35:37.602 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:42 osiris IRI[17352]: 01/04 14:35:42.610 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:47 osiris IRI[17352]: 01/04 14:35:47.616 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:51 osiris IRI[17352]: 01/04 14:35:51.897 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 27 , toReply = 0 / totalTransactions = 3705665
Jan 04 14:35:52 osiris IRI[17352]: 01/04 14:35:52.733 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:35:57 osiris IRI[17352]: 01/04 14:35:57.575 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:36:01 osiris IRI[17352]: 01/04 14:36:01.898 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 23 , toReply = 0 / totalTransactions = 3705679
Jan 04 14:36:02 osiris IRI[17352]: 01/04 14:36:02.587 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:36:07 osiris IRI[17352]: 01/04 14:36:07.573 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712
Jan 04 14:36:11 osiris IRI[17352]: 01/04 14:36:11.899 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 25 , toReply = 0 / totalTransactions = 3705685
Jan 04 14:36:12 osiris IRI[17352]: 01/04 14:36:12.572 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -6703132262712

{
  "appName": "IRI",
  "appVersion": "1.4.1.4",
  "jreAvailableProcessors": 12,
  "jreFreeMemory": 85755160,
  "jreVersion": "1.8.0_151",
  "jreMaxMemory": 7249854464,
  "jreTotalMemory": 582483968,
  "latestMilestone": "UFUQUQXKOEWXXVNHLKNITYZBONFVHZZKCUPUSCISQBSTIJGIBMYINRFOMITNCRKRWNSEVTP9XBDN99999",
  "latestMilestoneIndex": 319701,
  "latestSolidSubtangleMilestone": "NTAUXHM9LJJVYELING9GEWZZYPDGGXVFRMPFRJPVACNPNVBBCNHFNSUPDVBXZMMX9CINCTJH9BBW99999",
  "latestSolidSubtangleMilestoneIndex": 319344,
  "neighbors": 6,
  "packetsQueueSize": 0,
  "time": 1515073002328,
  "tips": 1067,
  "transactionsToRequest": 26,
  "duration": 0
}

mjollnir14 avatar Jan 04 '18 13:01 mjollnir14

My firewall is quite restrictive but all ports related to iri are open. Can someone confirm that the protocol doesn't rely on any ICMP messages?

mjollnir14 avatar Jan 04 '18 13:01 mjollnir14

I should also mention that I used Nelson for some days

mjollnir14 avatar Jan 04 '18 13:01 mjollnir14

if you use nelson, nelson neighbors can use different ports, so you may have to open up ports by range like 3000-65000,

sreeraj-krishnan avatar Jan 05 '18 00:01 sreeraj-krishnan

After a complete cleanup (had to delete db/ directory and mainnetdb/) the "ransaction resolves to incorrect ledger balance" error dissapeared.

The MLS is not syncing well tho

mjollnir14 avatar Jan 05 '18 00:01 mjollnir14

I'll close the ticket as I think there's already an issue open about the perpetual loss of sync

mjollnir14 avatar Jan 05 '18 00:01 mjollnir14

After the db total cleanup and now that I'm almost synced the error is back again:

Jan 06 02:18:53 osiris IRI[4999]: 01/06 02:18:53.418 [pool-5-thread-14] INFO  c.i.i.n.r.ReplicatorSourceProcessor - Creating sink for 212.47.251.158
Jan 06 02:18:53 osiris IRI[4999]: 01/06 02:18:53.418 [pool-5-thread-14] INFO  c.i.i.n.r.ReplicatorSourceProcessor - ----- NETWORK INFO ----- Source 212.47.251.158 is connected
Jan 06 02:19:00 osiris IRI[4999]: 01/06 02:19:00.501 [Latest Milestone Tracker] INFO  com.iota.iri.Milestone - Latest milestone has changed from #320809 to #320810
Jan 06 02:19:08 osiris IRI[4999]: 01/06 02:19:08.312 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 2722117
Jan 06 02:19:09 osiris IRI[4999]: 01/06 02:19:09.631 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -384186935177500
Jan 06 02:19:18 osiris IRI[4999]: 01/06 02:19:18.313 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 2722123
Jan 06 02:19:33 osiris IRI[4999]: 01/06 02:19:33.314 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1 , toReply = 0 / totalTransactions = 2722139
Jan 06 02:19:43 osiris IRI[4999]: 01/06 02:19:43.781 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -384186935177500
Jan 06 02:19:48 osiris IRI[4999]: 01/06 02:19:48.315 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 2722160
Jan 06 02:19:58 osiris IRI[4999]: 01/06 02:19:58.315 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 2722170
Jan 06 02:20:08 osiris IRI[4999]: 01/06 02:20:08.316 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1 , toReply = 0 / totalTransactions = 2722187
Jan 06 02:20:17 osiris IRI[4999]: 01/06 02:20:17.553 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -384186935177500

mjollnir14 avatar Jan 06 '18 01:01 mjollnir14

With 1.4.1.6:

Jan 07 11:50:15 osiris IRI[17734]: 01/07 11:50:15.972 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:16 osiris IRI[17734]: 01/07 11:50:16.499 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 3094526
Jan 07 11:50:20 osiris IRI[17734]: 01/07 11:50:20.975 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:26 osiris IRI[17734]: 01/07 11:50:26.040 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:26 osiris IRI[17734]: 01/07 11:50:26.500 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 3094560
Jan 07 11:50:31 osiris IRI[17734]: 01/07 11:50:31.659 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:35 osiris IRI[17734]: 01/07 11:50:35.986 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:36 osiris IRI[17734]: 01/07 11:50:36.501 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1 , toReply = 0 / totalTransactions = 3049843
Jan 07 11:50:41 osiris IRI[17734]: 01/07 11:50:41.020 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:45 osiris IRI[17734]: 01/07 11:50:45.978 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:46 osiris IRI[17734]: 01/07 11:50:46.502 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1 , toReply = 0 / totalTransactions = 3049891
Jan 07 11:50:51 osiris IRI[17734]: 01/07 11:50:51.110 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:56 osiris IRI[17734]: 01/07 11:50:56.018 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:50:56 osiris IRI[17734]: 01/07 11:50:56.503 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 2 , toReply = 0 / totalTransactions = 3049906
Jan 07 11:51:00 osiris IRI[17734]: 01/07 11:51:00.933 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:51:06 osiris IRI[17734]: 01/07 11:51:06.008 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:51:06 osiris IRI[17734]: 01/07 11:51:06.504 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 0 , toReply = 0 / totalTransactions = 3049943
Jan 07 11:51:11 osiris IRI[17734]: 01/07 11:51:11.011 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364
Jan 07 11:51:16 osiris IRI[17734]: 01/07 11:51:16.071 [Solid Milestone Tracker] INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -4493709901364

mjollnir14 avatar Jan 07 '18 10:01 mjollnir14

Confirmed, I downloaded the database from iota.partners multiple times and after some time the node gets into

INFO  com.iota.iri.Snapshot - Transaction resolves to incorrect ledger balance: -3710340530868

I looked up the codebase:

        long stateValue = state.values().stream().reduce(Math::addExact).orElse(Long.MAX_VALUE);
        if(stateValue != TransactionViewModel.SUPPLY) {
            long difference = TransactionViewModel.SUPPLY - stateValue;
            log.info("Transaction resolves to incorrect ledger balance: {}", difference);
            return false;
        }

The state is a hashmap of the previous transaction blocks. I can think of a situation when some malignant transaction appears in the tangle and crashes the update of snapshot. Also it looks like the merge operation will never happen, and hence this transaction sits there forewer.

jdevelop avatar Jan 07 '18 15:01 jdevelop

Well, I don't see where in the code this is allowed.

tactical-drone avatar Jan 08 '18 19:01 tactical-drone

I fixed it.

tactical-drone avatar Jan 08 '18 19:01 tactical-drone

Still on 404 to me

mjollnir14 avatar Jan 08 '18 19:01 mjollnir14

The foundation payouts. How were they achieved? Did they honor zero sum? Or are we on a broken state right now?

tactical-drone avatar Jan 08 '18 19:01 tactical-drone

I assume that the behaviour is quite expected - due to the random-walk transaction confirmation it is quite possible to have something that does exist in one subtabgle and doesn't - in another. The only problem is that this state shoud resolve eventually, and from what I'm observiing - it doesnt.

Effectively what happens - the new subtangle is yet to be patched into the existing one (that was built from the previously accepted transactions) - and this resolves into the incorrect balance, hence the current subtangle is invalid. And if the current subtabgle that is kept in memory is incorrect - there's no chance of it to be updated in the fugure, so everything is screwed up.

Sometimes it happens to resolve if there is no conflicting transactions, so it has some chance to advance the local milestone a bit, but most of the times it doesn't.

  "latestMilestone": "HECXHAITRVQDLBIHFJV9MFLGPGSXYRHMTXIGAHMMVHNCCYWUHBEYN9WGODRIBKFMSCDQITVIJUZXA9999",
  "latestMilestoneIndex": 322852,
  "latestSolidSubtangleMilestone": "DIEPGAGVKNPIAMGODGWEYCBMBIWM9ZHYPFNXLSHIYSLIWDJNUXMFMNWBFFCUY9WFEMM9LKAEHSJSZ9999",
  "latestSolidSubtangleMilestoneIndex": 321943,

jdevelop avatar Jan 08 '18 20:01 jdevelop

The error still appears but my node is now able to keep updating.. I have a cron restarting iri every hour

"latestMilestone": "MFMEAHHJ9DDFYUVXSRFOKRFRFAEYBDOGHPNDDNHGQHZCGMFZFAX9DGBTBOURFMYTJDLWHYKJCICGZ9999",
 "latestMilestoneIndex": 322907,
 "latestSolidSubtangleMilestone": "MXLNDFEPVYTMMWWNVZRARGGLCPYQPECOTBGOVOKYBBJQFTMESIEACWUTG9FGWASFLUPCAKLMKOQNA9999",
 "latestSolidSubtangleMilestoneIndex": 322869,

mjollnir14 avatar Jan 08 '18 22:01 mjollnir14

It also appears on my node with the newest IRI:

"appName": "IRI", "appVersion": "1.4.1.6", "jreAvailableProcessors": 8, "jreFreeMemory": 1626860008, "jreVersion": "1.8.0_151", "jreMaxMemory": 22906667008, "jreTotalMemory": 2675441664, "latestMilestone": "HMZD9YVAVRBLHPOEEFOAWAKXFSQO9QPYKBKSTIDXUMYB9QTKNOXJNXHEUR9WUOIDOZHBGBHRMHVP99999", "latestMilestoneIndex": 323289, "latestSolidSubtangleMilestone": "ENLBEBF9BHYI9ECKBODKQSZIXHWPSIBTWEBYVP9IATTYKAOBDYRZEQOJMOFLMINUYCECGUOIQQKR99999", "latestSolidSubtangleMilestoneIndex": 323162, "neighbors": 7, "packetsQueueSize": 0, "time": 1515495475145, "tips": 2186, "transactionsToRequest": 4, "duration": 0

rapmue avatar Jan 09 '18 10:01 rapmue