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

Merging Swarm 2.0 master #32

Merged
merged 26 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ad0b209
fix(stamper): global lock stamper across multiple upload sessions (#4…
istae Feb 13, 2024
4950c31
fix: strategy and fetch timeout parsing (#4579)
istae Feb 13, 2024
6b77605
feat: neighborhood suggester config (#4580)
acha-bill Feb 19, 2024
e5e74a9
feat: add codeql.yml (#4334)
iNDicat0r Feb 19, 2024
598bf58
feat: add reserveSizeWithinRadius to status protocol (#4585)
acha-bill Feb 21, 2024
5de732c
fix: missing 200 response (#4526)
NoahMaizels Feb 21, 2024
b905de1
feat: pinned reference integrity check API (#4573)
notanatol Feb 27, 2024
652977f
fix(redundancy/getter): wait for recovery and return error (#4581)
istae Feb 27, 2024
b49d9e8
fix(pushsync): store the chunk locally when no peers are available fo…
istae Feb 29, 2024
a4fa9b8
fix(redundancy): on by default when downloading (#4602)
istae Feb 29, 2024
4dd8371
fix: add missing openapi spec (#4598)
notanatol Feb 29, 2024
93ed7ed
feat: bzz resource info API (#4588)
notanatol Feb 29, 2024
fd46f75
fix(redundancy): bzz unit test (#4603)
istae Feb 29, 2024
b8c7e20
feat: redundancy ci (#4591)
acha-bill Feb 29, 2024
be9a15b
chore: bump github.com/quic-go/quic-go from 0.38.1 to 0.38.2 (#4534)
dependabot[bot] Feb 29, 2024
f7b3586
feat: split input file to chunks with specified redundancy (#4600)
acha-bill Mar 4, 2024
d3d6685
perf(getter): cancel inflight requests if enough chunks are fetched f…
istae Mar 6, 2024
a54e48a
fix: store dir error info (#4605)
notanatol Mar 11, 2024
c6ce523
chore: remove repetitive words (#4611)
one230six Mar 13, 2024
630b9b1
fix: use neighborhood suggester only on mainnet (#4612)
acha-bill Mar 14, 2024
4f32231
feat: alternative withdrawal address (#4606)
notanatol Mar 15, 2024
776f546
fix(seg65) (#4604)
zelig Mar 15, 2024
ef7c97d
fix(getter): redundancy getter cleanup (#4610)
istae Mar 15, 2024
47c612a
feat: v2 (#4615)
acha-bill Mar 18, 2024
ee8fa15
fix(pin_integrity): changed route and added openapi (#4616)
istae Mar 20, 2024
501f8a4
fix: missing v2 in the makefile and goreleaser (#4622)
istae Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/workflows/beekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ jobs:
- name: Test staking
id: stake
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake
- name: Test withdraw
id: withdraw
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-withdraw; do echo "waiting for withdraw..."; sleep .3; done'
- name: Test redundancy
id: redundancy
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy
- name: Collect debug artifacts
if: failure()
run: |
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
permissions: read-all
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '23 1 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
50 changes: 25 additions & 25 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ builds:
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee.version={{ .Version }}
- -X github.com/ethersphere/bee.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -39,11 +39,11 @@ builds:
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee.version={{ .Version }}
- -X github.com/ethersphere/bee.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -65,11 +65,11 @@ builds:
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee.version={{ .Version }}
- -X github.com/ethersphere/bee.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -85,11 +85,11 @@ builds:
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee.version={{ .Version }}
- -X github.com/ethersphere/bee.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -104,11 +104,11 @@ builds:
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee.version={{ .Version }}
- -X github.com/ethersphere/bee.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
- -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ COMMIT_HASH ?= "$(shell git describe --long --dirty --always --match "" || true)
CLEAN_COMMIT ?= "$(shell git describe --long --always --match "" || true)"
COMMIT_TIME ?= "$(shell git show -s --format=%ct $(CLEAN_COMMIT) || true)"
LDFLAGS ?= -s -w \
-X github.com/ethersphere/bee.version="$(VERSION)" \
-X github.com/ethersphere/bee.commitHash="$(COMMIT_HASH)" \
-X github.com/ethersphere/bee.commitTime="$(COMMIT_TIME)" \
-X github.com/ethersphere/bee/pkg/api.Version="$(BEE_API_VERSION)" \
-X github.com/ethersphere/bee/pkg/api.DebugVersion="$(BEE_DEBUG_API_VERSION)" \
-X github.com/ethersphere/bee/pkg/p2p/libp2p.reachabilityOverridePublic="$(REACHABILITY_OVERRIDE_PUBLIC)" \
-X github.com/ethersphere/bee/pkg/postage/listener.batchFactorOverridePublic="$(BATCHFACTOR_OVERRIDE_PUBLIC)"
-X github.com/ethersphere/bee/v2.version="$(VERSION)" \
-X github.com/ethersphere/bee/v2.commitHash="$(COMMIT_HASH)" \
-X github.com/ethersphere/bee/v2.commitTime="$(COMMIT_TIME)" \
-X github.com/ethersphere/bee/v2/pkg/api.Version="$(BEE_API_VERSION)" \
-X github.com/ethersphere/bee/v2/pkg/api.DebugVersion="$(BEE_DEBUG_API_VERSION)" \
-X github.com/ethersphere/bee/v2/pkg/p2p/libp2p.reachabilityOverridePublic="$(REACHABILITY_OVERRIDE_PUBLIC)" \
-X github.com/ethersphere/bee/v2/pkg/postage/listener.batchFactorOverridePublic="$(BATCHFACTOR_OVERRIDE_PUBLIC)"

.PHONY: all
all: build lint test-race binary
Expand Down
138 changes: 71 additions & 67 deletions cmd/bee/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,78 +13,80 @@ import (
"strings"
"time"

chaincfg "github.com/ethersphere/bee/pkg/config"
"github.com/ethersphere/bee/pkg/log"
"github.com/ethersphere/bee/pkg/node"
"github.com/ethersphere/bee/pkg/swarm"
chaincfg "github.com/ethersphere/bee/v2/pkg/config"
"github.com/ethersphere/bee/v2/pkg/log"
"github.com/ethersphere/bee/v2/pkg/node"
"github.com/ethersphere/bee/v2/pkg/swarm"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

const (
optionNameDataDir = "data-dir"
optionNameCacheCapacity = "cache-capacity"
optionNameDBOpenFilesLimit = "db-open-files-limit"
optionNameDBBlockCacheCapacity = "db-block-cache-capacity"
optionNameDBWriteBufferSize = "db-write-buffer-size"
optionNameDBDisableSeeksCompaction = "db-disable-seeks-compaction"
optionNamePassword = "password"
optionNamePasswordFile = "password-file"
optionNameAPIAddr = "api-addr"
optionNameP2PAddr = "p2p-addr"
optionNameNATAddr = "nat-addr"
optionNameP2PWSEnable = "p2p-ws-enable"
optionNameDebugAPIEnable = "debug-api-enable"
optionNameDebugAPIAddr = "debug-api-addr"
optionNameBootnodes = "bootnode"
optionNameNetworkID = "network-id"
optionWelcomeMessage = "welcome-message"
optionCORSAllowedOrigins = "cors-allowed-origins"
optionNameTracingEnabled = "tracing-enable"
optionNameTracingEndpoint = "tracing-endpoint"
optionNameTracingHost = "tracing-host"
optionNameTracingPort = "tracing-port"
optionNameTracingServiceName = "tracing-service-name"
optionNameVerbosity = "verbosity"
optionNamePaymentThreshold = "payment-threshold"
optionNamePaymentTolerance = "payment-tolerance-percent"
optionNamePaymentEarly = "payment-early-percent"
optionNameResolverEndpoints = "resolver-options"
optionNameBootnodeMode = "bootnode-mode"
optionNameClefSignerEnable = "clef-signer-enable"
optionNameClefSignerEndpoint = "clef-signer-endpoint"
optionNameClefSignerEthereumAddress = "clef-signer-ethereum-address"
optionNameSwapEndpoint = "swap-endpoint" // deprecated: use rpc endpoint instead
optionNameBlockchainRpcEndpoint = "blockchain-rpc-endpoint"
optionNameSwapFactoryAddress = "swap-factory-address"
optionNameSwapInitialDeposit = "swap-initial-deposit"
optionNameSwapEnable = "swap-enable"
optionNameChequebookEnable = "chequebook-enable"
optionNameSwapDeploymentGasPrice = "swap-deployment-gas-price"
optionNameFullNode = "full-node"
optionNamePostageContractAddress = "postage-stamp-address"
optionNamePostageContractStartBlock = "postage-stamp-start-block"
optionNamePriceOracleAddress = "price-oracle-address"
optionNameRedistributionAddress = "redistribution-address"
optionNameStakingAddress = "staking-address"
optionNameBlockTime = "block-time"
optionWarmUpTime = "warmup-time"
optionNameMainNet = "mainnet"
optionNameRetrievalCaching = "cache-retrieval"
optionNameDevReserveCapacity = "dev-reserve-capacity"
optionNameResync = "resync"
optionNamePProfBlock = "pprof-profile"
optionNamePProfMutex = "pprof-mutex"
optionNameStaticNodes = "static-nodes"
optionNameAllowPrivateCIDRs = "allow-private-cidrs"
optionNameSleepAfter = "sleep-after"
optionNameRestrictedAPI = "restricted"
optionNameTokenEncryptionKey = "token-encryption-key"
optionNameAdminPasswordHash = "admin-password"
optionNameUsePostageSnapshot = "use-postage-snapshot"
optionNameStorageIncentivesEnable = "storage-incentives-enable"
optionNameStateStoreCacheCapacity = "statestore-cache-capacity"
optionNameTargetNeighborhood = "target-neighborhood"
optionNameDataDir = "data-dir"
optionNameCacheCapacity = "cache-capacity"
optionNameDBOpenFilesLimit = "db-open-files-limit"
optionNameDBBlockCacheCapacity = "db-block-cache-capacity"
optionNameDBWriteBufferSize = "db-write-buffer-size"
optionNameDBDisableSeeksCompaction = "db-disable-seeks-compaction"
optionNamePassword = "password"
optionNamePasswordFile = "password-file"
optionNameAPIAddr = "api-addr"
optionNameP2PAddr = "p2p-addr"
optionNameNATAddr = "nat-addr"
optionNameP2PWSEnable = "p2p-ws-enable"
optionNameDebugAPIEnable = "debug-api-enable"
optionNameDebugAPIAddr = "debug-api-addr"
optionNameBootnodes = "bootnode"
optionNameNetworkID = "network-id"
optionWelcomeMessage = "welcome-message"
optionCORSAllowedOrigins = "cors-allowed-origins"
optionNameTracingEnabled = "tracing-enable"
optionNameTracingEndpoint = "tracing-endpoint"
optionNameTracingHost = "tracing-host"
optionNameTracingPort = "tracing-port"
optionNameTracingServiceName = "tracing-service-name"
optionNameVerbosity = "verbosity"
optionNamePaymentThreshold = "payment-threshold"
optionNamePaymentTolerance = "payment-tolerance-percent"
optionNamePaymentEarly = "payment-early-percent"
optionNameResolverEndpoints = "resolver-options"
optionNameBootnodeMode = "bootnode-mode"
optionNameClefSignerEnable = "clef-signer-enable"
optionNameClefSignerEndpoint = "clef-signer-endpoint"
optionNameClefSignerEthereumAddress = "clef-signer-ethereum-address"
optionNameSwapEndpoint = "swap-endpoint" // deprecated: use rpc endpoint instead
optionNameBlockchainRpcEndpoint = "blockchain-rpc-endpoint"
optionNameSwapFactoryAddress = "swap-factory-address"
optionNameSwapInitialDeposit = "swap-initial-deposit"
optionNameSwapEnable = "swap-enable"
optionNameChequebookEnable = "chequebook-enable"
optionNameSwapDeploymentGasPrice = "swap-deployment-gas-price"
optionNameFullNode = "full-node"
optionNamePostageContractAddress = "postage-stamp-address"
optionNamePostageContractStartBlock = "postage-stamp-start-block"
optionNamePriceOracleAddress = "price-oracle-address"
optionNameRedistributionAddress = "redistribution-address"
optionNameStakingAddress = "staking-address"
optionNameBlockTime = "block-time"
optionWarmUpTime = "warmup-time"
optionNameMainNet = "mainnet"
optionNameRetrievalCaching = "cache-retrieval"
optionNameDevReserveCapacity = "dev-reserve-capacity"
optionNameResync = "resync"
optionNamePProfBlock = "pprof-profile"
optionNamePProfMutex = "pprof-mutex"
optionNameStaticNodes = "static-nodes"
optionNameAllowPrivateCIDRs = "allow-private-cidrs"
optionNameSleepAfter = "sleep-after"
optionNameRestrictedAPI = "restricted"
optionNameTokenEncryptionKey = "token-encryption-key"
optionNameAdminPasswordHash = "admin-password"
optionNameUsePostageSnapshot = "use-postage-snapshot"
optionNameStorageIncentivesEnable = "storage-incentives-enable"
optionNameStateStoreCacheCapacity = "statestore-cache-capacity"
optionNameTargetNeighborhood = "target-neighborhood"
optionNameNeighborhoodSuggester = "neighborhood-suggester"
optionNameWhitelistedWithdrawalAddress = "withdrawal-addresses-whitelist"
)

// nolint:gochecknoinits
Expand Down Expand Up @@ -302,6 +304,8 @@ func (c *command) setAllFlags(cmd *cobra.Command) {
cmd.Flags().Bool(optionNameStorageIncentivesEnable, true, "enable storage incentives feature")
cmd.Flags().Uint64(optionNameStateStoreCacheCapacity, 100_000, "lru memory caching capacity in number of statestore entries")
cmd.Flags().String(optionNameTargetNeighborhood, "", "neighborhood to target in binary format (ex: 111111001) for mining the initial overlay")
cmd.Flags().String(optionNameNeighborhoodSuggester, "https://api.swarmscan.io/v1/network/neighborhoods/suggestion", "suggester for target neighborhood")
cmd.Flags().StringSlice(optionNameWhitelistedWithdrawalAddress, []string{}, "withdrawal target addresses")
}

func newLogger(cmd *cobra.Command, verbosity string) (log.Logger, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/bee/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"testing"

"github.com/ethersphere/bee/cmd/bee/cmd"
"github.com/ethersphere/bee/v2/cmd/bee/cmd"
)

var homeDir string
Expand Down
10 changes: 5 additions & 5 deletions cmd/bee/cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"strings"
"time"

"github.com/ethersphere/bee/pkg/node"
"github.com/ethersphere/bee/pkg/postage"
"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/storer"
"github.com/ethersphere/bee/pkg/swarm"
"github.com/ethersphere/bee/v2/pkg/node"
"github.com/ethersphere/bee/v2/pkg/postage"
"github.com/ethersphere/bee/v2/pkg/storage"
"github.com/ethersphere/bee/v2/pkg/storer"
"github.com/ethersphere/bee/v2/pkg/swarm"
"github.com/spf13/cobra"
)

Expand Down
Loading
Loading