From 6ff066c34430a78dc174f605e96510de9bedb0e1 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Tue, 23 Apr 2024 01:49:24 +0900 Subject: [PATCH 01/13] main, utreexoctl: bump version --- cmd/utreexoctl/version.go | 2 +- version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/utreexoctl/version.go b/cmd/utreexoctl/version.go index edb42dbe7..c8651f91f 100644 --- a/cmd/utreexoctl/version.go +++ b/cmd/utreexoctl/version.go @@ -17,7 +17,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr // versioning 2.0.0 spec (http://semver.org/). const ( appMajor uint = 0 - appMinor uint = 22 + appMinor uint = 1 appPatch uint = 0 // appPreRelease MUST only contain characters from semanticAlphabet diff --git a/version.go b/version.go index 422befa26..3dad0c66d 100644 --- a/version.go +++ b/version.go @@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr const ( appMajor uint = 0 appMinor uint = 2 - appPatch uint = 2 + appPatch uint = 3 // appPreRelease MUST only contain characters from semanticAlphabet // per the semantic versioning spec. From 4473ac35bbd6824e6ab272719de4f2bcef075cde Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Thu, 25 Apr 2024 15:43:07 +0900 Subject: [PATCH 02/13] release: add a script to generate a release with bdkwallet --- release/get-alpinelinux-deps.sh | 4 + release/get-rustup-targets.sh | 11 +++ release/install-musl-deps.sh | 31 +++++++ release/release-with-wallet.sh | 148 ++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 release/get-alpinelinux-deps.sh create mode 100644 release/get-rustup-targets.sh create mode 100644 release/install-musl-deps.sh create mode 100755 release/release-with-wallet.sh diff --git a/release/get-alpinelinux-deps.sh b/release/get-alpinelinux-deps.sh new file mode 100644 index 000000000..f3a694b7b --- /dev/null +++ b/release/get-alpinelinux-deps.sh @@ -0,0 +1,4 @@ +apk add git +apk add go +apk add zip # windows binary compression +apk add perl-utils # To get shasum diff --git a/release/get-rustup-targets.sh b/release/get-rustup-targets.sh new file mode 100644 index 000000000..3737d26db --- /dev/null +++ b/release/get-rustup-targets.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +rustup target add aarch64-unknown-linux-musl +rustup target add x86_64-unknown-linux-musl +rustup target add arm-unknown-linux-musleabihf +rustup target add armv7-unknown-linux-musleabihf + +rustup target add aarch64-apple-darwin +rustup target add x86_64-apple-darwin + +rustup target add x86_64-pc-windows-gnu diff --git a/release/install-musl-deps.sh b/release/install-musl-deps.sh new file mode 100644 index 000000000..5fdbdaf04 --- /dev/null +++ b/release/install-musl-deps.sh @@ -0,0 +1,31 @@ +cd $HOME + +curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz +curl -LO https://musl.cc/arm-linux-musleabihf-cross.tgz +curl -LO https://musl.cc/armv6-linux-musleabihf-cross.tgz +curl -LO https://musl.cc/armv7l-linux-musleabihf-cross.tgz +curl -LO https://musl.cc/x86_64-linux-musl-cross.tgz +curl -LO https://musl.cc/x86_64-w64-mingw32-cross.tgz + +tar -xzf aarch64-linux-musl-cross.tgz +tar -xzf arm-linux-musleabihf-cross.tgz +tar -xzf armv6-linux-musleabihf-cross.tgz +tar -xzf armv7l-linux-musleabihf-cross.tgz +tar -xzf x86_64-linux-musl-cross.tgz +tar -xzf x86_64-w64-mingw32-cross.tgz + +rm aarch64-linux-musl-cross.tgz +rm arm-linux-musleabihf-cross.tgz +rm armv6-linux-musleabihf-cross.tgz +rm armv7l-linux-musleabihf-cross.tgz +rm x86_64-linux-musl-cross.tgz +rm x86_64-w64-mingw32-cross.tgz + +echo export PATH=\$PATH:${HOME}/arm-linux-musleabihf-cross/bin >> $HOME/.profile +echo export PATH=\$PATH:${HOME}/armv6-linux-musleabihf-cross/bin >> $HOME/.profile +echo export PATH=\$PATH:${HOME}/armv7l-linux-musleabihf-cross/bin >> $HOME/.profile +echo export PATH=\$PATH:${HOME}/aarch64-linux-musl-cross/bin >> $HOME/.profile +echo export PATH=\$PATH:${HOME}/x86_64-linux-musl-cross/bin >> $HOME/.profile +echo export PATH=\$PATH:${HOME}/x86_64-w64-mingw32-cross/bin >> $HOME/.profile + +echo "To add the binary paths:" ". $HOME/.profile" diff --git a/release/release-with-wallet.sh b/release/release-with-wallet.sh new file mode 100755 index 000000000..cdbdbb873 --- /dev/null +++ b/release/release-with-wallet.sh @@ -0,0 +1,148 @@ +#!/bin/bash + +# Copyright (c) 2016 Company 0, LLC. +# Copyright (c) 2016-2020 The btcsuite developers +# Use of this source code is governed by an ISC +# license that can be found in the LICENSE file. + +# Simple bash script to build basic utreexod tools for all the platforms we support +# with the golang cross-compiler. + +set -e + +# If no tag specified, use date + version otherwise use tag. +if [[ $1x = x ]]; then + DATE=`date +%Y%m%d` + VERSION="01" + TAG=$DATE-$VERSION +else + TAG=$1 +fi + +go mod vendor +tar -cvzf vendor.tar.gz vendor + +PACKAGE=utreexod +MAINDIR=$PACKAGE-$TAG +mkdir -p $MAINDIR + +cp vendor.tar.gz $MAINDIR/ +rm vendor.tar.gz +rm -r vendor + +PACKAGESRC="$MAINDIR/$PACKAGE-source-$TAG.tar" +git archive -o $PACKAGESRC HEAD +gzip -f $PACKAGESRC > "$PACKAGESRC.gz" + +cd $MAINDIR + +SYS= + +if [[ $(uname) == Linux ]]; then + # If BTCDBUILDSYS is set the default list is ignored. Useful to release + # for a subset of systems/architectures. + SYS=${BTCDBUILDSYS:-" + linux-armv6 + linux-armv7 + linux-arm64 + linux-amd64 + windows-amd64 + "} +elif [[ $(uname) == Darwin ]]; then + # If BTCDBUILDSYS is set the default list is ignored. Useful to release + # for a subset of systems/architectures. + SYS=${BTCDBUILDSYS:-" + darwin-amd64 + darwin-arm64 + "} +fi + +CPUCORES= +if [[ $(uname) == Linux ]]; then + CPUCORES=$(lscpu | grep "Core(s) per socket" | awk '{print $4}') +elif [[ $(uname) == Darwin ]]; then + CPUCORES=$(sysctl -n hw.physicalcpu) +fi + +# Use the first element of $GOPATH in the case where GOPATH is a list +# (something that is totally allowed). +PKG="github.com/utreexo/utreexod" +COMMIT=$(git describe --tags --abbrev=40 --dirty) + +for i in $SYS; do + OS=$(echo $i | cut -f1 -d-) + ARCH=$(echo $i | cut -f2 -d-) + ARM= + CC= + + if [[ $ARCH = "armv6" ]]; then + ARCH=arm + ARM=6 + elif [[ $ARCH = "armv7" ]]; then + ARCH=arm + ARM=7 + fi + + mkdir $PACKAGE-$i-$TAG + echo "cd to" $PACKAGE-$i-$TAG + cd $PACKAGE-$i-$TAG + + # Build bdk wallet(rust) dependency. + if [[ $ARCH = "arm64" ]] && [[ $OS = "linux" ]]; then + TARGET="aarch64-unknown-linux-musl" + CC=aarch64-linux-musl-gcc + + elif [[ $ARCH = "amd64" ]] && [[ $OS = "linux" ]]; then + TARGET="x86_64-unknown-linux-musl" + CC=x86_64-linux-musl-gcc + + elif [[ $ARCH = "arm" ]] && [[ $OS = "linux" ]] && [[ $ARM=7 ]]; then + TARGET="armv7-unknown-linux-musleabihf" + CC=armv7l-linux-musleabihf-gcc + + elif [[ $ARCH = "arm" ]] && [[ $OS = "linux" ]] && [[ $ARM=6 ]]; then + TARGET="armv6-unknown-linux-musleabihf" + CC=armv6-linux-musleabihf-gcc + + elif [[ $ARCH = "arm64" ]] && [[ $OS = "darwin" ]]; then + TARGET="aarch64-apple-darwin" + + elif [[ $ARCH = "amd64" ]] && [[ $OS = "darwin" ]]; then + TARGET="x86_64-apple-darwin" + + elif [[ $ARCH = "amd64" ]] && [[ $OS = "windows" ]]; then + TARGET="x86_64-pc-windows-gnu" + CC=x86_64-w64-mingw32-gcc + fi + + env CARGO_TARGET_DIR=. cargo build --release --target=$TARGET --jobs=$CPUCORES + mv $TARGET target + + echo "Building:" $OS $ARCH $ARM + + # Build utreexod + if [[ $OS == "linux" ]]; then + env CC=$CC CGO_ENABLED=1 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -tags="bdkwallet" -ldflags="-s -w -extldflags "-static" -buildid=" github.com/utreexo/utreexod + elif [[ $OS == "darwin" ]]; then + env CGO_ENABLED=1 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -tags="bdkwallet" -ldflags="-s -w -buildid=" github.com/utreexo/utreexod + fi + + # Remove bdk build things. + rm -rf target + rm -rf release + + # Build utreexoctl + env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags="-s -w -buildid=" github.com/utreexo/utreexod/cmd/utreexoctl + + cd .. + + if [[ $OS = "windows" ]]; then + zip -r $PACKAGE-$i-$TAG.zip $PACKAGE-$i-$TAG + else + tar -cvzf $PACKAGE-$i-$TAG.tar.gz $PACKAGE-$i-$TAG + fi + + rm -r $PACKAGE-$i-$TAG +done + +shasum -a 256 * > manifest-$TAG.txt From f60f21772f5f58ea72ae6ee3ed82f2e80c904e29 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Tue, 30 Apr 2024 14:15:44 +0700 Subject: [PATCH 03/13] Update README.md Add a discord link that doesn't expire. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6d217e93..e52fcd718 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ nodes are needed to allow for utreexo nodes without a soft fork. To run a bridge ## Community -[Discord](https://discord.gg/RVpDZQVN) +[Discord](https://discord.gg/6jRY2hqf3G) ## Issue Tracker From 01aa21a21c0f7bc4e99d52cb59752e10f3ad832a Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Wed, 1 May 2024 15:27:52 +0900 Subject: [PATCH 04/13] netsync: ignore invs when we're in headers build mode When a tx inv was given, we may get stuck as it interferes with the headers building. Ignoring all invs when we're in headers build avoids this problem. --- netsync/manager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netsync/manager.go b/netsync/manager.go index f58aedf26..5c988669d 100644 --- a/netsync/manager.go +++ b/netsync/manager.go @@ -1298,6 +1298,11 @@ func (sm *SyncManager) handleInvMsg(imsg *invMsg) { return } + // Ignore invs when we're in headers build mode. + if sm.headersBuildMode { + return + } + // If our chain is current and a peer announces a block we already // know of, then update their current block height. if lastBlock != -1 && sm.current() { From bacd71047133f065105cd55958cd50dd76303ef3 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Wed, 1 May 2024 18:11:12 +0900 Subject: [PATCH 05/13] btcjson: add command for getting the best state --- btcjson/chainsvrcmds.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/btcjson/chainsvrcmds.go b/btcjson/chainsvrcmds.go index 7cc1888b5..d194d63ad 100644 --- a/btcjson/chainsvrcmds.go +++ b/btcjson/chainsvrcmds.go @@ -268,6 +268,15 @@ func NewGetBlockCountCmd() *GetBlockCountCmd { return &GetBlockCountCmd{} } +// GetBestStateCmd defines the getbeststate JSON-RPC command. +type GetBestStateCmd struct{} + +// NewGetBestState returns a new instance which can be used to issue a +// getbeststate JSON-RPC command. +func NewGetBestState() *GetBestStateCmd { + return &GetBestStateCmd{} +} + // FilterTypeName defines the type used in the getblockfilter JSON-RPC command for the // filter type field. type FilterTypeName string @@ -1273,6 +1282,7 @@ func init() { MustRegisterCmd("fundrawtransaction", (*FundRawTransactionCmd)(nil), flags) MustRegisterCmd("getaddednodeinfo", (*GetAddedNodeInfoCmd)(nil), flags) MustRegisterCmd("getbestblockhash", (*GetBestBlockHashCmd)(nil), flags) + MustRegisterCmd("getbeststate", (*GetBestStateCmd)(nil), flags) MustRegisterCmd("getblock", (*GetBlockCmd)(nil), flags) MustRegisterCmd("getblockchaininfo", (*GetBlockChainInfoCmd)(nil), flags) MustRegisterCmd("getblockcount", (*GetBlockCountCmd)(nil), flags) From 612b482941f3b125ef7cde1b9572a3917313c3d6 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Wed, 1 May 2024 18:12:05 +0900 Subject: [PATCH 06/13] btcjson: add result for getbeststate --- btcjson/chainsvrresults.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/btcjson/chainsvrresults.go b/btcjson/chainsvrresults.go index dc30867f0..53f080163 100644 --- a/btcjson/chainsvrresults.go +++ b/btcjson/chainsvrresults.go @@ -149,6 +149,18 @@ type GetBlockVerboseTxResult struct { NextHash string `json:"nextblockhash,omitempty"` } +// GetBestStateResult models the data from the getbeststate command. +type GetBestStateResult struct { + Hash string `json:"hash"` // The hash of the block. + Height int32 `json:"height"` // The height of the block. + Bits uint32 `json:"bits"` // The difficulty bits of the block. + BlockSize uint64 `json:"blocksize"` // The size of the block. + BlockWeight uint64 `json:"blockweight"` // The weight of the block. + NumTxns uint64 `json:"numtxns"` // The number of txns in the block. + TotalTxns uint64 `json:"totaltxns"` // The total number of txns in the chain. + MedianTime int64 `json:"mediantime"` // Median time as per CalcPastMedianTime. +} + // GetChainTipsResult models the data from the getchaintips command. type GetChainTipsResult struct { Height int32 `json:"height"` From 1faf37b7cca9d216bcca7d3a2cbc7e36e26b672d Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Wed, 1 May 2024 18:14:20 +0900 Subject: [PATCH 07/13] main: add getbeststate command to rpc The getbeststate rpc mainly helps with setting new assumeutreexo points as the beststate information is necessary for setting them. --- rpcserver.go | 19 +++++++++++++++++++ rpcserverhelp.go | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 1d864caa2..14b0cea30 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -148,6 +148,7 @@ var rpcHandlersBeforeInit = map[string]commandHandler{ "getaddednodeinfo": handleGetAddedNodeInfo, "getbestblock": handleGetBestBlock, "getbestblockhash": handleGetBestBlockHash, + "getbeststate": handleGetBestState, "getblock": handleGetBlock, "getblockchaininfo": handleGetBlockChainInfo, "getblockcount": handleGetBlockCount, @@ -285,6 +286,7 @@ var rpcLimited = map[string]struct{}{ "estimatefee": {}, "getbestblock": {}, "getbestblockhash": {}, + "getbeststate": {}, "getblock": {}, "getblockcount": {}, "getblockhash": {}, @@ -1191,6 +1193,23 @@ func handleGetBestBlockHash(s *rpcServer, cmd interface{}, closeChan <-chan stru return best.Hash.String(), nil } +// handleGetBestState implements the getbeststate command. +func handleGetBestState(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) { + best := s.cfg.Chain.BestSnapshot() + reply := btcjson.GetBestStateResult{ + Hash: best.Hash.String(), + Height: best.Height, + Bits: best.Bits, + BlockSize: best.BlockSize, + BlockWeight: best.BlockWeight, + NumTxns: best.NumTxns, + TotalTxns: best.TotalTxns, + MedianTime: best.MedianTime.Unix(), + } + + return reply, nil +} + // getDifficultyRatio returns the proof-of-work difficulty as a multiple of the // minimum difficulty using the passed bits field from the header of a block. func getDifficultyRatio(bits uint32, params *chaincfg.Params) float64 { diff --git a/rpcserverhelp.go b/rpcserverhelp.go index 8333e6f70..8443fd2f8 100644 --- a/rpcserverhelp.go +++ b/rpcserverhelp.go @@ -189,6 +189,19 @@ var helpDescsEnUS = map[string]string{ "getbestblockhash--synopsis": "Returns the hash of the of the best (most recent) block in the longest block chain.", "getbestblockhash--result0": "The hex-encoded block hash", + // GetBestStateCmd help. + "getbeststate--synopsis": "Returns the current best state and the information associated with it in the longest block chain.", + + // GetBestStateResult help. + "getbeststateresult-hash": "The hash of the block", + "getbeststateresult-height": "The height of the block", + "getbeststateresult-bits": "The difficultly bits of the block", + "getbeststateresult-blocksize": "The blocksize of the block", + "getbeststateresult-blockweight": "The blockweight of the block", + "getbeststateresult-numtxns": "The number of transactions in the block", + "getbeststateresult-totaltxns": "The total number of transactions in the longest chain", + "getbeststateresult-mediantime": "The median time of the block in unix time", + // GetBlockCmd help. "getblock--synopsis": "Returns information about a block given its hash.", "getblock-hash": "The hash of the block", @@ -894,6 +907,7 @@ var rpcResultTypes = map[string][]interface{}{ "getaddednodeinfo": {(*[]string)(nil), (*[]btcjson.GetAddedNodeInfoResult)(nil)}, "getbestblock": {(*btcjson.GetBestBlockResult)(nil)}, "getbestblockhash": {(*string)(nil)}, + "getbeststate": {(*btcjson.GetBestStateResult)(nil)}, "getblock": {(*string)(nil), (*btcjson.GetBlockVerboseResult)(nil)}, "getblockcount": {(*int64)(nil)}, "getblockhash": {(*string)(nil)}, From 7de71f52a2f793cecd119c7b4bfc6796bc881609 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Wed, 1 May 2024 18:15:16 +0900 Subject: [PATCH 08/13] cmd/utreexoctl: bump version Bump version as new feature `getbeststate command was added`. --- cmd/utreexoctl/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/utreexoctl/version.go b/cmd/utreexoctl/version.go index c8651f91f..47c11c0f1 100644 --- a/cmd/utreexoctl/version.go +++ b/cmd/utreexoctl/version.go @@ -17,7 +17,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr // versioning 2.0.0 spec (http://semver.org/). const ( appMajor uint = 0 - appMinor uint = 1 + appMinor uint = 2 appPatch uint = 0 // appPreRelease MUST only contain characters from semanticAlphabet From 1642bfa52921e74f124004ea96b903b65922303a Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Thu, 2 May 2024 18:28:08 +0900 Subject: [PATCH 09/13] connmgr: ignore dnsseeds that don't support filetering for utreexo nodes Utreexo nodes need to be connected to other utreexo nodes to get txs and blocks. Ignore the seeds that do not support filtering as they gives nodes that don't provide the required data. --- connmgr/seed.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/connmgr/seed.go b/connmgr/seed.go index 5d20afce1..5ba88f2f5 100644 --- a/connmgr/seed.go +++ b/connmgr/seed.go @@ -35,6 +35,12 @@ func SeedFromDNS(chainParams *chaincfg.Params, reqServices wire.ServiceFlag, for _, dnsseed := range chainParams.DNSSeeds { var host string + + // Ignore seeds that don't have filtering the reqServices include utreexo bit. + if !dnsseed.HasFiltering && reqServices&wire.SFNodeUtreexo == wire.SFNodeUtreexo { + continue + } + if !dnsseed.HasFiltering || reqServices == wire.SFNodeNetwork { host = dnsseed.Host } else { From 107896f4fdf7382aed2e3d9ba21ae7b3c461906c Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Thu, 2 May 2024 19:44:35 +0900 Subject: [PATCH 10/13] blockchain, wire: rename ToString() to String() Doing this allows pretty printing because for %v go will call String() instead of printing out a byte slice. --- blockchain/utreexoviewpoint.go | 2 +- wire/leaf.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain/utreexoviewpoint.go b/blockchain/utreexoviewpoint.go index dbaa9c7d8..447b6c406 100644 --- a/blockchain/utreexoviewpoint.go +++ b/blockchain/utreexoviewpoint.go @@ -960,7 +960,7 @@ func (b *BlockChain) VerifyUData(ud *wire.UData, txIns []*wire.TxIn, remember bo for i, txIn := range txIns { leafHash := ud.LeafDatas[i].LeafHash() str += fmt.Sprintf("txIn: %s, leafdata: %s, hash %s\n", txIn.PreviousOutPoint.String(), - ud.LeafDatas[i].ToString(), hex.EncodeToString(leafHash[:])) + ud.LeafDatas[i].String(), hex.EncodeToString(leafHash[:])) } str += fmt.Sprintf("err: %s", err.Error()) return fmt.Errorf(str) diff --git a/wire/leaf.go b/wire/leaf.go index 5a2c9907f..40587e9ac 100644 --- a/wire/leaf.go +++ b/wire/leaf.go @@ -133,8 +133,8 @@ func (l *LeafData) LeafHash() [32]byte { return *(*[32]byte)(digest.Sum(nil)) } -// ToString turns a LeafData into a string for logging. -func (l *LeafData) ToString() (s string) { +// String turns a LeafData into a string for logging. +func (l *LeafData) String() (s string) { s += fmt.Sprintf("BlockHash:%s,", hex.EncodeToString(l.BlockHash[:])) s += fmt.Sprintf("OutPoint:%s,", l.OutPoint.String()) s += fmt.Sprintf("Amount:%d,", l.Amount) From b15ff653436d8f7289cb895f6f85eb81621f4151 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Thu, 2 May 2024 19:47:43 +0900 Subject: [PATCH 11/13] main: update utreexo library The updated library correctly returns the translated positions. The previously library didn't do this which lead to the node serving the tx proof to pass off an incorrect utreexo proof. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d8c2fd60e..28fe8fc6a 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/utreexo/utreexo v0.1.4 + github.com/utreexo/utreexo v0.1.5 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa golang.org/x/exp v0.0.0-20220414153411-bcd21879b8fd ) diff --git a/go.sum b/go.sum index 7829135a6..54e6682f8 100644 --- a/go.sum +++ b/go.sum @@ -95,6 +95,8 @@ github.com/utreexo/utreexo v0.1.3 h1:Z7tj8DTZNHd927ZWT7NSKx14+Dk6BoMeDPhDOmFlibo github.com/utreexo/utreexo v0.1.3/go.mod h1:RT9JpZADhLr2YJVBgp48tmUxVeAHaAbOSr6p6nAEJpI= github.com/utreexo/utreexo v0.1.4 h1:jygjZscJEzab7woP7aB6YWUKjhsV5Mrbjj873inhwR8= github.com/utreexo/utreexo v0.1.4/go.mod h1:RT9JpZADhLr2YJVBgp48tmUxVeAHaAbOSr6p6nAEJpI= +github.com/utreexo/utreexo v0.1.5 h1:nnG2VvwDYPkXCSRicV15eAbh2vvTp/g4Pot3vlseGdQ= +github.com/utreexo/utreexo v0.1.5/go.mod h1:RT9JpZADhLr2YJVBgp48tmUxVeAHaAbOSr6p6nAEJpI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From ba0b94b244974f8e021308ba60dcb2356fbcfef7 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Fri, 3 May 2024 16:13:46 +0900 Subject: [PATCH 12/13] chaincfg: update assumutreexo points Since they're a few months old, update them so users catch up to the tip faster. --- chaincfg/params.go | 143 +++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 75 deletions(-) diff --git a/chaincfg/params.go b/chaincfg/params.go index a2ea7ad09..81874a9bf 100644 --- a/chaincfg/params.go +++ b/chaincfg/params.go @@ -360,39 +360,35 @@ var MainNetParams = Params{ {691719, newHashFromStr("00000000000000000008a89e854d57e5667df88f1cdef6fde2fbca1de5b639ad")}, {724466, newHashFromStr("000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091")}, {751565, newHashFromStr("00000000000000000009c97098b5295f7e5f183ac811fb5d1534040adb93cabd")}, + {841776, newHashFromStr("00000000000000000000a174eebf5b9df9b9ebf062cc3c503a2024e7d9a618b6")}, }, AssumeUtreexoPoint: AssumeUtreexo{ - BlockHash: newHashFromStr("00000000000000000001d59b50e7f3c6dfc1f83bea022fb4c67effad7b2c8432"), - BlockHeight: 827_896, - Bits: 386_138_202, - BlockSize: 1_890_452, - BlockWeight: 3_993_389, - NumTxns: 5541, - TotalTxns: 959_176_637, - MedianTime: time.Unix(1706494022, 0), - NumLeaves: 2_411_693_882, + BlockHash: newHashFromStr("00000000000000000000a174eebf5b9df9b9ebf062cc3c503a2024e7d9a618b6"), + BlockHeight: 841_776, + Bits: 386_085_339, + BlockSize: 2_050_273, + BlockWeight: 3_993_490, + NumTxns: 4_915, + TotalTxns: 998_085_718, + MedianTime: time.Unix(1_714_648_629, 0), + NumLeaves: 2_515_124_998, Roots: []utreexo.Hash{ - newUtreexoHashFromStr("137ab5996edf52bba93ae8a62bd716de5b6d628f7a1aec8b406a3c2e8ac74fe9"), - newUtreexoHashFromStr("d1a24f7a9a5019fd2a08b7f53c3c6211ae522e285c76f47002f174d922f14647"), - newUtreexoHashFromStr("5bbf17561e53c88beb07f19665ee1c5fb6aafba8bab4899f5cc2c8bbe918cc95"), - newUtreexoHashFromStr("842eed303ad5b533fd56e3270cf0ff79936846116b465bf0e04b52720f879ba1"), - newUtreexoHashFromStr("acdf7426c896d555919b09724a27353a1e7e25c1ba2f18f2accd9bd351d63c5e"), - newUtreexoHashFromStr("aa6b38a9f3fb773fbf5a111d991af0de305af5619361e4705f94a43c1c08a0f7"), - newUtreexoHashFromStr("6c1c0bbed67827c625efe78692cd6e228366b5825ee2685f332fff7ee0ade0ea"), - newUtreexoHashFromStr("b5ccdbb16a68140ebba0392719c5c12b4eb425ec998864699bf601a1883f88dc"), - newUtreexoHashFromStr("1f511ab77a230599126949cd007f35d80db6803a84b91ade39af910e51a9d82a"), - newUtreexoHashFromStr("08c754cfabeefae7560a4d0d54047debfdfe7546b50beff49c70636a058e20f7"), - newUtreexoHashFromStr("c92789fa2dbf5a18393bdcfa6f80984733dae05346da4b3586d6b40af5e76b9e"), - newUtreexoHashFromStr("3d8a6574d6017a587a07df483df956f3033d12948d63bd6f4d9e8f15fb5d4a79"), - newUtreexoHashFromStr("485690e920ef689c0568bbd08af5a1b613753129720a8e949420fce13c935331"), - newUtreexoHashFromStr("31dbf7a421513c16a0022ded49b257c2d21fb4de119e51bbd22fa3bd9503b2e2"), - newUtreexoHashFromStr("8958b33938293139af31004a33119b824d8e5ec0a4a89fc077622af05d4079c0"), - newUtreexoHashFromStr("d395b88cc655e361dae49ecd896fa5a438895e8826d75e5a610c75fa19f62b96"), - newUtreexoHashFromStr("933f350fe0a99a3a00e1a12b14db6d3646d839cdb91b765c9ecc3329d0ecf06a"), - newUtreexoHashFromStr("9b38ed3ca200469dff49ba24aa003c6516292fc029ab320a4fd2cd2f38b577c5"), - newUtreexoHashFromStr("c8586560f2b33d93647f8c9c080e5b1ddfc78a865b45a1be78a8814799aa9893"), - newUtreexoHashFromStr("fddf07a60d20f61f73d04573405a382fdfea7e1958bd424668a98e8e24c84d65"), + newUtreexoHashFromStr("301566e2b5aa2af3ea1817218869808dee72f99b49f98bc9d1b6f837915c05e7"), + newUtreexoHashFromStr("2a108c0d59f1fc00b623f4aaf4599c81208ee5a5b15bb91b638c9c604da59142"), + newUtreexoHashFromStr("9a2c0db4419a1984966f07d21fdd265bfa73c86bcdf526e72c78f7eace0670aa"), + newUtreexoHashFromStr("ebca53c3711de97cf3054092960d227b1abd3504d5d244b8e69f446f6c5b1bf8"), + newUtreexoHashFromStr("701748078f1545e9376981863772c1574f6ccb5c8668ab0bab4cb6627f509122"), + newUtreexoHashFromStr("5aa49c03c8d14cdabd17d77affbabe4eeb97a88f03c568fd7151376246ecfaaa"), + newUtreexoHashFromStr("119d723e97eac80f7ab9e349a55d9cacafe443e20705eca06b56163dd43b4c3d"), + newUtreexoHashFromStr("159fe72e5bb3f5037a1867f5cf2819fc6642afebe0fe99782869592e189cd39f"), + newUtreexoHashFromStr("5561d2ff4fb4abe896e8be4246c2b50d0c092502d47ecbd17be9fcc7186547a3"), + newUtreexoHashFromStr("ae4478f664ff3daea18eb462a2c322a4d3aa28e73544c1e36ff6d8545e90c98c"), + newUtreexoHashFromStr("277c4287c1d203c50853b34667336a57ed17dd8e97196668f2658cf84132d715"), + newUtreexoHashFromStr("d46a01a3e0a1f4e4b4f19243bc7e8d3f90727497cc38f544ece4a72a6a1fef09"), + newUtreexoHashFromStr("078fafc7b0c89e75bdb5569a1e246eb712b7c734c2f9e033aff172dd31d377a3"), + newUtreexoHashFromStr("474627a0d790ccbded523c30f3bd469935929de4d3b935bb70f43c59755a499d"), + newUtreexoHashFromStr("72842dc330579ed0b8e0b8f938758bfff4dbb3814be240785f2bd6314c00497d"), }, }, @@ -640,33 +636,34 @@ var TestNet3Params = Params{ {2010000, newHashFromStr("0000000000004ae2f3896ca8ecd41c460a35bf6184e145d91558cece1c688a76")}, {2143398, newHashFromStr("00000000000163cfb1f97c4e4098a3692c8053ad9cab5ad9c86b338b5c00b8b7")}, {2344474, newHashFromStr("0000000000000004877fa2d36316398528de4f347df2f8a96f76613a298ce060")}, + {2810937, newHashFromStr("000000000000005a4f7ec7942d57353c6200a284e021bc5c6be0bf1415890875")}, }, AssumeUtreexoPoint: AssumeUtreexo{ - BlockHash: newHashFromStr("0000000000000001203bd7a1077069b9e4c40a8bab338c59538fb0e7916e4f23"), - BlockHeight: 2_576_614, - Bits: 421_623_221, - BlockSize: 140_705, - BlockWeight: 379_520, - NumTxns: 491, - TotalTxns: 69_779_708, - MedianTime: time.Unix(1706861100, 0), - NumLeaves: 114_223_201, + BlockHash: newHashFromStr("000000000000005a4f7ec7942d57353c6200a284e021bc5c6be0bf1415890875"), + BlockHeight: 2_810_937, + Bits: 436_273_151, + BlockSize: 1_318_898, + BlockWeight: 3_844_868, + NumTxns: 3_297, + TotalTxns: 124_627_332, + MedianTime: time.Unix(1_714_714_572, 0), + NumLeaves: 253_929_582, Roots: []utreexo.Hash{ - newUtreexoHashFromStr("a6a65fecd80a1f9560f5bad45b122143646146d9427f863b760f2b6414a227ec"), - newUtreexoHashFromStr("47add3ab053bee995abcda39ef364f38a8e1a01677a6580058d74fe55b8fcd2c"), - newUtreexoHashFromStr("d8a7e142a15ea12fbc856e801082cf29953bbac1d4b4a78d20faaf1a87cfc104"), - newUtreexoHashFromStr("18858f6adccd89617cde5fdc0a71a12fadce27057bc2976c7671d98f6a46a76b"), - newUtreexoHashFromStr("f6ce187fc1a8fa08a8802b61cf5580532c9d1815c99df2c427f91606df7f8601"), - newUtreexoHashFromStr("284f2fc969bbcd89d005a91fb8e207a3c85a3de5d4053c990ebf0fe9b071c90c"), - newUtreexoHashFromStr("97667b98d108a30acde611a98fe8b80d1958012a8c333bb2599844babb45ab7c"), - newUtreexoHashFromStr("9bfd64436944bdcbc347d5c43e156a3b6f2d1eb91849e6c7098bb82a99c9d8a1"), - newUtreexoHashFromStr("bdd2430df4a3d4155dd5f07936c18bde3b87b439f9ee3956dfab0ce7d690fb86"), - newUtreexoHashFromStr("e0ba481008329ce3d2a153c5f7c250aed7b9701ce3f97ee25d0d5b3805b54204"), - newUtreexoHashFromStr("232cd897c4de6fed1e996f214cd1710de387f003212e1cabb517d7e38a6bdbb5"), - newUtreexoHashFromStr("6c84fdcc7ece37377e0efd60db23e46ec0385d7036ddf5607bd5135220175f39"), - newUtreexoHashFromStr("54b0ad800cfd7e3ec286e02a02b7034be9a8d703fa174278d71bd8df2cc16a06"), - newUtreexoHashFromStr("62e43c966218a2b9d6deb6ced8d53d54c60b81a983d175fa4cafc9ed1e0b3d8e"), + newUtreexoHashFromStr("280cd64d7e4c18222ddfb00e53377ec12170d9361e85eea92451d21d0895fda2"), + newUtreexoHashFromStr("12e642772d82892b97ffef3b1313c003fb5654eb0ee7742419d984b37cf49dd6"), + newUtreexoHashFromStr("d2f3f632f188408c3087cc72f0cb5439f18d3e4778facefc12c0dcc4edc4f9b0"), + newUtreexoHashFromStr("42e0770222f8c0e233e564af14584b26322a039b2cb92d8cac55972c5dcfe7d4"), + newUtreexoHashFromStr("f35d0a8b2e10f3ab35679f0f87a58ba6fd514289d96a389844397ac0b126e130"), + newUtreexoHashFromStr("3cf92c2cbc0a1a79a0e334c76d0c1ae2ba00dedebad64b824ea09488b3af2552"), + newUtreexoHashFromStr("7e91cd2c01418497abeb26c583f09fedfebd800aca55715599d1b4961ede59f8"), + newUtreexoHashFromStr("522fcf0b27a5e7173b3fe5b2fdde77e2f038397793a6e3773f11d1d29df2b433"), + newUtreexoHashFromStr("30010d1bb681d868485cb7669bb83783457154ccfbd21e8a5fc229e7b0547c7f"), + newUtreexoHashFromStr("bb397cca3d07a8d7e0646ee49503af771344eb602a67372adce5c092c5493c5c"), + newUtreexoHashFromStr("bd779aef8f852a156e5d4fb3dbbd4a7b3d210417844cbe8dc7a2331e6e0fb89f"), + newUtreexoHashFromStr("bd874177c6c0ebeede72a80d37247b7a6b7a10bb944009b2aa5834c97fa1d4a5"), + newUtreexoHashFromStr("0f2082ab3c1d3d5afa980708e68daaab7a2ac4e61c5a138e71cedada6ac5cb82"), + newUtreexoHashFromStr("36497c78ca41c651cf296707d60dba90735a082c7c1cb3bd39697104f0b09ad3"), }, }, @@ -886,35 +883,31 @@ func CustomSignetParams(challenge []byte, dnsSeeds []DNSSeed) Params { checkPoints := []Checkpoint{} if bytes.Equal(challenge, DefaultSignetChallenge) { assumeUtreexoPoint = AssumeUtreexo{ - BlockHash: newHashFromStr("000000b4de6d5c61606bafcaf5c7142ed3203c2f5e9fa2de66f68132e4c9e7dc"), - BlockHeight: 180_715, - Bits: 503_398_507, - BlockSize: 2_102, - BlockWeight: 6_011, - NumTxns: 7, - TotalTxns: 2_429_129, - MedianTime: time.Unix(1706790224, 0), - NumLeaves: 3_854_054, + BlockHash: newHashFromStr("000000408463e4809d3a493baf8f17f25a919f883824f5b42247402cfeec1b73"), + BlockHeight: 193_792, + Bits: 503_401_885, + BlockSize: 8_850, + BlockWeight: 25_401, + NumTxns: 30, + TotalTxns: 3_655_830, + MedianTime: time.Unix(1_714_642_543, 0), + NumLeaves: 6_373_971, Roots: []utreexo.Hash{ - newUtreexoHashFromStr("e40250d1e2d3d3abded6e2446d1d1850bd2afc28df7d05a95ab2338f91e0ce0d"), - newUtreexoHashFromStr("c1643b2a77926d8dd0a1b015c78582639d99a07dbd05be9b922e1ac4e46f2fa4"), - newUtreexoHashFromStr("e7f566b0815d855cafeaccd187a2fe937fba40ebd232cbd19a25bb04a0fdbb58"), - newUtreexoHashFromStr("80d0d8028d2d5ca82aa6e12354c76a0cc296191a1bc001bab9724bc0e50d4f4a"), - newUtreexoHashFromStr("9b4eceb1c9f710c0cbe04cd280f24f7b4619649a54cebc3f1c7939168193219b"), - newUtreexoHashFromStr("4b93730756cd5fd06d3b1e2933efd8941dad3b053b67aae0b57d0bdbd4f7b18d"), - newUtreexoHashFromStr("31512646def9d6ba8ec3020da4e24b5803a6ec7c90eca55c4e9c6a630e670e5c"), - newUtreexoHashFromStr("3ce3433eeabeafb2d63f95d207900d94a7b36ecf31c73299ec3555e9d75e0f2f"), - newUtreexoHashFromStr("9330e5e4faf23c86a2c384602aacf8ccbd0446ebbabf11b71ec2a49c35b1a3dc"), - newUtreexoHashFromStr("78894e9b1a8374d86301c8324d3be1f76ef2bcc747b0df2a251ec64606468bbb"), - newUtreexoHashFromStr("b733991557d3170454662f0dda1140aa87b8ca4625c840a507807d66e97197ed"), - newUtreexoHashFromStr("166a04d9501b4a49f8ecf1e5b71b90f638237430dae5a2803855d256b25ebef1"), - newUtreexoHashFromStr("db72e7d56022be530476bbfc90ff6d2468e234d46a03d43c427e69db11db92d6"), - newUtreexoHashFromStr("15da6e141cbe4f90e4e7bdd13fdcf01bf110edbb12ea98a168e31cfc07ce2903"), + newUtreexoHashFromStr("bc7f0e8fa896f2c5173b6fb681c18cad5cbfd0b4eed8a0a4f232489b4eea4f52"), + newUtreexoHashFromStr("df275b35b18cbc216030d1334b9e5e68f386ae4f16d08954ab60096a7fc68685"), + newUtreexoHashFromStr("35faa41cca8c31f53bb3a8bca6c132cfe4b60321255f2998d1efccb875d60065"), + newUtreexoHashFromStr("26df84e8394f472e32a38851229a3124354dbd95c1c7060c9fc0a76386882cd0"), + newUtreexoHashFromStr("e33afeae081abb0c920cc5120a7d91af2e15c78e8ff4b787515351da47fa8596"), + newUtreexoHashFromStr("4f7cbacea324f637195bcead4c2990bd08884ef5a90d1c6d35726d33ca91dc1a"), + newUtreexoHashFromStr("133cd000f4456d6292173e32f7db0806e5f9a38f295e1c64a974834908f0c87a"), + newUtreexoHashFromStr("e443328fd47fe455713a7ddf9e35c396276fe56eb6c50fdd38befa16bb94fb1a"), + newUtreexoHashFromStr("a9192b83a118218353cec43e0aa3cbdd935c40163d29059de193136af153f44d"), }, } checkPoints = []Checkpoint{ {150_000, newHashFromStr("0000013d778ba3f914530f11f6b69869c9fab54acff85acd7b8201d111f19b7f")}, + {193_792, newHashFromStr("000000408463e4809d3a493baf8f17f25a919f883824f5b42247402cfeec1b73")}, } } From a7d70a1b0d46025158f92b8fe3ad71c0181b0910 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Fri, 3 May 2024 17:42:41 +0900 Subject: [PATCH 13/13] main: bump version to 0.3.0 New rpcs added so bumping version to 0.3.0 --- version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.go b/version.go index 3dad0c66d..7dc301981 100644 --- a/version.go +++ b/version.go @@ -17,8 +17,8 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr // versioning 2.0.0 spec (http://semver.org/). const ( appMajor uint = 0 - appMinor uint = 2 - appPatch uint = 3 + appMinor uint = 3 + appPatch uint = 0 // appPreRelease MUST only contain characters from semanticAlphabet // per the semantic versioning spec.