decentraland / bronzeage-node

DEPRECATED: This codebase will not be mantained anymore, and formats are going to change when we move to the Decentraland Iron Age
https://decentraland.org
Other
104 stars 22 forks source link

Assertion failures prevent reorganizing chain #57

Closed ghost closed 7 years ago

ghost commented 7 years ago

On 2 nodes in different places I'm seeing the same error repeated: the node attempts to reorganize the chain and fails with a Number exceeds 2^53-1 assertion error.

Both systems run Ubuntu Server 17.04.

Sometimes they run for a while without attempting a reorganization. Other times they try repeatedly in rapid succession with the same error every time.

Pasting a sequence of 2 of these errors here:

[warning] WARNING: Reorganizing chain.
[error] Number exceeds 2^53-1
{ AssertionError [ERR_ASSERTION]: Number exceeds 2^53-1
    at Object._read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/encoding.js:161:3)
    at Object.read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/encoding.js:175:19)
    at BufferReader.read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/reader.js:332:18)
    at Output.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/primitives/output.js:259:15)
    at Object.decompressOutput [as output] (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/compress.js:74:10)
    at UndoCoin.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:298:14)
    at Function.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:321:25)
    at UndoCoins.fromRaw (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:100:30)
    at Function.fromRaw (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:112:26)
    at ChainDB.getUndoCoins (/home/berry/sft/land-bronze/bronzeage-node/lib/blockchain/chaindb.js:973:20)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '==' }
[info] Connected to 174.138.48.153:2301.
[info] Attempting BIP151 handshake (174.138.48.153:2301).
[info] Received version (174.138.48.153:2301): version=70014 height=1426 services=111 agent=/decentraland:1.0.0-alpha/
[info] Received 1 addrs (hosts=21, peers=5) (174.138.48.153:2301).
[debug] Refilling peers (5/8).
[debug] Connecting to 88.182.41.26:2301.
[debug] Connecting to 138.197.103.55:2301.
[debug] Connecting to 196.52.39.31:2301.
[debug] Sending 20 addrs to peer (174.138.48.153:2301)
[debug] Received verack (174.138.48.153:2301).
[info] Initializing compact blocks (174.138.48.153:2301).
[debug] Requesting headers packet from peer with getheaders (174.138.48.153:2301).
[debug] Height: 1303, Hash: 00000009183fcc90092dc5588c6e64192d04b0470248ee0ead4560e99f0143d8, Stop: null
[info] Connected to 138.197.103.55:2301.
[info] Attempting BIP151 handshake (138.197.103.55:2301).
[debug] Received headers packet with 123 items (174.138.48.153:2301).
[debug] Received 123 headers from peer (174.138.48.153:2301).
[debug] Requesting 1/1 blocks from peer with getdata (174.138.48.153:2301).
[debug] Refilling peers (6/8).
[debug] Connecting to 174.138.48.153:2301.
[debug] Connecting to 173.239.232.36:2301.
[info] Connected to 174.138.48.153:2301.
[info] Attempting BIP151 handshake (174.138.48.153:2301).
[warning] WARNING: Reorganizing chain.
[error] Number exceeds 2^53-1
{ AssertionError [ERR_ASSERTION]: Number exceeds 2^53-1
    at Object._read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/encoding.js:161:3)
    at Object.read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/encoding.js:175:19)
    at BufferReader.read64 (/home/berry/sft/land-bronze/bronzeage-node/lib/utils/reader.js:332:18)
    at Output.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/primitives/output.js:259:15)
    at Object.decompressOutput [as output] (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/compress.js:74:10)
    at UndoCoin.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:298:14)
    at Function.fromReader (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:321:25)
    at UndoCoins.fromRaw (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:100:30)
    at Function.fromRaw (/home/berry/sft/land-bronze/bronzeage-node/lib/coins/undocoins.js:112:26)
    at ChainDB.getUndoCoins (/home/berry/sft/land-bronze/bronzeage-node/lib/blockchain/chaindb.js:973:20)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '==' }
eordano commented 7 years ago

Confirmed it happens on my nodes as well

eordano commented 7 years ago

Current workaround for me is deleting the data/testnet/chain.ldb directory

ghost commented 7 years ago

Will controlled tiles be OK if you do that?

eordano commented 7 years ago

yes, make sure you don't delete your private keys, they sit in data/testnet/walletdb.ldb

ghost commented 7 years ago

OK, going to try it.

ghost commented 7 years ago

Worked for me too. The chain synced very quickly and got past where it was stuck.