Code Monkey home page Code Monkey logo

dalc's Introduction

Data Availability Light Client

The dalc serves as a bridge between rollups or celestia. This involves sampling block data to check for availability, submitting rollup blocks, retrieving rollup blocks, and performing typical light client functionality.

dalc's People

Contributors

adlerjohn avatar dependabot[bot] avatar evan-forbes avatar jbowen93 avatar tzdybal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dalc's Issues

Initial repo structure

Implement the basic structure for the repo including but not limited to

  • basic readme
  • basic github workflows
  • basic Makefile
  • minimal config (yet another config file ๐Ÿ˜ฌ)

Implement GRPC server

Add the bare bones GRPC server that can be configured to server to an optimint node. It should follow the interface defined here along with the BlockRetriever interface. See the mocked version in optimint. Note that this issue only covers creating the basic structure of the server, not actually implementing the core functionality of each rpc endpoint.

Incorrect handling of `ipld.ErrNotFoundInRange`

celestia-node returns ipld.ErrNotFoundInRange when GetSharesByNamespace is not able to find any shares in given namespace.
From Optimint point of view it's not an error - it's just a situation.

We need to handle this correctly, so optimint can continue processing next blocks, instead of retrying.

Refactor celestia-node usage

Currently, we are downloading the entire block to create the DataAvailabilityHeader in order to DAS. This obviously defeats the purpose of DAS, and was added a few months ago before celestia-node had implemented the ability to gossip headers. We want to change that, and actually use celestia-node properly.

  • Stop downloading the entire block to create the DAH
  • Use celestia-node to gossip headers, DAS properly, retrieve optimint blocks properly

Use a KV store to map heights between optimint blocks

Currently, we are using a json map to keep track of optimint heights and their corresponding celestia heights. As discussed in #17, we want to use something more robust, like a standard KV store.

This will better position the DALC to keep optimint platform agnostic, and offload some responsibility as well.

  • Replace HeightMapper's in memory map with a KV store

Stop assuming that there is only one message in a namespace

Currently, when the dalc attempts to find optimint blocks, it assumes that there is only a single message in the namespace. We should changes this so that optimint does not miss blocks if there are more than one message in a namespace.

dalc/server/server.go

Lines 204 to 206 in d62d3a2

if len(msgs.MessagesList) != 1 {
return nil, fmt.Errorf("only expected a single message: got %d", len(msgs.MessagesList))
}

This will also require changing the response of the RetrieveBlock method to return multiple optimint blocks

message RetrieveBlockResponse {
DAResponse result = 1;
optimint.Block block = 2;
}

Initial devnet DALC Implementation

It was decided in #142 that we will separate out the data availability light client from optimint and into it's own repo. Fortunately, a sizable chunk of the core logic needed for the first devnet implementation has already been written. However, there is still some work needed to be done. Notably, we still need a to query application specific data (see our old planned implementation), and decide precisely how we plan on performing DAS (see old ValidateAvailability func)

Optimint block is out of order

When reading data from Celestia, DALC may encounter a situation, when height of newly found block is not equal to height of current block +1.

For example:

  • after block n, there is block n+2 - block n+1 is missing, or blocks are reordered
  • after block n, there is block n-1 - this might be a duplicate or invalid block

Automated CHANGELOG.md check for dalc

There should be an automated step that ensures that a CHANGELOG.md file is appropriately updated for all merges to the main branch.

There should be a proper description in an issue and corresponding PR as well as a summary in the CHANGELOG.md file. This will be enforced through an automated action. In rare cases for small PRs it may be acceptable to skip this.

Account sequence mismatch while publishing block

Summary of Bug

Yesterday I found following error in the logs in Optimint:

7:18PM ERR error while publishing block error="DA layer submission failed: failed to submit tx: code 32: account sequence mismatch, expected 14615, got 14614: incorrect account sequence" module=BlockManager

Version

@evan-forbes please confirm which version of DALC was used on your server.

Steps to Reproduce

I'm not able to reproduce. This error occurred when my server was severely overloaded (but TBH I don't see how this could affect execution).


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Create a short term solution to the dalc

We have discussed that long term, we will move the three methods currently served via the dalc will be served via a standard celestia-node instead celestiaorg/celestia-node#414 (comment) celestiaorg/celestia-node#414 (comment).

However, optimint's multi aggregator node network is blocked by these features, so a short term solution is in order so that we can continue building that.

One possible solution was to create a branch on celestia-node that incorporates a slightly more generalized version of the dalc server, and another is to use the preexisting Plugin implementation #55

Add normal tendermint light client functionality

Along with being responsible for data availability sampling, we also need the DALC to act as a tendermint light client. Ideally we would port all of the typical tendermint LC functionality here, but at the very least we will need to ability to:

  • verify the signatures for a given commit
  • sync headers from a specific height and trusted header hash

Add extra verification for the submit block method

Currently, the dalc will sign and submit any block that pushed through the SubmitBlock rpc endpoint.

That is terrible for many reasons, and we should add different verification mechanisms to protect against simple mistakes or malicious parties.

  • check optimint commit sig before signing and submitting the optimint block

related to #161

Fully functional DALC - tracking issue

This is a tracking issue for fully functional Celestia DALC, required for testnet.

Block submission is ready. Now we need to finish block retrieval and data availability checks. Discussion #24 summarize how we should proceed.

`height_map.json` is not created

dalc init returns:

Error: open /home/<username>/height_map.json: no such file or directory

This file should be created during the init phase.

Add minimal documentation

The readme needs minimal documentation and a simple overview diagram of how this repo relates to optimint, app/core, and node (could even be hand-drawn).

Add ability to query application specific data

Per the original ADR in the celestia-core, we need to have the ability to retrieve the data from a specific namespace for a given block. We had planned a previous implementation here, but our plans were in limbo and we never completed it. Further discussion is needed as to exactly how we should implement this functionality, and in which repo the implementation should reside.

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.