Skip to content

Commit

Permalink
Merge branch 'main' into deps/bump-cristalhq-jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Jul 3, 2024
2 parents 12398d6 + e2b2994 commit 84eb71c
Show file tree
Hide file tree
Showing 31 changed files with 458 additions and 118 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
env:
# upgrade go version throughout pipeline here
GO_VERSION: "1.22"
GO_VERSION: "1.22.4"
outputs:
go-version: ${{ steps.set-vars.outputs.go-version }}
branch: ${{ steps.trim_ref.outputs.branch }}
Expand All @@ -54,15 +54,15 @@ jobs:
# Dockerfile Linting
hadolint:
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.2 # yamllint disable-line rule:line-length
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.3 # yamllint disable-line rule:line-length
with:
dockerfile: Dockerfile

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: celestiaorg/.github/.github/actions/yamllint@v0.4.2
- uses: celestiaorg/.github/.github/actions/yamllint@v0.4.3

markdown-lint:
name: Markdown Lint
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
passphrase: ${{ secrets.GPG_PASSPHRASE }}

# Generate the binaries and release
- uses: goreleaser/goreleaser-action@v5
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release_tracking_epic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [released]
jobs:
trigger_issue:
uses: celestiaorg/.github/.github/workflows/reusable_create_release_tracking_epic.yml@v0.4.2
uses: celestiaorg/.github/.github/workflows/reusable_create_release_tracking_epic.yml@v0.4.3
secrets: inherit
with:
release-repo: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
permissions:
contents: write
packages: write
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.2 # yamllint disable-line rule:line-length
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.3 # yamllint disable-line rule:line-length
with:
dockerfile: Dockerfile
secrets: inherit
7 changes: 3 additions & 4 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ jobs:
uses: golangci/golangci-lint-action@v6.0.1
with:
args: --timeout 10m
version: v1.56
skip-pkg-cache: true
skip-build-cache: true
version: v1.59
skip-cache: true

go_mod_tidy_check:
needs: [setup]
Expand Down Expand Up @@ -98,7 +97,7 @@ jobs:
retention-days: 5

- name: upload coverage
uses: codecov/codecov-action@v4.4.1
uses: codecov/codecov-action@v4.5.0
with:
env_vars: OS
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22-alpine3.18 as builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22.4-alpine3.20 as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand All @@ -25,7 +25,7 @@ RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build && make cel-key

FROM docker.io/alpine:3.20.0
FROM docker.io/alpine:3.20.1

# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Continue reading [here](https://blog.celestia.org/celestia-mvp-release-data-avai

| Requirement | Notes |
| ----------- |----------------|
| Go version | 1.22 or higher |
| Go version | 1.22.4 or higher |

## System Requirements

Expand Down
7 changes: 7 additions & 0 deletions api/docgen/exampledata/blob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAMJ/xGlNMdE=",
"data": "z8QyNztvogN7NYU27gI+nJgg1vMJtkK3vbduSDz7/8mhmos37I7duH51kkgouxrsdhdOBJ1431OmipNfVedbtwe6zQ06EbJBl/jk4QwwU3S29YBTUZcUfTzXpEJIuMrYzU6YPxN8Zce/KNdsEIy4zxdfxekXpvsgZMBhf83iYgfHvsFAoJmmCp/ORAUoAFf7tJ7cF8RZyA20ftqRa1uhAmktxIb58abpGTG+TNgq3mjyvswECVykJYqGjqNtInyIx2EQOnVp2q69YHkegdoBvoOKzEFigQTdrL2TZBex4MhkrYt7Zf0DQyNMRkCPL/zKYE3bhvXNWMThWCmhD5TOApzirORXKOTB0nxhjDF/aFYkrS+IKBw1KfJ5isldWvmasJBWwRgDuli6Cty67vMMk7fUUTUf0St6rvQeftSoEVlC1xEw46+h5kIXaWiM0g/EzGIAdZHycUFWCSdnt3p7BS5ttEpSf1d6ZbVYYL2y0XguH41k54JqufEMAw9ukmaF0IbN9Jk6fNefV1dsWTdCP6Mz6e+RTCd9DQGqb2VrsvMzx5uVidLD8ND79pvXgL1VzyhJaMTcjSfZK15jOxLwGh1arZc2gyTNiq2pu6wNz0tdJp+fFU+peG8rHN8=",
"share_version": 0,
"commitment": "aHlbp+J9yub6hw/uhK6dP8hBLR2mFy78XNRRdLf2794=",
"index": -1
}
31 changes: 31 additions & 0 deletions api/docgen/exampledata/blobProof.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"end": 8,
"nodes": [
"/////////////////////////////////////////////////////////////////////////////wuxStDHcZ7+b5byNQMVLJbzBT3wmObsThoQ0sCTjTCP"
],
"is_max_namespace_ignored": true
},
{
"end": 8,
"nodes": [
"//////////////////////////////////////////////////////////////////////////////n1NeJxPU2bZUAccKZZ+LAu2Wj5ajbVYURV9ojhSKwp"
],
"is_max_namespace_ignored": true
},
{
"end": 8,
"nodes": [
"/////////////////////////////////////////////////////////////////////////////0xK8BKnzDmwK0HR4ZJvyB4kh3jPPXGxaGPFoga8vPxF"
],
"is_max_namespace_ignored": true
},
{
"end": 7,
"nodes": [
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAMJ/xGlNMdEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwn/EaU0x0UTO9HUGKjyjcv5U2gHeSjJ8S1rftqv6k8kxlVWW8e/7",
"/////////////////////////////////////////////////////////////////////////////wexh4khLQ9HQ2X6nh9wU5B+m6r+LWwPTEDTa5/CosDF"
],
"is_max_namespace_ignored": true
}
]
43 changes: 36 additions & 7 deletions api/docgen/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package docgen

import (
_ "embed"
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
Expand All @@ -19,7 +21,7 @@ import (
"golang.org/x/text/language"

"github.com/celestiaorg/go-fraud"
"github.com/celestiaorg/nmt"
libhead "github.com/celestiaorg/go-header"
"github.com/celestiaorg/rsmt2d"

"github.com/celestiaorg/celestia-node/blob"
Expand All @@ -43,6 +45,12 @@ var exampleTxResponse string
//go:embed "exampledata/resourceManagerStats.json"
var exampleResourceMngrStats string

//go:embed "exampledata/blob.json"
var exampleBlob string

//go:embed "exampledata/blobProof.json"
var exampleBlobProof string

var ExampleValues = map[reflect.Type]interface{}{
reflect.TypeOf(""): "string value",
reflect.TypeOf(uint64(42)): uint64(42),
Expand All @@ -68,6 +76,7 @@ var ExampleValues = map[reflect.Type]interface{}{
},
),
reflect.TypeOf((*error)(nil)).Elem(): errors.New("error"),
reflect.TypeOf(state.Balance{}): state.Balance{Amount: sdk.NewInt(42), Denom: "utia"},
}

func init() {
Expand Down Expand Up @@ -111,6 +120,20 @@ func init() {
panic(err)
}

var exBlob *blob.Blob
err = json.Unmarshal([]byte(exampleBlob), &exBlob)
if err != nil {
panic(err)
}

var blobProof *blob.Proof
err = json.Unmarshal([]byte(exampleBlobProof), &blobProof)
if err != nil {
panic(err)
}

addToExampleValues(exBlob)
addToExampleValues(blobProof)
addToExampleValues(txResponse)
addToExampleValues(samplingStats)
addToExampleValues(extendedHeader)
Expand All @@ -135,21 +158,27 @@ func init() {
}
addToExampleValues(addrInfo)

namespace, err := share.NewBlobNamespaceV0([]byte{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x10})
commitment, err := base64.StdEncoding.DecodeString("aHlbp+J9yub6hw/uhK6dP8hBLR2mFy78XNRRdLf2794=")
if err != nil {
panic(err)
}
addToExampleValues(blob.Commitment(commitment))

// randomly generated namespace that's used in the blob example above
// (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAMJ/xGlNMdE=)
namespace, err := share.NewBlobNamespaceV0([]byte{0xc2, 0x7f, 0xc4, 0x69, 0x4d, 0x31, 0xd1})
if err != nil {
panic(err)
}
addToExampleValues(namespace)

generatedBlob, err := blob.NewBlobV0(namespace, []byte("This is an example of some blob data"))
hashStr := "453D0BC3CB88A2ED6F2E06021383B22C72D25D7741AE51B4CAE1AD34D72A3F07"
hash, err := hex.DecodeString(hashStr)
if err != nil {
panic(err)
}
addToExampleValues(generatedBlob)

proof := nmt.NewInclusionProof(0, 4, [][]byte{[]byte("test")}, true)
blobProof := &blob.Proof{&proof}
addToExampleValues(blobProof)
addToExampleValues(libhead.Hash(hash))
}

func addToExampleValues(v interface{}) {
Expand Down
4 changes: 2 additions & 2 deletions das/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/celestiaorg/celestia-node/share/p2p/shrexsub"
)

type jobType string

const (
catchupJob jobType = "catchup"
recentJob jobType = "recent"
Expand All @@ -37,8 +39,6 @@ type workerState struct {
curr uint64
}

type jobType string

// job represents headers interval to be processed by worker
type job struct {
id int
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/celestiaorg/celestia-node

go 1.22.3
go 1.22.4

require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/BurntSushi/toml v1.3.2
github.com/BurntSushi/toml v1.4.0
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/benbjohnson/clock v1.3.5
github.com/celestiaorg/celestia-app v1.11.0
github.com/celestiaorg/celestia-app v1.12.0
github.com/celestiaorg/go-fraud v0.2.1
github.com/celestiaorg/go-header v0.6.2
github.com/celestiaorg/go-libp2p-messenger v0.2.0
Expand Down Expand Up @@ -52,7 +52,7 @@ require (
github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333
github.com/prometheus/client_golang v1.19.1
github.com/rollkit/go-da v0.4.0
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/tendermint/tendermint v0.34.29
Expand All @@ -68,10 +68,10 @@ require (
go.opentelemetry.io/proto/otlp v1.2.0
go.uber.org/fx v1.22.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.23.0
golang.org/x/crypto v0.24.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
golang.org/x/sync v0.7.0
golang.org/x/text v0.15.0
golang.org/x/text v0.16.0
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.1
)
Expand Down Expand Up @@ -184,7 +184,7 @@ require (
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.4 // indirect
github.com/hashicorp/go-getter v1.7.5 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
Expand Down Expand Up @@ -331,10 +331,10 @@ require (
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/api v0.169.0 // indirect
Expand All @@ -356,5 +356,5 @@ replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
// broken goleveldb needs to be replaced for the cosmos-sdk and celestia-app
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.36.1-tm-v0.34.29
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.37.0-tm-v0.34.29
)
Loading

0 comments on commit 84eb71c

Please sign in to comment.