Changes to `Chain.import_block`
See original GitHub issueBlocks: https://github.com/ethereum/py-evm/issues/733
What is wrong?
Currently chain.import_block(..)
returns the block that was imported. Sometimes, this will cause a chain re-org, but this API doesn’t expose sufficient information to determine this.
How can it be fixed
Change Chain.import_block
to return two iterables:
- blocks which are new to the canonical chain.
- blocks which were previously part of the canonical chain (but no longer are).
With this, callers can inspect the return value and determine that a re-org happened when more than a single block is returned.
This will also require changing ChainDB.persist_block
to return the same data format, an iterable of blocks which are part of the new canonical chain.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
when i use export-blocks and import-blocks history ... - GitHub
After opening 4 nodes locally and importing the corresponding keys, here is the command corresponding to opening the first node. custom-chain -- ...
Read more >How Blockchain will change Import Export and Global Trade
Blockchain technology has the potential to revolutionize Global Trade and the import export process. Warwick from BeefLedger explains what ...
Read more >Block import crashes on block where authorities have changed
We recently upgraded our chain from substrate V3 to polkadot-0.9.24. When we try to sync a node from 0, the block import fails...
Read more >Revert a Chain to a Previous Block - HackMD
Note, the chain spec is not set here. ./target/release/node-template import-blocks -d /tmp/import-alice --pruning archive < /tmp ...
Read more >Import or export chains between workspaces - Workiva Support
The chains in your workspace can be exported to a .chain file and shared with users in another workspace, environment, or organization.
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
Already confirmed with @voith that I will take on this task 🍴
With HeaderDB, we ended up also returning a list of dropped headers on re-org, right? That might make sense here, too.