-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File blockchain_header gets corrupted #6
Comments
do you have old data inside your electrum folder? if so can you still reproduce with everything disabled I was not able to reproduce with the latest master. Could you please try again |
no old data in folder .electrum-xvg. new test with master branch: |
reason crash: variable target is str/undefined 540 def chainwork_of_header_at_height(self, height: int) -> int: 494 def get_target(self, index: int) -> int: h,t ---> t = undefined, because of file checkpoints.json (index[0]) [ |
Well we have to somehow adjust targeting for sure. Right now I've disabled the target checks in electrum since bitcoin got a quite easy approach to check em but we have a huge calculcation for upcoming targets and also do we have retargeting each and every block instead of once every 2016 Blocks. Seems like a huge task to get this all done, but it's also quite necessary in order to ensure a solid working product. |
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.
The text was updated successfully, but these errors were encountered: