Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into shant/close_ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
algonautshant committed Aug 15, 2023
2 parents c0ecfbd + 3425e85 commit 06d9cba
Show file tree
Hide file tree
Showing 128 changed files with 9,437 additions and 2,288 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ commands:
shell: bash.exe
command: |
choco install -y msys2 pacman make wget --force
choco install -y golang --version=1.20.5 --force
choco install -y golang --version=$(./scripts/get_golang_version.sh) --force
choco install -y python3 --version=3.7.3 --force
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
Expand Down Expand Up @@ -602,7 +602,6 @@ commands:
export PACKAGE_NAMES=$(echo $PACKAGES | tr -d '\n')
export PARTITION_TOTAL=${CIRCLE_NODE_TOTAL}
export PARTITION_ID=${CIRCLE_NODE_INDEX}
export GOEXPERIMENT="none"
gotestsum --format standard-verbose --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES
- store_artifacts:
path: << parameters.result_path >>
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
uses: actions/[email protected]
with:
path: cicdtmp/golangci-lint/golangci-lint-cgo
key: cicd-golangci-lint-cgo-v0.0.2
key: cicd-golangci-lint-cgo-v0.0.2-${{ env.GO_VERSION }}

- name: Build custom golangci-lint with CGO_ENABLED
if: steps.cache-golangci-lint.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04 as builder

ARG GO_VERSION="1.20.5"
ARG GO_VERSION="1.20.7"

ARG CHANNEL
ARG URL
Expand Down
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ ifeq ($(SHORT_PART_PERIOD), 1)
export SHORT_PART_PERIOD_FLAG := -s
endif

# Disable go experiments during build as of go 1.20.5 due to
# https://github.com/golang/go/issues/60825
# Likely fix: https://go-review.googlesource.com/c/go/+/503937/6/src/runtime/race_arm64.s
export GOEXPERIMENT=none

GOTAGS := --tags "$(GOTAGSLIST)"
GOTRIMPATH := $(shell GOPATH=$(GOPATH) && go help build | grep -q .-trimpath && echo -trimpath)

Expand Down Expand Up @@ -212,9 +207,11 @@ build: buildsrc buildsrc-special
# get around a bug in go build where it will fail
# to cache binaries from time to time on empty NFS
# dirs
buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN
mkdir -p "${GOCACHE}" && \
touch "${GOCACHE}"/file.txt && \
${GOCACHE}/file.txt:
mkdir -p "${GOCACHE}"
touch "${GOCACHE}"/file.txt

buildsrc: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a node_exporter NONGO_BIN ${GOCACHE}/file.txt
go install $(GOTRIMPATH) $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./...

