Skip to content

File blockchain_header gets corrupted #6

@swat69

Description

@swat69

Electrum version v4 alpha2 : #a53a8db

after a few minutes, the run_electrum ls logging this error in the console and the connection is lost to the server:

E/i | interface.[electrum.marpmedev.xyz:50002] | Exception in wrapper_func: TypeError("unsupported operand type(s) for -: 'int' and 'str'",)
Traceback (most recent call last):
File "/home/ben/electrum2/electrum/util.py", line 988, in wrapper
return await func(*args, **kwargs)
File "/home/ben/electrum2/electrum/interface.py", line 334, in wrapper_func
return await func(self, *args, **kwargs)
File "/home/ben/electrum2/electrum/interface.py", line 358, in run
await self.open_session(ssl_context)
File "/home/ben/electrum2/electrum/interface.py", line 465, in open_session
await group.spawn(self.monitor_connection)
File "/home/ben/.local/lib/python3.6/site-packages/aiorpcx/curio.py", line 242, in aexit
await self.join()
File "/home/ben/.local/lib/python3.6/site-packages/aiorpcx/curio.py", line 211, in join
raise task.exception()
File "/home/ben/electrum2/electrum/interface.py", line 502, in run_fetch_blocks
await self._process_header_at_tip()
File "/home/ben/electrum2/electrum/interface.py", line 514, in _process_header_at_tip
_, height = await self.step(height, header)
File "/home/ben/electrum2/electrum/interface.py", line 572, in step
return await self._resolve_potential_chain_fork_given_forkpoint(good, bad, bad_header)
File "/home/ben/electrum2/electrum/interface.py", line 622, in _resolve_potential_chain_fork_given_forkpoint
b = forkfun(bad_header) # type: Blockchain
File "/home/ben/electrum2/electrum/blockchain.py", line 264, in fork
self.save_header(header)
File "/home/ben/electrum2/electrum/blockchain.py", line 188, in func_wrapper
return func(self, *args, **kwargs)
File "/home/ben/electrum2/electrum/blockchain.py", line 447, in save_header
self.swap_with_parent()
File "/home/ben/electrum2/electrum/blockchain.py", line 357, in swap_with_parent
if not self._swap_with_parent():
File "/home/ben/electrum2/electrum/blockchain.py", line 375, in _swap_with_parent
if self.parent.get_chainwork() >= self.get_chainwork():
File "/home/ben/electrum2/electrum/blockchain.py", line 188, in func_wrapper
return func(self, *args, **kwargs)
File "/home/ben/electrum2/electrum/blockchain.py", line 565, in get_chainwork
work_in_single_header = self.chainwork_of_header_at_height(cached_height)
File "/home/ben/electrum2/electrum/blockchain.py", line 544, in chainwork_of_header_at_height
work = ((2 ** 256 - target - 1) // (target + 1)) + 1
TypeError: unsupported operand type(s) for -: 'int' and 'str'
E/i | interface.[electrum.marpmedev.xyz:50002] | Exception in wrapper_func: AssertionError((0, 1),)
Traceback (most recent call last):
File "/home/ben/electrum2/electrum/util.py", line 988, in wrapper
return await func(*args, **kwargs)
File "/home/ben/electrum2/electrum/interface.py", line 334, in wrapper_func
return await func(self, *args, **kwargs)
File "/home/ben/electrum2/electrum/interface.py", line 358, in run
await self.open_session(ssl_context)
File "/home/ben/electrum2/electrum/interface.py", line 465, in open_session
await group.spawn(self.monitor_connection)
File "/home/ben/.local/lib/python3.6/site-packages/aiorpcx/curio.py", line 242, in aexit
await self.join()
File "/home/ben/.local/lib/python3.6/site-packages/aiorpcx/curio.py", line 211, in join
raise task.exception()
File "/home/ben/electrum2/electrum/interface.py", line 502, in run_fetch_blocks
await self._process_header_at_tip()
File "/home/ben/electrum2/electrum/interface.py", line 514, in _process_header_at_tip
_, height = await self.step(height, header)
File "/home/ben/electrum2/electrum/interface.py", line 572, in step
return await self._resolve_potential_chain_fork_given_forkpoint(good, bad, bad_header)
File "/home/ben/electrum2/electrum/interface.py", line 622, in _resolve_potential_chain_fork_given_forkpoint
b = forkfun(bad_header) # type: Blockchain
File "/home/ben/electrum2/electrum/blockchain.py", line 264, in fork
self.save_header(header)
File "/home/ben/electrum2/electrum/blockchain.py", line 188, in func_wrapper
return func(self, *args, **kwargs)
File "/home/ben/electrum2/electrum/blockchain.py", line 444, in save_header
assert delta == self.size(), (delta, self.size())
AssertionError: (0, 1)

After deleting the file blockchain header the client is able to connect again until the error occurs again, the issue is reproducible.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions