Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 1.18 #165

Merged
merged 15 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gosdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
create-pr:
runs-on: [arc-runner]
steps:
- name: Setup go 1.21
- name: Setup go 1.22
uses: actions/setup-go@v2
with:
go-version: '1.21'
go-version: '1.22'

- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway/zcn/dStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
var tempdir string

const (
pageLimit = 100
pageLimit = 1000
numBlocks = 100
dirType = "d"
fileType = "f"
Expand Down
8 changes: 8 additions & 0 deletions cmd/gateway/zcn/gateway-zcn.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ func (z *ZCN) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, erro
if err != nil {
return nil, err
}
status, _, _ := allocation.CheckAllocStatus()
if status == sdk.Broken {
return nil, errors.New("allocation_broken")
}
if allocation.StorageVersion == sdk.StorageV2 && status == sdk.Broken {
return nil, errors.New("repair_allocation")
}
sdk.CurrentMode = sdk.UploadModeHigh
sdk.SetSingleClietnMode(true)
sdk.SetShouldVerifyHash(false)
sdk.SetSaveProgress(false)
allocation.SetCheckStatus(true)
zob := &zcnObjects{
alloc: allocation,
metrics: minio.NewMetrics(),
Expand Down
31 changes: 4 additions & 27 deletions cmd/gateway/zcn/initSDK.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"path/filepath"
"strings"

"github.com/0chain/gosdk/core/client"

"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk/core/logger"
"github.com/0chain/gosdk/zboxcore/blockchain"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"github.com/mitchellh/go-homedir"
Expand Down Expand Up @@ -90,44 +91,20 @@ func initializeSDK(configDir, allocid string, nonce int64) error {
return err
}

network, _ := conf.LoadNetworkFile(filepath.Join(configDir, "network.yaml"))
if network.IsValid() {
zcncore.SetNetwork(network.Miners, network.Sharders)
conf.InitChainNetwork(&conf.Network{
Miners: network.Miners,
Sharders: network.Sharders,
})
}

logger.SyncLoggers([]*logger.Logger{zcncore.GetLogger(), sdk.GetLogger()})
zcncore.SetLogFile("cmdlog.log", true)
sdk.SetLogFile("cmd.log", true)
zcncore.SetLogLevel(3)
sdk.SetLogLevel(3)

err = zcncore.InitZCNSDK(cfg.BlockWorker, cfg.SignatureScheme,
zcncore.WithChainID(cfg.ChainID),
zcncore.WithMinSubmit(cfg.MinSubmit),
zcncore.WithMinConfirmation(cfg.MinConfirmation),
zcncore.WithConfirmationChainLength(cfg.ConfirmationChainLength))
err = client.InitSDK(string(walletBytes), cfg.BlockWorker, cfg.ChainID, cfg.SignatureScheme, nonce, false, true, cfg.MinSubmit, cfg.MinConfirmation, cfg.ConfirmationChainLength, cfg.SharderConsensous)
if err != nil {
return err
}

err = sdk.InitStorageSDK(string(walletBytes), cfg.BlockWorker, cfg.ChainID, cfg.SignatureScheme, cfg.PreferredBlobbers, nonce)
if err != nil {
return err
}

blockchain.SetMaxTxnQuery(cfg.MaxTxnQuery)
blockchain.SetQuerySleepTime(cfg.QuerySleepTime)
conf.InitClientConfig(&cfg)

if network.IsValid() {
sdk.SetNetwork(network.Miners, network.Sharders)
}

sdk.SetNumBlockDownloads(10)
sdk.SetNumBlockDownloads(100)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway/zcn/multipart-test/s3gateway/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/peterlimg/s3gateway

go 1.21
go 1.22

require (
github.com/0chain/gosdk v1.10.1-0.20231214200656-5a5e14d7d186
Expand Down
28 changes: 2 additions & 26 deletions cmd/gateway/zcn/multipart-test/s3gateway/zcn/initSDK.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package zcn

import (
"fmt"
"github.com/0chain/gosdk/core/client"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk/core/logger"
"github.com/0chain/gosdk/zboxcore/blockchain"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"github.com/mitchellh/go-homedir"
Expand Down Expand Up @@ -59,41 +59,17 @@ func InitializeSDK(configDir, allocid string, nonce int64) error {
return err
}

network, _ := conf.LoadNetworkFile(filepath.Join(configDir, "network.yaml"))
if network.IsValid() {
zcncore.SetNetwork(network.Miners, network.Sharders)
conf.InitChainNetwork(&conf.Network{
Miners: network.Miners,
Sharders: network.Sharders,
})
}

logger.SyncLoggers([]*logger.Logger{zcncore.GetLogger(), sdk.GetLogger()})
zcncore.SetLogFile("cmdlog.log", true)
sdk.SetLogFile("cmd.log", true)

err = zcncore.InitZCNSDK(cfg.BlockWorker, cfg.SignatureScheme,
zcncore.WithChainID(cfg.ChainID),
zcncore.WithMinSubmit(cfg.MinSubmit),
zcncore.WithMinConfirmation(cfg.MinConfirmation),
zcncore.WithConfirmationChainLength(cfg.ConfirmationChainLength))
if err != nil {
return err
}

err = sdk.InitStorageSDK(string(walletBytes), cfg.BlockWorker, cfg.ChainID, cfg.SignatureScheme, cfg.PreferredBlobbers, nonce)
err = client.InitSDK(string(walletBytes), cfg.BlockWorker, cfg.ChainID, cfg.SignatureScheme, nonce, false, true, cfg.MinSubmit, cfg.MinConfirmation, cfg.ConfirmationChainLength, cfg.SharderConsensous)
if err != nil {
return err
}

blockchain.SetMaxTxnQuery(cfg.MaxTxnQuery)
blockchain.SetQuerySleepTime(cfg.QuerySleepTime)
conf.InitClientConfig(&cfg)

if network.IsValid() {
sdk.SetNetwork(network.Miners, network.Sharders)
}

sdk.SetNumBlockDownloads(10)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway/zcn/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func batchUploadWorker(ctx context.Context, alloc *sdk.Allocation, opsChan chan
log.Println("processing batch upload: ", len(ops))
err := alloc.DoMultiOperation(ops)
if err != nil {
if !isSameRootError(err) {
if isSameRootError(err) {
err = nil
} else if err == context.Canceled {
err = errors.New("operation canceled")
Expand Down
2 changes: 1 addition & 1 deletion docker.local/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18 as zbox_base
FROM golang:1.22-alpine3.18 as zbox_base

RUN apk add --update --no-cache linux-headers build-base git cmake bash perl grep py3-pip python3-dev curl

Expand Down
50 changes: 26 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/minio/minio

go 1.21
go 1.22.0

toolchain go1.21.6
toolchain go1.22.5

require (
cloud.google.com/go/storage v1.27.0
cloud.google.com/go/storage v1.28.1
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.17.6
github.com/0chain/gosdk v1.18.0-RC18
github.com/Azure/azure-pipeline-go v0.2.2
github.com/Azure/azure-storage-blob-go v0.10.0
github.com/Shopify/sarama v1.28.0
Expand Down Expand Up @@ -90,21 +90,21 @@ require (
go.etcd.io/etcd/client/v3 v3.5.6
go.uber.org/atomic v1.10.0
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.17.0
golang.org/x/oauth2 v0.5.0
golang.org/x/sync v0.5.0
golang.org/x/sys v0.15.0
golang.org/x/crypto v0.21.0
golang.org/x/oauth2 v0.7.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.18.0
golang.org/x/time v0.3.0
google.golang.org/api v0.110.0
google.golang.org/api v0.114.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go v0.107.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.11.0 // indirect
github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
github.com/0chain/common v1.18.3 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect
github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
Expand Down Expand Up @@ -133,6 +133,7 @@ require (
github.com/ethereum/go-ethereum v1.12.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/georgysavva/scany v0.2.7 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.1 // indirect
github.com/go-logr/logr v0.4.0 // indirect
Expand All @@ -150,14 +151,14 @@ require (
github.com/goccy/go-json v0.7.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
github.com/googleapis/gnostic v0.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/h2non/filetype v1.1.4-0.20231228185113-6469358c2bcb // indirect
Expand All @@ -169,7 +170,7 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/herumi/bls-go-binary v1.31.0 // indirect
github.com/hitenjain14/fasthttp v0.0.0-20240527123209-06019e79bff9 // indirect
github.com/hitenjain14/fasthttp v0.0.0-20240916135632-f9303a91736c // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
Expand Down Expand Up @@ -230,8 +231,8 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tidwall/gjson v1.11.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
Expand All @@ -242,6 +243,7 @@ require (
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/unrolled/secure v1.0.9 // indirect
github.com/valyala/fasthttp v1.51.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xdg/stringprep v1.0.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.dedis.ch/fixbuf v1.0.3 // indirect
Expand All @@ -250,14 +252,14 @@ require (
go.mongodb.org/mongo-driver v1.4.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading
Loading