xuperchain / xuperchain

A highly flexible blockchain architecture with great transaction performance.

Home Page:https://xuper.baidu.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recover consensus transaction unexpectedly with small probability

zhugelianglongming opened this issue · comments

commented

Brief of the issue

Revoke vote transaction failed, 3 node has different TDPoS info(The precessed node is different).

Your environment

  • XuperChain: v5.3
  • OS/Go/gcc version etc

Reproduce steps

Env: 3 nodes

{
    "genesis_consensus": {
        "name": "tdpos",
        "config": {
            "timestamp": "1559021720000000000",
            "proposer_num": "2",
            "period": "3000",
            "alternate_interval": "3000",
            "term_interval": "6000",
            "block_num": "20",
            "vote_unit_price": "1",
            "init_proposer": {
                "1": [
                    "TeyyPLpp9L7QAcxHangtcHTu7HUZ6iydY",
                    "SmJG3rH2ZzYQ9ojxhbRCPwFiE9y6pD1Co"
                ]
            },
            "init_proposer_neturl": {
                "1": [
                    "/ip4/127.0.0.1/tcp/47101/p2p/Qmf2HeHe4sspGkfRCTq6257Vm3UHzvh2TeQJHHvHzzuFw6e",
                    "/ip4/127.0.0.1/tcp/47102/p2p/QmQKp8pLWSgV4JiGjuULKV1JsdpxUtnDEUMP8sGaaUbwVL"
                ]
            }
        }
    }
}
  1. nominate 3 nodes
  2. vote 3 nodes
    • node1: 100 votes
    • node2: 200 votes
    • node3: 300 votes
  3. revoke 150 votes for node2, and make this transaction recovered

Expected behaviours

Validators changes to [node1, node3] after 2 terms.

What actually happened

  • Validator are [node2, node3]
  • revoke vote transaction has not packaged in any block

Describe what actually happened. Include the full traceback if there was an exception.

Additional information

Additional helpful information, including but not limited to:

  • Logs
  • Screenshot
  • Minimal, complete, and verifiable example codes

This also helps check that the issue is not with your own code.