Git Product home page Git Product logo

iavl's Introduction

Rollkit

Rollkit is the first soveriegn rollup framework. For more in-depth information about Rollkit, please visit our website.

build-and-test golangci-lint Go Report Card codecov GoDoc

Using Rollkit

Rollkit CLI

The easiest way to use rollkit is via the rollkit CLI.

Requires Go version >= 1.22.

A cli tool that allows you to run different kinds of nodes for a rollkit network while also helping you generate the required configuration files

Install

To install rollkit, simply run the following command at the root of the rollkit repo

make install

The latest Rollkit is now installed. You can verify the installation by running:

rollkit version

Quick Start

You can spin up a local rollkit network with the following command:

rollkit start

Explore the CLI documentation here

Building with Rollkit

Rollkit is the first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.

Check out our tutorials on our website.

Contributing

We welcome your contributions! Everyone is welcome to contribute, whether it's in the form of code, documentation, bug reports, feature requests, or anything else.

If you're looking for issues to work on, try looking at the good first issue list. Issues with this tag are suitable for a new external contributor and is a great way to find something you can help with!

See the contributing guide for more details.

Please join our Community Discord to ask questions, discuss your ideas, and connect with other contributors.

Helpful commands

# Run unit tests
make test

# Generate protobuf files (requires Docker)
make proto-gen

# Run linters (requires golangci-lint, markdownlint, hadolint, and yamllint)
make lint

# Lint protobuf files (requires Docker and buf)
make proto-lint

Tools

  1. Install golangci-lint
  2. Install markdownlint
  3. Install hadolint
  4. Install yamllint

Dependency graph

To see our progress and a possible future of Rollkit visit our Dependency Graph.

Audits

Date Auditor Version Report
2024/01/12 Informal Systems eccdd...bcb9d informal-systems.pdf
2024/01/10 Binary Builders eccdd...bcb9d binary-builders.pdf

iavl's People

Contributors

adityasripal avatar alexanderbez avatar cloudhead avatar cwgoes avatar dependabot-preview[bot] avatar dependabot[bot] avatar ebuchman avatar erikgrinaker avatar ethanfrey avatar facundomedica avatar faddat avatar jaekwon avatar jlandrews avatar liamsi avatar luohaha avatar melekes avatar odeke-em avatar p0mvn avatar phomer avatar rickyyangz avatar rigelrozanski avatar robert-zaremba avatar tac0turtle avatar tessr avatar tnachen avatar valardragon avatar yihuang avatar yun-yeo avatar zmanian avatar zramsay avatar

Stargazers

 avatar  avatar

Watchers

 avatar

iavl's Issues

Add deep trees for IAVL, for fraud proofs and stateless execution

This should be done in a separate branch eg (deepiavl), as we shouldn't assume this will be merged into iavl upstream.

How to add deep trees:

  1. Add a DeepTree (deep_tree.go) that inherits or extends MutableTree
  2. Modify this Verify function and the functions it calls to add a DeepTree instance as an (optional) parameter, all the way down the stack into computeRootHash
  3. In pathWithLeaf.computeRootHash and pathToLeaf.computeRootHash, every time a hash for a leaf or a node is computed, add it to to the nodeCache in the nodeDB of the MutableTree of the DeepTree (or your own custom cache/map), by creating new Node() object with nil left and right nodes
  4. After a range proof is verified with Verify(), DeepTree should loop through all the the entries in nodeCache to populate Node objects with pointers to their respective left and right Node objects, where available (you can also do this step inside computeRootHash instead of doing it after, as well)
  5. You can now call Set() in MutableTree with the root node to update values in the deep tree (you'll need to set the ImmutableTree's root first), and call Hash() in MutableTree's ImmutableTree to get the root hash

Tracking:

Add randomized tests for adding/removing keys

Reference comment: #8 (comment)

We'd like to add randomized tests for Set and Remove that add new keys and delete existing keys respectively. Mainly, we'd like to make sure that Deep Subtrees are constructed with all the data they might need to rebalance correctly when new keys are added or existing keys are removed.

Light fuzzing in the tests might be useful as well.

Suggested tests:

  • Batch-add random keys.
  • Randomize both the operations, Set and Remove, and the keys they are operating on so calls to both are interleaved together in no particular order.

Make sure the tree rebalances correctly at each stage (check against existing IAVL tree: mutable tree).

Overall, the goal of this issue is to have strong substantial tests for an IAVL Deep Subtree.

Use Witness Data generated by IAVL tree in Deep Subtrees

We'd like to be able to load Witness Data generated in #19 in a Deep Subtree and later on be able to perform all operations recorded in the Witness Data.

When an operation is performed on the Deep Subtree, it should first check that the operation matches the current operation in the Witness Data that hasn't been performed. Also, we should verify all the existence proofs inside the Witness Data to make sure they match up with the root hash of the Deep Subtree at any point.

Parent issue: #19

Generate Witness Data in IAVL tree by tracing operations

We'd like to add tracing for keys accessed in the IAVL tree along with the operation itself during the following operations:

  • Set
  • Get
  • Remove

For each operation above, the keys accessed should be used to generate the existence proofs needed for performing the said operation.

Overall, after performing a bunch of operations, an IAVL tree should have the following struct inside it to record all the operations and existence proofs required for each operation:

type WitnessData struct {
	Operation Operation
	Key       []byte
	Value     []byte
	Proofs    []*ics23.ExistenceProof
}

Also, add an option to enable/disable tracing in an IAVL tree.

Add initial root hash in Deep Subtree

A Deep Subtree should be able to be initialized with an initial root hash since the root is set to nil for an empty Deep Subtree. However, if a non-nil root exists in the Deep Subtree, it should have priority over the initial root hash and the working hash of the Deep Subtree should be used as the root hash.

Add setters and getters for initial root hash along with using it in verifyOperation and buildTree.

Parent issue: #20

Rebase Deep Subtree changes on top of a 0.19.x release

The current deep subtree changes are made on top of a branch forked off of an IAVL version before the dragonberry exploit took place. We want to rebase these changes on top of a newer version post dragonberry fix.

Create deep tree structure using an ICS23-style approach: Updates

Create a Deep Subtree structure that supports value updates of existing leaf nodes using their key

Steps:

  • DeepTree structure is introduced
  • Nodes can be added to the underlying NodeDB of a DeepTree
  • Tree structure is properly linked (by pointers in Node objects) using NodeDB
  • Root of underlying ImmutableTree is set properly
  • Override Set to support value updates of existing leaf nodes using corresponding keys
  • Write unit tests that test value updates. Example here: https://ethresear.ch/t/data-availability-proof-friendly-state-tree-transitions/1453/23

Support Adds in a Deep Subtree

We need to support adds in a Deep Subtree, because a transaction being fraud-proven may add keys.

Description of how to do it here: #1 (comment)

Note that there is extra data that needs to go into the proof for this in order to allow IAVL to have the data it needs to do rebalancing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.