question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changes to `Chain.import_block`

See original GitHub issue

Blocks: 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:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
glaksmonocommented, Jun 1, 2018

Already confirmed with @voith that I will take on this task 🍴

1reaction
carvercommented, May 24, 2018

With HeaderDB, we ended up also returning a list of dropped headers on re-org, right? That might make sense here, too.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found