RegularChainSyncer crashes when block importing fails
See original GitHub issueSo, validate_rlp_equal()
is raising a TypeError
even though the diff between the imported block and the original one is empty and they seem to be instances of the same class, and that is causing RegularChainSyncer to crash:
DEBUG 09-25 17:02:51 ByzantiumVM BLOCK REWARD: 3000000000000000000 -> b'\x1b\xc1\xeet\x1b= GT?Yq\xadu4\x074\xc1D\x13'
DEBUG 09-25 17:02:51 RegularChainSyncer <coroutine object RegularChainSyncer._import_ready_blocks at 0x7fd3147e72b0> finished while <trinity.sync.full.chain. RegularChainSyncer object at 0x7fd3179ac940> is still running, terminating as well
WARNING 09-25 17:02:51 RegularChainSyncer Task <coroutine object RegularChainSyncer._import_ready_blocks at 0x7fd3147e7308> finished unexpectedly: block (<ByzantiumBlock(#Block #4111023)>) != imported block (<ByzantiumBlock(#Block #4111023)>) but got an empty diff
DEBUG 09-25 17:02:51 RegularChainSyncer Task failure traceback
trinity.chains.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/salgado/src/py-evm/trinity/chains/__init__.py", line 184, in wrapper
return attr(*args, **kwargs)
File "/home/salgado/src/py-evm/eth/chains/base.py", line 646, in import_block
validate_imported_block_unchanged(imported_block, block)
File "cytoolz/functoolz.pyx", line 236, in cytoolz.functoolz.curry.__call__
File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
File "/home/salgado/src/py-evm/eth/utils/rlp.py", line 65, in validate_rlp_equal
obj_b,
TypeError: block (<ByzantiumBlock(#Block #4111023)>) != imported block (<ByzantiumBlock(#Block #4111023)>) but got an empty diff
"""
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Delay, freeze, or crash, when inserting a block or drawing in ...
Issue: When trying to insert a drawing or block into a drawing in AutoCAD, the program shows a delay, freezes, or crashes.
Read more >Errors or crashes when importing from or exporting to Excel ...
Problem. When importing from Microsoft Office files or export to them, sometimes you encounter a generic "Application Error". This article lists ...
Read more >Can import cause crash/error after compilation? - Stack Overflow
Example: I have program with 3 classes: Server, Client, Main. Main has 2 imports - Server and Client. Depending on in what mode...
Read more >Kernel crashes · microsoft/vscode-jupyter Wiki - GitHub
Jupyter Kernels can crash for a number of reasons (incorrectly ... Failure to import modules, Kernel fails to start with Module not found ......
Read more >Xcode 11 debugger crashes on break… - Apple Developer
Xcode 11 debugger crashes on breakpoint, can't find Foundation.h ... #import <Foundation/Foundation.h> ^ error: failed to import bridging header ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
And the above happens because the original block (the one we want to import) is pickled (with its
._hash_cache
) and sent to a different process, but python’shash()
builtin is not stable across processes.This wasn’t a problem in the past because it was only recently that
validate_rlp_equal()
was modified to raise a TypeError when the objects don’t compare equally but the diff is emptyI can see a few alternatives to fix this:
._hash_cache
from rlp.Serializable__getstate__()
method to rlp.Serializable so we don’t pickle the._hash_cache
attributehash()
I’d be in favour of 1 as I’m not sure caching the hash of
rlp.Serializable
s provides a significant performance improvement anywhereThis issue can be closed once the
rlp
dependency has been bumped to>=1.0.3