Skip to content

Commit

Permalink
Merge pull request 0glabs#20 from 0glabs/refactor
Browse files Browse the repository at this point in the history
refactor: renaming, update dependency
  • Loading branch information
MiniFrenchBread authored Mar 12, 2024
2 parents a470f1a + 7281be9 commit 98405b9
Show file tree
Hide file tree
Showing 165 changed files with 428 additions and 424 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
git diff-index --quiet HEAD && exit
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"
git remote set-url --push origin https://${{ github.token }}@github.com/zero-gravity-labs/zerog-data-avail.wiki.git
git remote set-url --push origin https://${{ github.token }}@github.com/0glabs/0g-data-avail.wiki.git
test ${{inputs.amend}} == "true" && \
git commit --amend --no-edit && git push --force-with-lease || \
git commit -m "Update coverage" && git push https://${{ github.token }}@github.com/zero-gravity-labs/zerog-data-avail.wiki.git
git commit -m "Update coverage" && git push https://${{ github.token }}@github.com/0glabs/0g-data-avail.wiki.git
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
go-version: '1.21' # The Go version to download (if necessary) and use.
- run: go version

- name: Checkout zerog-data-avail
- name: Checkout 0g-data-avail
uses: actions/checkout@v3

- name: golangci-lint
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
[submodule "contracts/lib/eigenlayer-middleware"]
path = contracts/lib/eigenlayer-middleware
url = https://github.com/Layr-Labs/eigenlayer-middleware
[submodule "zerog_storage_kv"]
path = zerog_storage_kv
url = git@github.com:zero-gravity-labs/zerog-storage-kv.git
[submodule "0g_storage_kv"]
path = 0g_storage_kv
url = git@github.com:0glabs/0g-storage-kv.git
6 changes: 3 additions & 3 deletions api/docs/disperser.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
| signatory_record_hash | [bytes](#bytes) | | The hash of all public keys of the operators that did not sign the batch. |
| fee | [bytes](#bytes) | | The gas fee of confirming this batch. It's the bytes representation of a big.Int value. |
| confirmation_block_number | [uint32](#uint32) | | The Ethereum block number at which the batch is confirmed onchain. |
| batch_header_hash | [bytes](#bytes) | | This is the hash of the ReducedBatchHeader defined onchain, see: https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43 The is the message that the operators will sign their signatures on. |
| batch_header_hash | [bytes](#bytes) | | This is the hash of the ReducedBatchHeader defined onchain, see: https://github.com/0glabs/0g-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43 The is the message that the operators will sign their signatures on. |



Expand Down Expand Up @@ -114,7 +114,7 @@ BlobInfo contains information needed to confirm the blob against the ZGDA contra
| quorum_number | [uint32](#uint32) | | The ID of the quorum. |
| adversary_threshold_percentage | [uint32](#uint32) | | Same as SecurityParams.adversary_threshold. |
| quorum_threshold_percentage | [uint32](#uint32) | | Same as SecurityParams.quorum_threshold. |
| quantization_param | [uint32](#uint32) | | This determines the nominal number of chunks for the blob, which is nominal_num_chunks = quantization_param * num_operators. A chunk is the smallest unit that's distributed to DA Nodes, corresponding to a set of evaluations of the polynomial (representing the blob) and a KZG multiproof. See more details in data model of ZGDA: https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/docs/spec/data-model.md |
| quantization_param | [uint32](#uint32) | | This determines the nominal number of chunks for the blob, which is nominal_num_chunks = quantization_param * num_operators. A chunk is the smallest unit that's distributed to DA Nodes, corresponding to a set of evaluations of the polynomial (representing the blob) and a KZG multiproof. See more details in data model of ZGDA: https://github.com/0glabs/0g-data-avail/blob/master/docs/spec/data-model.md |
| encoded_length | [uint64](#uint64) | | The length of the blob after encoding (in number of symbols). |


Expand Down Expand Up @@ -255,7 +255,7 @@ Clients use this to customize liveness requirement. The higher this number, the

Requires: 1 <= quorum_threshld <= 100 quorum_threshld > adversary_threshold.

Note: The adversary_threshold and quorum_threshold will directly influence the cost of encoding for the blob to be dispersed, roughly by a factor of 100 / (quorum_threshold - adversary_threshold). See the spec for more details: https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/docs/spec/protocol-modules/storage/overview.md |
Note: The adversary_threshold and quorum_threshold will directly influence the cost of encoding for the blob to be dispersed, roughly by a factor of 100 / (quorum_threshold - adversary_threshold). See the spec for more details: https://github.com/0glabs/0g-data-avail/blob/master/docs/spec/protocol-modules/storage/overview.md |



Expand Down
2 changes: 1 addition & 1 deletion api/docs/retriever.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| batch_header_hash | [bytes](#bytes) | | The hash of the ReducedBatchHeader defined onchain, see: https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43 This identifies the batch that this blob belongs to. |
| batch_header_hash | [bytes](#bytes) | | The hash of the ReducedBatchHeader defined onchain, see: https://github.com/0glabs/0g-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43 This identifies the batch that this blob belongs to. |
| blob_index | [uint32](#uint32) | | Which blob in the batch this is requesting for (note: a batch is logically an ordered list of blobs). |
| reference_block_number | [uint32](#uint32) | | The Ethereum block number at which the batch for this blob was constructed. |
| quorum_id | [uint32](#uint32) | | Which quorum of the blob this is requesting for (note a blob can participate in multiple quorums). |
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/zero-gravity-labs/zerog-data-avail/api
module github.com/0glabs/0g-data-avail/api

go 1.21

Expand Down
4 changes: 2 additions & 2 deletions api/grpc/disperser/disperser.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/grpc/retriever/retriever.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/proto/disperser/disperser.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/zero-gravity-labs/zerog-data-avail/api/grpc/disperser";
option go_package = "github.com/0glabs/0g-data-avail/api/grpc/disperser";
package disperser;

// Disperser defines the public APIs for dispersing blobs.
Expand Down Expand Up @@ -106,7 +106,7 @@ message SecurityParams {
// Note: The adversary_threshold and quorum_threshold will directly influence the
// cost of encoding for the blob to be dispersed, roughly by a factor of
// 100 / (quorum_threshold - adversary_threshold). See the spec for more details:
// https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/docs/spec/protocol-modules/storage/overview.md
// https://github.com/0glabs/0g-data-avail/blob/master/docs/spec/protocol-modules/storage/overview.md
// Currently it's required that the difference must be at least 10.
uint32 quorum_threshold = 3;
}
Expand Down Expand Up @@ -135,7 +135,7 @@ enum BlobStatus {
}

// Types below correspond to the types necessary to verify a blob
// https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/contracts/src/libraries/ZGDABlobUtils.sol#L29
// https://github.com/0glabs/0g-data-avail/blob/master/contracts/src/libraries/ZGDABlobUtils.sol#L29

// BlobInfo contains information needed to confirm the blob against the ZGDA contracts
message BlobInfo {
Expand Down Expand Up @@ -201,7 +201,7 @@ message BatchMetadata {
// The Ethereum block number at which the batch is confirmed onchain.
uint32 confirmation_block_number = 4;
// This is the hash of the ReducedBatchHeader defined onchain, see:
// https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43
// https://github.com/0glabs/0g-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43
// The is the message that the operators will sign their signatures on.
bytes batch_header_hash = 5;
}
Expand Down
4 changes: 2 additions & 2 deletions api/proto/retriever/retriever.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/zero-gravity-labs/zerog-data-avail/api/grpc/retriever";
option go_package = "github.com/0glabs/0g-data-avail/api/grpc/retriever";
package retriever;

// The Retriever is a service for retrieving chunks corresponding to a blob from
Expand All @@ -24,7 +24,7 @@ service Retriever {

message BlobRequest {
// The hash of the ReducedBatchHeader defined onchain, see:
// https://github.com/zero-gravity-labs/zerog-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43
// https://github.com/0glabs/0g-data-avail/blob/master/contracts/src/interfaces/IZGDAServiceManager.sol#L43
// This identifies the batch that this blob belongs to.
bytes batch_header_hash = 1;
// Which blob in the batch this is requesting for (note: a batch is logically an
Expand Down
12 changes: 6 additions & 6 deletions clients/retrieval_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package clients
import (
"context"

"github.com/0glabs/0g-data-avail/common"
"github.com/0glabs/0g-data-avail/common/storage_node"
"github.com/0glabs/0g-data-avail/core"
"github.com/0glabs/0g-data-avail/pkg/kzg/bn254"
"github.com/0glabs/0g-storage-client/kv"
"github.com/0glabs/0g-storage-client/node"
eth_common "github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
"github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/keccak256"
"github.com/zero-gravity-labs/zerog-data-avail/common"
"github.com/zero-gravity-labs/zerog-data-avail/common/storage_node"
"github.com/zero-gravity-labs/zerog-data-avail/core"
"github.com/zero-gravity-labs/zerog-data-avail/pkg/kzg/bn254"
"github.com/zero-gravity-labs/zerog-storage-client/kv"
"github.com/zero-gravity-labs/zerog-storage-client/node"
)

type RetrievalClient interface {
Expand Down
2 changes: 1 addition & 1 deletion common/aws/cli.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package aws

import (
"github.com/0glabs/0g-data-avail/common"
"github.com/urfave/cli"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions common/aws/dynamodb/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"math"
"sync"

"github.com/0glabs/0g-data-avail/common"
commonaws "github.com/0glabs/0g-data-avail/common/aws"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/zero-gravity-labs/zerog-data-avail/common"
commonaws "github.com/zero-gravity-labs/zerog-data-avail/common/aws"
)

const (
Expand Down
10 changes: 5 additions & 5 deletions common/aws/dynamodb/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import (
"os"
"testing"

commonaws "github.com/0glabs/0g-data-avail/common/aws"
commondynamodb "github.com/0glabs/0g-data-avail/common/aws/dynamodb"
test_utils "github.com/0glabs/0g-data-avail/common/aws/dynamodb/utils"
"github.com/0glabs/0g-data-avail/common/logging"
"github.com/0glabs/0g-data-avail/inabox/deploy"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/ory/dockertest/v3"
"github.com/stretchr/testify/assert"
commonaws "github.com/zero-gravity-labs/zerog-data-avail/common/aws"
commondynamodb "github.com/zero-gravity-labs/zerog-data-avail/common/aws/dynamodb"
test_utils "github.com/zero-gravity-labs/zerog-data-avail/common/aws/dynamodb/utils"
"github.com/zero-gravity-labs/zerog-data-avail/common/logging"
"github.com/zero-gravity-labs/zerog-data-avail/inabox/deploy"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion common/aws/dynamodb/utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"time"

commonaws "github.com/0glabs/0g-data-avail/common/aws"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
commonaws "github.com/zero-gravity-labs/zerog-data-avail/common/aws"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion common/aws/dynamodb/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"time"

commonaws "github.com/0glabs/0g-data-avail/common/aws"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
commonaws "github.com/zero-gravity-labs/zerog-data-avail/common/aws"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions common/aws/s3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"net/http"
"sync"

"github.com/0glabs/0g-data-avail/common"
commonaws "github.com/0glabs/0g-data-avail/common/aws"
"github.com/aws/aws-sdk-go-v2/aws"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/zero-gravity-labs/zerog-data-avail/common"
commonaws "github.com/zero-gravity-labs/zerog-data-avail/common/aws"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/hex"
"testing"

"github.com/0glabs/0g-data-avail/common"
"github.com/0glabs/0g-data-avail/core"
"github.com/stretchr/testify/assert"
"github.com/zero-gravity-labs/zerog-data-avail/common"
"github.com/zero-gravity-labs/zerog-data-avail/core"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion common/geth/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package geth
import (
"time"

"github.com/0glabs/0g-data-avail/common"
"github.com/urfave/cli"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion common/geth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"math/big"
"time"

"github.com/0glabs/0g-data-avail/common"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion common/geth/instrumented_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"math/big"
"time"

"github.com/0glabs/0g-data-avail/common"
rpccalls "github.com/Layr-Labs/eigensdk-go/metrics/collectors/rpc_calls"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

// InstrumentedEthClient is a wrapper around our EthClient that instruments all underlying json-rpc calls.
Expand Down
2 changes: 1 addition & 1 deletion common/logging/cli.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package logging

import (
"github.com/0glabs/0g-data-avail/common"
"github.com/urfave/cli"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion common/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/0glabs/0g-data-avail/common"
"github.com/ethereum/go-ethereum/log"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

type Logger struct {
Expand Down
2 changes: 1 addition & 1 deletion common/mock/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/mock"

dacommon "github.com/zero-gravity-labs/zerog-data-avail/common"
dacommon "github.com/0glabs/0g-data-avail/common"
)

type MockEthClient struct {
Expand Down
2 changes: 1 addition & 1 deletion common/mock/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package mock
import (
"log"

"github.com/0glabs/0g-data-avail/common"
ethlog "github.com/ethereum/go-ethereum/log"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

type Logger struct {
Expand Down
2 changes: 1 addition & 1 deletion common/mock/ratelimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mock
import (
"context"

"github.com/zero-gravity-labs/zerog-data-avail/common"
"github.com/0glabs/0g-data-avail/common"
)

type NoopRatelimiter struct {
Expand Down
2 changes: 1 addition & 1 deletion common/mock/s3_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"strings"

"github.com/zero-gravity-labs/zerog-data-avail/common/aws/s3"
"github.com/0glabs/0g-data-avail/common/aws/s3"
)

type S3Client struct {
Expand Down
2 changes: 1 addition & 1 deletion common/mock/workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package mock
import (
"context"

"github.com/0glabs/0g-data-avail/common"
"github.com/stretchr/testify/mock"
"github.com/zero-gravity-labs/zerog-data-avail/common"
)

type MockWorkerpool struct {
Expand Down
2 changes: 1 addition & 1 deletion common/ratelimit/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"time"

"github.com/zero-gravity-labs/zerog-data-avail/common"
"github.com/0glabs/0g-data-avail/common"
)

type BucketStore = common.KVStore[common.RateBucketParams]
Expand Down
Loading

0 comments on commit 98405b9

Please sign in to comment.