buildsrc-special:
Expand Down
2 changes: 1 addition & 1 deletion agreement/fuzzer/networkFacade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func MakeNetworkFacade(fuzzer *Fuzzer, nodeID int) *NetworkFacade {
n := &NetworkFacade{
fuzzer: fuzzer,
nodeID: nodeID,
mux: network.MakeMultiplexer(fuzzer.log),
mux: network.MakeMultiplexer(),
clocks: make(map[int]chan time.Time),
eventsQueues: make(map[string]int),
eventsQueuesCh: make(chan int, 1000),
Expand Down
2 changes: 1 addition & 1 deletion agreement/gossip/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func makewhiteholeNetwork(domain *whiteholeDomain) *whiteholeNetwork {
w := &whiteholeNetwork{
peer: atomic.AddUint32(&domain.peerIdx, 1),
lastMsgRead: uint32(len(domain.messages)),
mux: network.MakeMultiplexer(domain.log),
mux: network.MakeMultiplexer(),
domain: domain,
disconnected: make(map[uint32]bool),
}
Expand Down
1 change: 1 addition & 0 deletions cmd/algocfg/profileCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
cfg.EnableDeveloperAPI = true
cfg.MaxAcctLookback = 256
cfg.EnableTxnEvalTracer = true
cfg.DisableAPIAuth = true
return cfg
},
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/algocfg/profileCommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ func Test_getConfigForArg(t *testing.T) {
require.True(t, cfg.EnableFollowMode)
})

t.Run("valid config test development", func(t *testing.T) {
t.Parallel()
cfg, err := getConfigForArg("development")
require.NoError(t, err)
require.True(t, cfg.DisableAPIAuth)
})
}
23 changes: 14 additions & 9 deletions cmd/algod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ package main
import (
"flag"
"fmt"
"github.com/algorand/go-algorand/util"
"math/rand"
"os"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/algorand/go-deadlock"
"github.com/gofrs/flock"

"github.com/algorand/go-algorand/config"
Expand All @@ -39,8 +37,11 @@ import (
"github.com/algorand/go-algorand/network"
"github.com/algorand/go-algorand/protocol"
toolsnet "github.com/algorand/go-algorand/tools/network"
"github.com/algorand/go-algorand/util"
"github.com/algorand/go-algorand/util/metrics"
"github.com/algorand/go-algorand/util/tokens"

"github.com/algorand/go-deadlock"
)

var dataDirectory = flag.String("d", "", "Root Algorand daemon data path")
Expand Down Expand Up @@ -234,15 +235,19 @@ func run() int {
Genesis: genesis,
}

// Generate a REST API token if one was not provided
apiToken, wroteNewToken, err := tokens.ValidateOrGenerateAPIToken(s.RootPath, tokens.AlgodTokenFilename)
if !cfg.DisableAPIAuth {
// Generate a REST API token if one was not provided
apiToken, wroteNewToken, err2 := tokens.ValidateOrGenerateAPIToken(s.RootPath, tokens.AlgodTokenFilename)

if err != nil {
log.Fatalf("API token error: %v", err)
}
if err2 != nil {
log.Fatalf("API token error: %v", err2)
}

if wroteNewToken {
fmt.Printf("No REST API Token found. Generated token: %s\n", apiToken)
if wroteNewToken {
fmt.Printf("No REST API Token found. Generated token: %s\n", apiToken)
}
} else {
fmt.Printf("Public (non-admin) API authentication disabled. %s not generated\n", tokens.AlgodTokenFilename)
}

// Generate a admin REST API token if one was not provided
Expand Down
28 changes: 16 additions & 12 deletions cmd/goal/clerk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ var (
simulateAllowMoreOpcodeBudget bool
simulateExtraOpcodeBudget uint64

simulateFullTrace bool
simulateEnableRequestTrace bool
simulateStackChange bool
simulateScratchChange bool
simulateFullTrace bool
simulateEnableRequestTrace bool
simulateStackChange bool
simulateScratchChange bool
simulateAllowUnnamedResources bool
)

func init() {
Expand Down Expand Up @@ -171,6 +172,7 @@ func init() {
simulateCmd.Flags().BoolVar(&simulateEnableRequestTrace, "trace", false, "Enable simulation time execution trace of app calls")
simulateCmd.Flags().BoolVar(&simulateStackChange, "stack", false, "Report stack change during simulation time")
simulateCmd.Flags().BoolVar(&simulateScratchChange, "scratch", false, "Report scratch change during simulation time")
simulateCmd.Flags().BoolVar(&simulateAllowUnnamedResources, "allow-unnamed-resources", false, "Allow access to unnamed resources during simulation")
}

var clerkCmd = &cobra.Command{
Expand Down Expand Up @@ -1281,10 +1283,11 @@ var simulateCmd = &cobra.Command{
Txns: txgroup,
},
},
AllowEmptySignatures: simulateAllowEmptySignatures,
AllowMoreLogging: simulateAllowMoreLogging,
ExtraOpcodeBudget: simulateExtraOpcodeBudget,
ExecTraceConfig: traceCmdOptionToSimulateTraceConfigModel(),
AllowEmptySignatures: simulateAllowEmptySignatures,
AllowMoreLogging: simulateAllowMoreLogging,
AllowUnnamedResources: simulateAllowUnnamedResources,
ExtraOpcodeBudget: simulateExtraOpcodeBudget,
ExecTraceConfig: traceCmdOptionToSimulateTraceConfigModel(),
}
err := writeFile(requestOutFilename, protocol.EncodeJSON(simulateRequest), 0600)
if err != nil {
Expand All @@ -1305,10 +1308,11 @@ var simulateCmd = &cobra.Command{
Txns: txgroup,
},
},
AllowEmptySignatures: simulateAllowEmptySignatures,
AllowMoreLogging: simulateAllowMoreLogging,
ExtraOpcodeBudget: simulateExtraOpcodeBudget,
ExecTraceConfig: traceCmdOptionToSimulateTraceConfigModel(),
AllowEmptySignatures: simulateAllowEmptySignatures,
AllowMoreLogging: simulateAllowMoreLogging,
AllowUnnamedResources: simulateAllowUnnamedResources,
ExtraOpcodeBudget: simulateExtraOpcodeBudget,
ExecTraceConfig: traceCmdOptionToSimulateTraceConfigModel(),
}
simulateResponse, responseErr = client.SimulateTransactions(simulateRequest)
} else {
Expand Down
5 changes: 5 additions & 0 deletions cmd/pingpong/runCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ var generatedAccountsOffset uint64
var generatedAccountSampleMethod string
var configPath string
var latencyPath string
var asyncSending bool

func init() {
rootCmd.AddCommand(runCmd)
Expand Down Expand Up @@ -132,6 +133,7 @@ func init() {
runCmd.Flags().BoolVar(&randomLease, "randomlease", false, "set the lease to contain a random value")
runCmd.Flags().BoolVar(&rekey, "rekey", false, "Create RekeyTo transactions. Requires groupsize=2 and any of random flags exc random dst")
runCmd.Flags().Uint32Var(&duration, "duration", 0, "The number of seconds to run the pingpong test, forever if 0")
runCmd.Flags().BoolVar(&asyncSending, "async", false, "Use async sending mode")
runCmd.Flags().Uint32Var(&nftAsaPerSecond, "nftasapersecond", 0, "The number of NFT-style ASAs to create per second")
runCmd.Flags().StringVar(&pidFile, "pidfile", "", "path to write process id of this pingpong")
runCmd.Flags().StringVar(&cpuprofile, "cpuprofile", "", "write cpu profile to `file`")
Expand Down Expand Up @@ -294,6 +296,9 @@ var runCmd = &cobra.Command{
if duration > 0 {
cfg.MaxRuntime = time.Duration(uint32(duration)) * time.Second
}
if asyncSending {
cfg.AsyncSending = true
}
if randomNote {
cfg.RandomNote = true
}
Expand Down
5 changes: 4 additions & 1 deletion config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Local struct {
// Version tracks the current version of the defaults so we can migrate old -> new
// This is specifically important whenever we decide to change the default value
// for an existing parameter. This field tag must be updated any time we add a new version.
Version uint32 `version[0]:"0" version[1]:"1" version[2]:"2" version[3]:"3" version[4]:"4" version[5]:"5" version[6]:"6" version[7]:"7" version[8]:"8" version[9]:"9" version[10]:"10" version[11]:"11" version[12]:"12" version[13]:"13" version[14]:"14" version[15]:"15" version[16]:"16" version[17]:"17" version[18]:"18" version[19]:"19" version[20]:"20" version[21]:"21" version[22]:"22" version[23]:"23" version[24]:"24" version[25]:"25" version[26]:"26" version[27]:"27" version[28]:"28" version[29]:"29"`
Version uint32 `version[0]:"0" version[1]:"1" version[2]:"2" version[3]:"3" version[4]:"4" version[5]:"5" version[6]:"6" version[7]:"7" version[8]:"8" version[9]:"9" version[10]:"10" version[11]:"11" version[12]:"12" version[13]:"13" version[14]:"14" version[15]:"15" version[16]:"16" version[17]:"17" version[18]:"18" version[19]:"19" version[20]:"20" version[21]:"21" version[22]:"22" version[23]:"23" version[24]:"24" version[25]:"25" version[26]:"26" version[27]:"27" version[28]:"28" version[29]:"29" version[30]:"30"`

// environmental (may be overridden)
// When enabled, stores blocks indefinitely, otherwise, only the most recent blocks
Expand Down Expand Up @@ -532,6 +532,9 @@ type Local struct {
// The private key provided must be an ed25519 private key.
// This is only used when P2PEnable is true. If the parameter is not set, it uses the default location.
P2PPrivateKeyLocation string `version[29]:""`

// DisableAPIAuth turns off authentication for public (non-admin) API endpoints.
DisableAPIAuth bool `version[30]:"false"`
}

// DNSBootstrapArray returns an array of one or more DNS Bootstrap identifiers
Expand Down
3 changes: 2 additions & 1 deletion config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package config

var defaultLocal = Local{
Version: 29,
Version: 30,
AccountUpdatesStatsInterval: 5000000000,
AccountsRebuildSynchronousMode: 1,
AgreementIncomingBundlesQueueLength: 15,
Expand Down Expand Up @@ -50,6 +50,7 @@ var defaultLocal = Local{
DNSSecurityFlags: 1,
DeadlockDetection: 0,
DeadlockDetectionThreshold: 30,
DisableAPIAuth: false,
DisableLedgerLRUCache: false,
DisableLocalhostConnectionRateLimit: true,
DisableNetworking: false,
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const VersionMajor = 3

// VersionMinor is the Minor semantic version number (x.#.z) - changed when backwards-compatible features are introduced.
// Not enforced until after initial public release (x > 0).
const VersionMinor = 17
const VersionMinor = 18

// Version is the type holding our full version information.
type Version struct {
Expand Down
Loading

0 comments on commit 06d9cba

Please sign in to comment.