Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Adjust start_sync_block to receive all the events #411

Open
loredanacirstea opened this issue Jan 29, 2018 · 1 comment
Open

Adjust start_sync_block to receive all the events #411

loredanacirstea opened this issue Jan 29, 2018 · 1 comment

Comments

@loredanacirstea
Copy link
Contributor

Currently, when trying to get all events fromBlock, some of them are missing and you need to set fromBlock = block_number - delta. We need to find a small enough delta in order to receive all the events, but big enough to work with warped chains.

Error example:

DEBUG:channel_manager:setting up channel manager, receiver=0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983 channel_contract=0x74434527b8E6C8296506D61d0faF3D18c9e4649A 
INFO:blockchain:starting blockchain polling (interval 2s) 
DEBUG:blockchain:filtering for events u:2507630-2545243 c:2507630-2545242 @2545243 
DEBUG:blockchain:received unconfirmed ChannelCreated event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507921) 
INFO:channel_manager:unconfirmed channel event received (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block_number 2507921) 
DEBUG:blockchain:received unconfirmed ChannelCreated event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507952) 
INFO:channel_manager:unconfirmed channel event received (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block_number 2507952) 
DEBUG:blockchain:received unconfirmed ChannelCreated event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508285) 
INFO:channel_manager:unconfirmed channel event received (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block_number 2508285) 
DEBUG:blockchain:received unconfirmed ChannelCreated event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297) 
INFO:channel_manager:unconfirmed channel event received (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block_number 2508297) 
DEBUG:blockchain:received unconfirmed ChannelCreated event (sender 0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983, block number 2509129) 
INFO:channel_manager:unconfirmed channel event received (sender 0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983, block_number 2509129) 
DEBUG:blockchain:received ChannelOpened event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507921) 
INFO:channel_manager:new channel opened (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507921) 
DEBUG:blockchain:received ChannelOpened event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507952) 
INFO:channel_manager:new channel opened (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507952) 
DEBUG:blockchain:received ChannelOpened event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508285) 
INFO:channel_manager:new channel opened (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508285) 
DEBUG:blockchain:received ChannelOpened event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297) 
INFO:channel_manager:new channel opened (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297) 
DEBUG:blockchain:received ChannelOpened event (sender 0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983, block number 2509129) 
INFO:channel_manager:new channel opened (sender 0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983, block number 2509129) 
DEBUG:blockchain:received top up event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297, deposit 3000000000000000000) 
INFO:channel_manager:Registering unconfirmed deposit top up (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297, added 3000000000000000000) 
DEBUG:blockchain:received top up event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297, added deposit 3000000000000000000) 
INFO:channel_manager:Registering deposit top up (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2508297, added deposit 3000000000000000000) 
DEBUG:blockchain:received ChannelSettled event (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507900) 
INFO:channel_manager:Forgetting settled channel (sender 0x103eddCA006c3776Fc1a9eD5D26aA5b96f206b6E, block number 2507900) 
Traceback (most recent call last):
  File "/Users/loredana/ETH/kondron/env/lib/python3.6/site-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/loredana/ETH/kondron/env/lib/python3.6/site-packages/microraiden/channel_manager/blockchain.py", line 54, in _run
    self._update()
  File "/Users/loredana/ETH/kondron/env/lib/python3.6/site-packages/microraiden/channel_manager/blockchain.py", line 233, in _update
    self.cm.event_channel_settled(sender, open_block_number)
  File "/Users/loredana/ETH/kondron/env/lib/python3.6/site-packages/microraiden/channel_manager/manager.py", line 202, in event_channel_settled
    self.state.del_channel(sender, open_block_number)
  File "/Users/loredana/ETH/kondron/env/lib/python3.6/site-packages/microraiden/channel_manager/state.py", line 363, in del_channel
    assert self.channel_exists(sender, open_block_number)
AssertionError
Mon Jan 29 13:12:51 2018 <Blockchain at 0x10b031af8> failed with AssertionError
@LefterisJP
Copy link
Contributor

As discussed this really sounds like a geth bug. It really should be reported upstream.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants