Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-bit client cannot download blockchain #64

Open
PSLLSP opened this issue Nov 22, 2023 · 5 comments
Open

32-bit client cannot download blockchain #64

PSLLSP opened this issue Nov 22, 2023 · 5 comments

Comments

@PSLLSP
Copy link

PSLLSP commented Nov 22, 2023

m-wallet-1.4.6.2-linux, 32-bit; release

$ file m-wallet-1.4.6.2-linux/bin/32/magid 
m-wallet-1.4.6.2-linux/bin/32/magid: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=29b3896489e771bbf8be7c3f793ec664fde96ea6, stripped

I tried tried to download blockcain from block 0 but there is a problem in 2016, this client rejects block 735357 that is part of blockchain; information from debug.log:

received block d6b32c1b36267903c199
trying connection 54.38.79.76:8233 lastseen=129.4hrs
SetBestChain: new best=d6b32c1b36267903c199ad8ce433896f5565c2bdd8e404844e6abdf5e599e915  height=735356  money supply=4770724  trust=295
30431346415  date=03/16/16 20:32:25
Stake checkpoint: 500d28d
ProcessBlock: ACCEPTED

received block 000000000add6798d2dd
ERROR: ConnectBlock() : coinbase reward exceeded (actual=1698750342 vs calculated=1698750341, height=735356)
InvalidChainFound: invalid block=000000000add6798d2dd  height=735357  trust=29530431362515  date=03/16/16 20:31:25
InvalidChainFound:  current best=d6b32c1b36267903c199  height=735356  trust=29530431346415  date=03/16/16 20:32:25
ERROR: SetBestChain() : SetBestChainInner failed
ERROR: AcceptBlock() : AddToBlockIndex failed
ERROR: ProcessBlock() : AcceptBlock FAILED
Misbehaving: 34.82.177.39:8233 (0 -> 50)

Situation in block explorer:
block 735356 d6b32c1b36267903c199ad8ce433896f5565c2bdd8e404844e6abdf5e599e915
block 735357 000000000add6798d2dd9c62b16d7a74a9a1b272ba09de409ce06dc9bc8fcc2f

block 735357

@BastelPichi
Copy link

BastelPichi commented Dec 3, 2023

Hey,
Im not sure of the exact issue. Have you tried downloading the latest blockchain from https://chain.magicoin.de/ and syncing from that?

@PSLLSP
Copy link
Author

PSLLSP commented Dec 4, 2023

I downloaded ZIP archive with XMG blockchain, extracted it. 32-bit client still cannot sync. The last block it accepts is block 4147200, block 4147201 is rejected with error ERROR: AcceptBlock() : block timestamp too far in the future. My 32-bit Debian system runs NTP daemon and time is synced, so error about timestamp in the far future is not because OS has wrong system clock...

4147200 hash 00000000abcb602203987a9e73f758dbb40c0e478d49f38e7a08c5934a2f1ac8
4147201 hash 8d1f7a9ba74429e7d1afd2e2e1f34f5d4ddc01baa3a3ab10afedfd58ea2e6ccc

received block 00000000abcb60220398
SetBestChain: new best=00000000abcb602203987a9e73f758dbb40c0e478d49f38e7a08c5934a2f1ac8  height=4147200  money supply=18139785  trust=84381340646917  date=12/03/23 23:19:26
Stake checkpoint: 7ffd70c4
AcceptPendingSyncCheckpoint : sync-checkpoint at 00000000abcb602203987a9e73f758dbb40c0e478d49f38e7a08c5934a2f1ac8
ProcessBlock: ACCEPTED
connection timeout
Flushing wallet.dat
Flushed wallet.dat 5ms
...
received block 8d1f7a9ba74429e7d1af
ERROR: AcceptBlock() : block timestamp too far in the future
ERROR: ProcessBlock() : AcceptBlock FAILED

My explanation of these errors is that wallet code on 32-bit system uses different arithmetic, maybe some operations overflows and that is why it calculates different result than wallet running on 64-bit system where registers are 64-bit wide and so some operation with ADD, SUB, MUL or SHIFT instructions can lead to different result... The Magi consensus algo was not tested on 32-bit architecture...

Was it designed for Raspberry PI computers? Maybe I can test it on some older RPI that has just 32-bit ARM, like RPI2 or RPI zero.

@BastelPichi
Copy link

This is an interesting issue. Have you tried recompiling the source?

@PSLLSP
Copy link
Author

PSLLSP commented Dec 5, 2023

I tried to compile from source but I failed, there are old dependencies and it just doesn't work on modern system, like Debian 11... I am not experienced enough to find and fix all issues. That is another reason why I will not try it on RPI2 or RPI4; there is no release for ARM and compilation is challenging...

I found note that MAGI is based on Peercoin (PPC). There is no release file x86 for PPC, so I tried to build one. That was an easy process, I built peercoind on my first try, compilation just took several hours. Other interesting observation was that I synced with PPC network from block 0, in less than a day, that was fast, no issue at all... That was a test with 32-bit client and it proves that PPC code is still well maintained...

I try to synchronize with Magi with 64-bit client, node runs more than two weeks and synchronization is still not finished, it is so slow process and it was not easy to start the process, to find nodes with valid blockchain data... But it seems that 64-bit MAGI client can sync, it just takes time... Bootstrap file is real help but it is not well documented and I wanted to see if client can sync from block 0.

@BastelPichi
Copy link

I tried to compile from source but I failed, there are old dependencies and it just doesn't work on modern system, like Debian 11... I am not experienced enough to find and fix all issues. That is another reason why I will not try it on RPI2 or RPI4; there is no release for ARM and compilation is challenging...

I found note that MAGI is based on Peercoin (PPC). There is no release file x86 for PPC, so I tried to build one. That was an easy process, I built peercoind on my first try, compilation just took several hours. Other interesting observation was that I synced with PPC network from block 0, in less than a day, that was fast, no issue at all... That was a test with 32-bit client and it proves that PPC code is still well maintained...

I try to synchronize with Magi with 64-bit client, node runs more than two weeks and synchronization is still not finished, it is so slow process and it was not easy to start the process, to find nodes with valid blockchain data... But it seems that 64-bit MAGI client can sync, it just takes time... Bootstrap file is real help but it is not well documented and I wanted to see if client can sync from block 0.

Magi is unmaintained and the network is quite small. Thats exactly why syncing without the blockchain archive will take a very long time. However, with the 64 bit client, you should be able to sync from block 0 (wouldnt really reccomend that tho)

https://github.com/BastelPichi/magi/tree/compability this repo is somewhat maintained and should, with minimal changes, compile on a up-to-date system. Dont think the issue would be fixed here tho, as this mostly took care of some dependency issues.

You are going to have to install berkely DB manually - see https://github.com/BastelPichi/berkely-db-fixed/blob/main/install.sh this script.

With this you should be able to get it running at least on the raspberry pi. If you want help faster, feel free to join our discord server.

Just an thought: ive successfully used magi on an rpi3 in the past, which is also 32 bit. So maybe it really just is an compilation error?!

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

No branches or pull requests

2 participants