https://github.com/bnb-chain/greenfield-iavl

A iavl fork for greenfield

https://github.com/bnb-chain/greenfield-iavl

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

A iavl fork for greenfield

Basic Info
  • Host: GitHub
  • Owner: bnb-chain
  • License: apache-2.0
  • Language: Go
  • Default Branch: master
  • Homepage:
  • Size: 9.16 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 4
  • Open Issues: 6
  • Releases: 0
Created about 3 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog Contributing License Codeowners

README.md

IAVL+ Tree

version license API Reference Lint Test Discord chat

Note: Requires Go 1.18+

A versioned, snapshottable (immutable) AVL+ tree for persistent data.

Benchmarks

The purpose of this data structure is to provide persistent storage for key-value pairs (say to store account balances) such that a deterministic merkle root hash can be computed. The tree is balanced using a variant of the AVL algorithm so all operations are O(log(n)).

Nodes of this tree are immutable and indexed by their hash. Thus any node serves as an immutable snapshot which lets us stage uncommitted transactions from the mempool cheaply, and we can instantly roll back to the last committed state to process transactions of a newly committed block (which may not be the same set of transactions as those from the mempool).

In an AVL tree, the heights of the two child subtrees of any node differ by at most one. Whenever this condition is violated upon an update, the tree is rebalanced by creating O(log(n)) new nodes that point to unmodified nodes of the old tree. In the original AVL algorithm, inner nodes can also hold key-value pairs. The AVL+ algorithm (note the plus) modifies the AVL algorithm to keep all values on leaf nodes, while only using branch-nodes to store keys. This simplifies the algorithm while keeping the merkle hash trail short.

In Ethereum, the analog is Patricia tries. There are tradeoffs. Keys do not need to be hashed prior to insertion in IAVL+ trees, so this provides faster iteration in the key space which may benefit some applications. The logic is simpler to implement, requiring only two types of nodes -- inner nodes and leaf nodes. On the other hand, while IAVL+ trees provide a deterministic merkle root hash, it depends on the order of transactions. In practice this shouldn't be a problem, since you can efficiently encode the tree structure when serializing the tree contents.

Owner

  • Name: bnb-chain
  • Login: bnb-chain
  • Kind: organization

For BNB Chain: BNB Smart Chain, BNB Beacon Chain

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 27
  • Average time to close issues: N/A
  • Average time to close pull requests: 16 days
  • Total issue authors: 0
  • Total pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 1.11
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 20
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (16)
  • pythonberg1997 (4)
  • yutianwu (2)
  • forcodedancing (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4) github_actions (4)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 17
  • Total dependent repositories: 1
  • Total versions: 2
proxy.golang.org: github.com/bnb-chain/greenfield-iavl
  • Versions: 2
  • Dependent Packages: 17
  • Dependent Repositories: 1
Rankings
Dependent repos count: 4.7%
Dependent packages count: 9.6%
Average: 13.3%
Forks count: 13.5%
Stargazers count: 25.3%
Last synced: 10 months ago