Skip to content

Commit

Permalink
Merge tag 'v0.24.0' into bump-to-v0.24.0
Browse files Browse the repository at this point in the history
v0.24.0
  • Loading branch information
ygaberman-px committed Jan 9, 2024
2 parents 2a1e888 + b1b9420 commit f5696a2
Show file tree
Hide file tree
Showing 241 changed files with 9,163 additions and 1,961 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ coverage.txt
btcec/coverage.txt
btcutil/coverage.txt
btcutil/psbt/coverage.txt

# vim
*.swp

# Binaries produced by "make build"
/addblock
/btcctl
/btcd
/findcheckpoint
/gencerts
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ARG ARCH=amd64
FROM golang@sha256:c80567372be0d486766593cc722d3401038e2f150a0f6c5c719caa63afb4026a AS build-container

ARG ARCH
ENV GO111MODULE=on

ADD . /app
WORKDIR /app
Expand All @@ -35,7 +34,7 @@ RUN set -ex \
&& echo "Compiling for $GOARCH" \
&& go install -v . ./cmd/...

FROM $ARCH/alpine:3.12
FROM $ARCH/alpine:3.16

COPY --from=build-container /go/bin /bin

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2013-2022 The btcsuite developers
Copyright (c) 2013-2023 The btcsuite developers
Copyright (c) 2015-2016 The Decred developers

Permission to use, copy, modify, and distribute this software for any
Expand Down
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ GOACC_BIN := $(GO_BIN)/go-acc
LINT_COMMIT := v1.18.0
GOACC_COMMIT := 80342ae2e0fcf265e99e76bcc4efd022c7c3811b

DEPGET := cd /tmp && GO111MODULE=on go get -v
GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -v
DEPGET := cd /tmp && go get -v
GOBUILD := go build -v
GOINSTALL := go install -v
DEV_TAGS := rpctest
GOTEST_DEV = GO111MODULE=on go test -v -tags=$(DEV_TAGS)
GOTEST := GO111MODULE=on go test -v
GOTEST_DEV = go test -v -tags=$(DEV_TAGS)
GOTEST := go test -v

GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")

Expand Down Expand Up @@ -71,6 +71,19 @@ build:
$(GOBUILD) $(PKG)/cmd/findcheckpoint
$(GOBUILD) $(PKG)/cmd/addblock

install:
@$(call print, "Installing all binaries")
$(GOINSTALL) $(PKG)
$(GOINSTALL) $(PKG)/cmd/btcctl
$(GOINSTALL) $(PKG)/cmd/gencerts
$(GOINSTALL) $(PKG)/cmd/findcheckpoint
$(GOINSTALL) $(PKG)/cmd/addblock

release-install:
@$(call print, "Installing btcd and btcctl release binaries")
env CGO_ENABLED=0 $(GOINSTALL) -trimpath -ldflags="-s -w -buildid=" $(PKG)
env CGO_ENABLED=0 $(GOINSTALL) -trimpath -ldflags="-s -w -buildid=" $(PKG)/cmd/btcctl

# =======
# TESTING
# =======
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ which are both under active development.

## Requirements

[Go](http://golang.org) 1.16 or newer.
[Go](http://golang.org) 1.17 or newer.

## Installation

Expand All @@ -63,7 +63,7 @@ recommended that `GOPATH` is set to a directory in your home directory such as

```bash
$ cd $GOPATH/src/github.com/btcsuite/btcd
$ GO111MODULE=on go install -v . ./cmd/...
$ go install -v . ./cmd/...
```

- btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did
Expand All @@ -79,7 +79,7 @@ $ GO111MODULE=on go install -v . ./cmd/...
```bash
$ cd $GOPATH/src/github.com/btcsuite/btcd
$ git pull
$ GO111MODULE=on go install -v . ./cmd/...
$ go install -v . ./cmd/...
```

## Getting Started
Expand Down
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

The last major `btcd` release is to be considered the current support version.
Given an issue severe enough, a backport will be issued either to the prior
major release or the set of releases considered utilized enough.

## Reporting a Vulnerability

To report security issues, send an email to [email protected]
(this list isn't to be used for support).

The following key can be used to communicate sensitive information: `91FE 464C
D751 01DA 6B6B AB60 555C 6465 E5BC B3AF`.
2 changes: 1 addition & 1 deletion addrmgr/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
Package addrmgr implements concurrency safe Bitcoin address manager.
Address Manager Overview
# Address Manager Overview
In order maintain the peer-to-peer Bitcoin network, there needs to be a source
of addresses to connect to as nodes come and go. The Bitcoin protocol provides
Expand Down
2 changes: 1 addition & 1 deletion addrmgr/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
ipNet("192.168.0.0", 16, 32),
}

// rfc2544Net specifies the the IPv4 block as defined by RFC2544
// rfc2544Net specifies the IPv4 block as defined by RFC2544
// (198.18.0.0/15)
rfc2544Net = ipNet("198.18.0.0", 15, 32)

Expand Down
2 changes: 1 addition & 1 deletion blockchain/accept.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package blockchain
import (
"fmt"

"github.com/btcsuite/btcd/database"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/database"
)

// maybeAcceptBlock potentially accepts a block into the block chain and, if
Expand Down
44 changes: 44 additions & 0 deletions blockchain/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
)

// BenchmarkIsCoinBase performs a simple benchmark against the IsCoinBase
Expand All @@ -29,3 +30,46 @@ func BenchmarkIsCoinBaseTx(b *testing.B) {
IsCoinBaseTx(tx)
}
}

func BenchmarkUtxoFetchMap(b *testing.B) {
block := Block100000
transactions := block.Transactions
b.ResetTimer()

for i := 0; i < b.N; i++ {
needed := make(map[wire.OutPoint]struct{}, len(transactions))
for _, tx := range transactions[1:] {
for _, txIn := range tx.TxIn {
needed[txIn.PreviousOutPoint] = struct{}{}
}
}
}
}

func BenchmarkUtxoFetchSlices(b *testing.B) {
block := Block100000
transactions := block.Transactions
b.ResetTimer()

for i := 0; i < b.N; i++ {
needed := make([]wire.OutPoint, 0, len(transactions))
for _, tx := range transactions[1:] {
for _, txIn := range tx.TxIn {
needed = append(needed, txIn.PreviousOutPoint)
}
}
}
}

func BenchmarkAncestor(b *testing.B) {
height := 1 << 19
blockNodes := chainedNodes(nil, height)

b.ResetTimer()
for i := 0; i < b.N; i++ {
blockNodes[len(blockNodes)-1].Ancestor(0)
for j := 0; j <= 19; j++ {
blockNodes[len(blockNodes)-1].Ancestor(1 << j)
}
}
}
Loading

0 comments on commit f5696a2

Please sign in to comment.