DeFiCh / ain

DeFi Blockchain - enabling decentralized finance on Bitcoin
https://defichain.com
MIT License
408 stars 122 forks source link

Node faced an MintTokenTx error and was on the wrong chain #1734

Closed DanielZirkel closed 1 year ago

DanielZirkel commented 1 year ago

What happened:

I had some issues synchronizing my node. With the help of Kügi we realized that my node was on a wrong chain. image Here you see the blocks and the invalid block hash. After reconsiderblock 9b71c783e9eebf9939c169dc2b5b18bc346c0b0fea19c9055e4e4f04363514a4 the chain was rolled back and is now synchronizing again. I looks like more people are on this wrong chain and also masternodes minting new blocks.

Here are the relevant lines from my log-file for your analysis:

2023-01-30T17:09:54Z UpdateTip: new best=a3073320d98e68dd15907265b625092f99f64b069329bcebf987ee4aef0e3d71 height=2631032 version=0x20000000 log2_work=87.073868 tx=20614344 date='2023-01-30T07:01:38Z' progress=0.999674 cache=1.0MiB(7712txo)
2023-01-30T17:09:55Z ERROR: ConnectBlock: ApplyCustomTx on 32c70141b4da3129d353c024d58f381257701a0a1c8a22901f151002dd952d12 failed with MintTokenTx: deserialization failed: excess 1 bytes
2023-01-30T17:09:55Z InvalidChainFound: invalid block=9b71c783e9eebf9939c169dc2b5b18bc346c0b0fea19c9055e4e4f04363514a4  height=2631033  log2_work=87.073869  date=2023-01-30T07:02:34Z
2023-01-30T17:09:55Z InvalidChainFound:  current best=a3073320d98e68dd15907265b625092f99f64b069329bcebf987ee4aef0e3d71  height=2631032  log2_work=87.073868  date=2023-01-30T07:01:38Z
2023-01-30T17:09:55Z ERROR: ConnectTip: ConnectBlock 9b71c783e9eebf9939c169dc2b5b18bc346c0b0fea19c9055e4e4f04363514a4 failed, bad-custom-tx (code 68)
2023-01-30T17:09:55Z InvalidChainFound: invalid block=07da83baf64f116a34c4fd0c850ab290be666c65708b83a35c971905a627b1db  height=2631053  log2_work=87.073892  date=2023-01-30T07:09:46Z
2023-01-30T17:09:55Z InvalidChainFound:  current best=a3073320d98e68dd15907265b625092f99f64b069329bcebf987ee4aef0e3d71  height=2631032  log2_work=87.073868  date=2023-01-30T07:01:38Z
2023-01-30T17:10:23Z rebuildAccountsView: Remove conflicting TX: 3ff1d7e2cd644026eb9590efb5ed763afb664eee9b060fc221f20bf313d2239d

What you expected to happen:

Staying on the right chain and a smooth synchronizing

How to reproduce it (as minimally and precisely as possible):

What are your environment parameters:

I used the node version 3.2.2 and updated later on 3.2.3

Anything else we need to know?:

defichain-bot commented 1 year ago

@DanielZirkel: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details I am a bot created to help the [DeFiCh](https://github.com/DeFiCh) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/DeFiCh/ain/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [DeFiCh/oss-governance-bot](https://github.com/DeFiCh/oss-governance-bot) repository.
Bushstar commented 1 year ago

This specific error would relate to a pre-GrandCentralEpilogue client that is not aware of the additional mint tokens field.

ConnectBlock: ApplyCustomTx on 32c70141b4da3129d353c024d58f381257701a0a1c8a22901f151002dd952d12 failed with MintTokenTx: deserialization failed: excess 1 bytes

Data for this TX is...

446654784d017c000000009435770000000000

...which means...

DfTx Minttoken - one balance - token 124 - amount 20 - empty to field

...it is the empty to field that pre-GrandCentralEpilogue clients will fail on.

A staking node could have failed to update in time and created a fork that some people are now ending up on.

Stonygan commented 1 year ago

Today another person had the same problem and it looks like he is not alone on this chain:

~/.defi/defi-cli getactivemasternodecount 2000
1243
prasannavl commented 1 year ago

Closing this, and it's no longer relevant and was caused by incorrect networks. Please reopen if these issues are being faced again.