What happens to log events in the event of a fork?

tom_seddontom_seddon Member Posts: 4
edited September 2015 in Geth - Go Implementation
(I think this is a client question, rather than one for the web3-js or solidity sections...)

What happens to events if there's a fork? Suppose you've received events up to a given block, and it turns out that your client has been on the wrong fork. I assume - since I've never seen this actually happen on my little testnet - lack of forks is a benefit of only having 1 node :) - that in this situation the tip of your client's history suddenly changes as the consensus changes. Does geth then run through the logs in the new tip in such a way that you'll get events for them?

Imagine you'd received events up to block 1000, and then it turned out things had forked at block 990. You were on the wrong fork, and so you receive replacements for blocks 991-1000. So, one moment you have a particular set of blocks 991-1000, and the next moment you have a new set. Will you then get events for the new blocks 991-1000?

Thanks,

--Tom

P.S. is there any easy way to induce a fork for testing stuff like this?

Comments

Sign In or Register to comment.