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.

Switch to `BinaryTrie` state

See original GitHub issue

What is wrong?

Shard chains use BinaryTrie for better efficiency. See https://github.com/ethereum/wiki/wiki/Wishlist#trie

How can it be fixed

  1. Set BinaryTrie as the default trie of FlatTrieBackend.
  2. Apply FlatTrieBackend in most sharding tests.

Will switch transaction trie and receipt trie in other tickets.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
NIC619commented, Jan 22, 2018

The reason being is that different backends result in different state roots. So the original protocol will keep using NestedTrieBackend, the sharding one will only use FlatTrieBackend.

Ahh I see. I was under the wrong impression. If this is the case, then there won’t be a consensus failure problem.

And if sharing will only use FlatTrieBackend then I suppose we can just have touch_account raise NotImplementedError if used and remove the code that use it:

class ShardingComputation(BaseComputation):
    def apply_message(self):
        ...
        with self.vm_state.state_db() as state_db:
            state_db.touch_account(self.msg.storage_address)
        ...
1reaction
jannikluhncommented, Jan 22, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Extended Binary Tree - GeeksforGeeks
Extended binary tree is a type of binary tree in which all the null sub tree of the original tree are replaced with...
Read more >
Ethereum state tree format change using an overlay - Medium
This overlay tree is a binary tree, and its role is to hold all the changes happening to the state, until the base...
Read more >
Binary Search Trees: BST Explained with Examples
The BST is built on the idea of the binary search algorithm, which allows for fast lookup, insertion and removal of nodes.
Read more >
Binary Trees - andrew.cmu.ed
A binary tree is made of nodes, where each node contains a "left" ... Trees are very flexible data, allowing to move subtrees...
Read more >
Binary tree - Wikipedia
tree data structure in which each node has at most two children, which are referred to as the left child and the right...
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