Giter VIP home page Giter VIP logo

cdk-data-availability's Introduction

CDK Data Availability

Data Availability Layer for CDK Validium

The cdk-data-availability project is a specialized Data Availability Node (DA Node) that is part of Polygon's CDK (Chain Development Kit) Validium.

Overview of Validium

For a full overview of the Polygon CDK Validium, please reference the CDK documentation.

The CDK Validium solution is made up of several components; start with the CDK Validium Node. For quick reference, the complete list of components are outlined below:

Component Description
CDK Validium Node Node implementation for the CDK networks in Validium mode
CDK Validium Contracts Smart contract implementation for the CDK networks in Validium mode
CDK Data Availability Data availability implementation for the CDK networks
Prover / Executor zkEVM engine and prover implementation
Bridge Service Bridge service implementation for CDK networks
Bridge UI UI for the CDK networks bridge

Introduction

As blockchain networks grow, the volume of data that needs to be stored and validated increases, posing challenges in scalability and efficiency. Storing all data on-chain can lead to bloated blockchains, slow transactions, and high fees.

Data Availability Nodes facilitate a separation between transaction execution and data storage. They allow transaction data to reside off-chain while remaining accessible for validation. This significantly improves scalability and reduces costs. Within the framework of Polygon's CDK, Data Availability Committees (DAC) members run DA nodes to ensure the security, accessibility, and reliability of off-chain data.

To learn more about how the data availability layer works in the validium, please see the CDK documentation here.

Off-Chain Data

The off-chain data is stored in a distributed manner and managed by a data availability committee, ensuring that it is available for validation. The data availability committee is defined as a core smart contract, available here. This is crucial for the Validium model, where data computation happens off-chain but needs to be verifiable on-chain.

Running

Instructions on how to run this software can be found here

Contact

For more discussions, please head to the R&D Discord

License

The cdk-validium-node project is licensed under the GNU Affero General Public License free software license.

cdk-data-availability's People

Contributors

arnaubennassar avatar begmaroman avatar brixial avatar christophercampbell avatar criadoperez avatar dependabot[bot] avatar djpolygon avatar goran-ethernal avatar idrishanafi avatar joanestebanr avatar johnsoncarl avatar kmurphypolygon avatar mt-polygon-technology avatar rachit77 avatar radhe-zeeve avatar rebelartists avatar salmad3 avatar socialsister avatar stefan-ethernal avatar

Stargazers

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

Watchers

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

cdk-data-availability's Issues

need to update the PolygonvalidiumMetaData abi

Problem

We were updating the cdk quickstart using the latest images:
image

when we were testing, we found L2->L1 bridging failed

Root Cause Analysis

looking into the logs, we found it's due to sequencer cannot get signature from the DAC

then we found in the DA container logs:


zkevm-data-availability  | 	{"pid": 1, "version": "0.0.6"}
zkevm-data-availability  | github.com/0xPolygon/cdk-data-availability/synchronizer.(*BatchSynchronizer).consumeEvents
zkevm-data-availability  | 	/home/runner/work/cdk-data-availability/cdk-data-availability/synchronizer/batches.go:200
zkevm-data-availability  | 2024-03-24T21:19:27.802Z	�[35mDEBUG�[0m	rpc/handler.go:93	Current open connections 1	{"pid": 1, "version": "0.0.6", "method": "datacom_signSequence", "requestId": 1}
zkevm-data-availability  | 2024-03-24T21:19:27.802Z	�[35mDEBUG�[0m	rpc/handler.go:94	request params [{"sequence":["0x0b00000004000000000b00000004000000000b00000004000000000b00000004000000000b0000000400000000"],"signature":"0x1afe896485e57bb5195d04fbcf135c743455f251ac3c994835c18531d36b7a09350a1b63509c08382f570624e3b28e5304d63c417f9452fff8f3210eb661ad951c"}]	{"pid": 1, "version": "0.0.6", "method": "datacom_signSequence", "requestId": 1}
zkevm-data-availability  | 2024-03-24T21:19:27.804Z	�[35mDEBUG�[0m	rpc/handler.go:91	Current open connections 0	{"pid": 1, "version": "0.0.6", "method": "datacom_signSequence", "requestId": 1}
zkevm-data-availability  | 2024-03-24T21:19:27.804Z	�[34mINFO�[0m	rpc/server.go:261	172.24.0.10:43762 - - [24/Mar/2024:21:19:27 +0000] "POST / HTTP/1.1" 200 181 "zkevm-data-availability:8444" "Go-http-client/1.1"	{"pid": 1, "version": "0.0.6"}
zkevm-data-availability  | 2024-03-24T21:19:30.321Z	�[31mERROR�[0m	synchronizer/batches.go:200	failed to handle event: no method with id: 0xdb5b0ed7 
zkevm-data-availability  | /home/runner/work/cdk-data-availability/cdk-data-availability/log/log.go:140 github.com/0xPolygon/cdk-data-availability/log.appendStackTraceMaybeArgs()
zkevm-data-availability  | /home/runner/work/cdk-data-availability/cdk-data-availability/log/log.go:249 github.com/0xPolygon/cdk-data-availability/log.Errorf()
zkevm-data-availability  | /home/runner/work/cdk-data-availability/cdk-data-availability/synchronizer/batches.go:200 github.com/0xPolygon/cdk-data-availability/synchronizer.(*BatchSynchronizer).consumeEvents()

looking into the code, we saw

image

and the ABI was read from https://github.com/0xPolygon/cdk-data-availability/blob/v0.0.6/etherman/smartcontracts/polygonvalidium/polygonvalidium.go

but this file was lastly updated 2 months ago. and I found that there are indeed some diffs: https://www.diffchecker.com/OLfZGyrR/

w the latest contracts code we used: https://github.com/0xPolygonHermez/zkevm-contracts/tree/v5.0.1-rc.2-fork.8

Suggested Solution

so this is what i belive we should do

  1. update the ABI in that file
  2. rebuild the cdk-data-availability docker image

Db should be moved outside DAC node

We are working on deploying CDKs and having the db as a part of the node would not work in production(maintained dbs are battle-tested).
I haven't seen any activity on this repo in a while, so I could take this up if the team finds it important.

It is recommended to modify the findContractDeploymentBlock function to obtain the block number and call eth.HeaderByNumber.

'r' value overflows uint256 is shown when starting DA program

Then I used Delve to find the error out, and I saw this code thrown the error :

> github.com/0xPolygon/cdk-data-availability/synchronizer.findContractDeploymentBlock() ./synchronizer/init.go:51 (hits goroutine(1):1 total:1) (PC: 0x1143f63)
    46:		eth, err := ethclient.DialContext(ctx, url)
    47:		if err != nil {
    48:			return nil, err
    49:		}
    50:		latestBlock, err := eth.BlockByNumber(ctx, nil)
=>  51:		if err != nil {
    52:			return nil, err
    53:		}
    54:		firstBlock := findCode(ctx, eth, contract, 0, latestBlock.Number().Int64())
    55:		return big.NewInt(firstBlock), nil
    56:	}
(dlv) p err
error(*errors.errorString) *{
	s: "'r' value overflows uint256",}
(dlv) q

I fixed it by change 'eth.BlockByNumber' to 'eth.HeaderByNumber(ctx, nil)'

image

When I got the error I am using branch 'v0.0.3', but I saw the default branch is still using 'eth.BlockByNumber'

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.