ElementsProject / elements

Open Source implementation of advanced blockchain features extending the Bitcoin protocol
MIT License
1.05k stars 375 forks source link

Federated Sidechain, 2 chaintips #823

Open nharmon9 opened 4 years ago

nharmon9 commented 4 years ago

I have a federated sidechain elements regtest running on my main computer and on a VM which connects to a node on the main computer. The VM node has 2 chain tips and has the shorter chain as the active chain, while the main node only has the one tip.

stevenroose commented 4 years ago

Are you running elementsregtest with default parameters? Could you paste the two chain tips the node is reporting? I'd strongly suggest trying to not use the default chain, even for testing, if you're setting up multiple machines. This can easily be done by renaming your chain with -chain=myspecialregtest. This chain name is committed to in the genesis block so you can't accidentally get chains from other regtest nodes that mess up your testing.

nharmon9 commented 4 years ago

I think the problem occurred around the time when I was pegging in some mainchain coins but never claimed them, I don't know if this is related.

[
  {
    "height": 273,
    "hash": "3af923edb478398d8088cb56baa628ec5457300845d8f3c10d3e1ffa2b873cfa",
    "branchlen": 26,
    "status": "invalid"
  },
  {
    "height": 247,
    "hash": "10f44cb4922d28ee827049695efc49eccca27296745a091c9617b01327dc69dd",
    "branchlen": 0,
    "status": "active"
  }
]
stevenroose commented 4 years ago

If you never claim a pegin, the sidechain doesn't know about its existence, right? So that can impossibly have any effects here.

It says that the chain is invalid, though. Do you remember if you created that chain or if it just suddenly occurred? Are your regtest nodes listening on a publicly accessible interface?

On Tue, Feb 25, 2020 at 8:00 PM nharmon9 notifications@github.com wrote:

I think the problem occurred around the time when I was pegging in some mainchain coins but never claimed them, I don't know if this is related.

[ { "height": 273, "hash": "3af923edb478398d8088cb56baa628ec5457300845d8f3c10d3e1ffa2b873cfa", "branchlen": 26, "status": "invalid" }, { "height": 247, "hash": "10f44cb4922d28ee827049695efc49eccca27296745a091c9617b01327dc69dd", "branchlen": 0, "status": "active" } ]

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ElementsProject/elements/issues/823?email_source=notifications&email_token=AAGQLXA3NMTGP7SRSWEMPDLREV2EPA5CNFSM4KZKKBIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM5JDCI#issuecomment-591040905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQLXDVBSLAW4LK3ZJ2CCDREV2EPANCNFSM4KZKKBIA .

nharmon9 commented 4 years ago

The invalid chain tip and the valid chain tip from this VM nodes perspective are both valid blocks in the other Host nodes chain with the invalid tip in the above comment being the only chain tip for the Host node. When I do getpeerinfo both the VM and Host nodes show each other but they often lose each other for one reason or another.