Split processing on replay not as robust as it could be. #2417

issue jim618 opened this issue on March 28, 2013
  1. jim618 commented at 12:31 PM on March 28, 2013: none

    This week I have been adding block replay into MultiBit for the bcj 0.8-MASTER code. I have it working but it is not as robust as it could be.

    The main area is of trouble is the AbstractBlockChain#findSplit and related methods. This is typical:

    14:02:25.127 [New I/O worker #2] WARN com.google.bitcoin.core.Peer - [80.218.174.253]:8333 - java.lang.NullPointerException: Attempt to follow an orphan chain at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) ~[multibit-exe.jar:na] at com.google.bitcoin.core.AbstractBlockChain.findSplit(AbstractBlockChain.java:615) ~[multibit-exe.jar:na] at com.google.bitcoin.core.AbstractBlockChain.handleNewBestChain(AbstractBlockChain.java:524) ~[multibit-exe.jar:na] at com.google.bitcoin.core.AbstractBlockChain.connectBlock(AbstractBlockChain.java:483) ~[multibit-exe.jar:na] at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:359) ~[multibit-exe.jar:na] at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:247) ~[multibit-exe.jar:na] at com.google.bitcoin.core.Peer.endFilteredBlock(Peer.java:741) ~[multibit-exe.jar:na] at com.google.bitcoin.core.Peer.processMessage(Peer.java:257) ~[multibit-exe.jar:na] at com.google.bitcoin.core.Peer.access$400(Peer.java:48) ~[multibit-exe.jar:na] at com.google.bitcoin.core.Peer$PeerHandler.messageReceived(Peer.java:237) ~[multibit-exe.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) ~[multibit-exe.jar:na] at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) ~[multibit-exe.jar:na] at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) ~[multibit-exe.jar:na] at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) ~[multibit-exe.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) ~[multibit-exe.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) ~[multibit-exe.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) ~[multibit-exe.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) ~[multibit-exe.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) ~[multibit-exe.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) ~[multibit-exe.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[multibit-exe.jar:na] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [na:1.6.0_43] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [na:1.6.0_43] at java.lang.Thread.run(Thread.java:680) [na:1.6.0_43]

    The net result of this is that the Peer gets dropped and so you waste time creating a new one. It still works but is not ideal.

    Also to get the SPVBlockStore to replay ok I am creating a brand new SPVBlockStore on replay. If I don't, I precondition 'higher and lower are reversed' in AbstractBlockChain#getPartialChain

    Again, recreating a new blockstore works but you always end up having to sync back to the last checkpoint even though you have all the block headers since then in the SPVBlockStore. This is a bit inefficient.

    The code in the MultiBit mb-0.5-bcj-v0.8 branch is what I am working on.

  2. Diapolo commented at 1:45 PM on March 28, 2013: none

    Doesn't this belong to https://code.google.com/p/bitcoinj?

  3. jim618 commented at 2:18 PM on March 28, 2013: none

    Indeed it does ! My bad for not checking google search results more carefully. Just close it.

    On Thu, Mar 28, 2013, at 01:45 PM, Philip Kaufmann wrote:

    Doesn't this belong to https://code.google.com/p/bitcoinj?


    Reply to this email directly or view it on GitHub:

    #2417 (comment)

    https://multibit.org Money, reinvented

  4. Diapolo commented at 2:41 PM on March 28, 2013: none

    I can't, as I'm no issue-admin ;), but you can... thanks :).

  5. jim618 commented at 3:39 PM on March 28, 2013: none

    Closed - posted to wrong project.

  6. jim618 closed this on Mar 28, 2013

  7. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me