From 3228ceba6692685d7fe1ec6688fa04980f81504c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:34:11 +0000 Subject: [PATCH 1/2] Bump the all-dependencies group with 2 updates Bumps the all-dependencies group with 2 updates: [go.sia.tech/core](https://github.com/SiaFoundation/core) and [go.sia.tech/coreutils](https://github.com/SiaFoundation/coreutils). Updates `go.sia.tech/core` from 0.2.5 to 0.2.7 - [Commits](https://github.com/SiaFoundation/core/compare/v0.2.5...v0.2.7) Updates `go.sia.tech/coreutils` from 0.0.4 to 0.0.6 - [Commits](https://github.com/SiaFoundation/coreutils/compare/v0.0.4...v0.0.6) --- updated-dependencies: - dependency-name: go.sia.tech/core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: go.sia.tech/coreutils dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 7 ++++--- go.sum | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b1479791..90e4aefa 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,13 @@ module go.sia.tech/explored go 1.21.6 +toolchain go1.22.4 require ( github.com/mattn/go-sqlite3 v1.14.22 go.etcd.io/bbolt v1.3.10 - go.sia.tech/core v0.2.5 - go.sia.tech/coreutils v0.0.4 + go.sia.tech/core v0.2.7 + go.sia.tech/coreutils v0.0.6 go.sia.tech/jape v0.11.1 go.uber.org/zap v1.27.0 lukechampine.com/frand v1.4.2 @@ -18,7 +19,7 @@ require ( github.com/julienschmidt/httprouter v1.3.0 // indirect go.sia.tech/mux v1.2.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/tools v0.7.0 // indirect ) diff --git a/go.sum b/go.sum index e0989537..5415b3c1 100644 --- a/go.sum +++ b/go.sum @@ -12,10 +12,10 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= -go.sia.tech/core v0.2.5 h1:uGyaFQNPbbMOg6YpvSevx+FXoQn9Itfsq6rbB6MMq34= -go.sia.tech/core v0.2.5/go.mod h1:tf07w3f/8XRtK1XoHl8C/MXzzUp/MEUuZE22L5uoCDQ= -go.sia.tech/coreutils v0.0.4 h1:I8FhhVwpWF1kHu+PkHl4jW/UteEJ64mlqTlOWYLd1J4= -go.sia.tech/coreutils v0.0.4/go.mod h1:JOzeygRc1EGx6LQo4v7GrNrE1omJB3wpTUE7YTIlm+M= +go.sia.tech/core v0.2.7 h1:9Q/3BHL6ziAMPeiko863hhTD/Zs2s7OqEUiPKouDny8= +go.sia.tech/core v0.2.7/go.mod h1:BMgT/reXtgv6XbDgUYTCPY7wSMbspDRDs7KMi1vL6Iw= +go.sia.tech/coreutils v0.0.6 h1:xLpv3JyvbOoXcX3gC6a6Y3zQ/MZn/fyFvuPIzv/e/Eg= +go.sia.tech/coreutils v0.0.6/go.mod h1:EiDcQk2qLuP32Qoj/XphY9fbjTXphJhJZMERoC4LF0c= go.sia.tech/jape v0.11.1 h1:M7IP+byXL7xOqzxcHUQuXW+q3sYMkYzmMlMw+q8ZZw0= go.sia.tech/jape v0.11.1/go.mod h1:4QqmBB+t3W7cNplXPj++ZqpoUb2PeiS66RLpXmEGap4= go.sia.tech/mux v1.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU= @@ -26,8 +26,8 @@ go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= From 47bac19b9e77726d5168f76c191eafc19c6a535e Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Mon, 17 Jun 2024 10:28:07 -0400 Subject: [PATCH 2/2] update slice encoding --- go.mod | 3 ++- persist/sqlite/encoding.go | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 90e4aefa..7fdffb00 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module go.sia.tech/explored -go 1.21.6 +go 1.21.8 + toolchain go1.22.4 require ( diff --git a/persist/sqlite/encoding.go b/persist/sqlite/encoding.go index 7b425e6c..3e578880 100644 --- a/persist/sqlite/encoding.go +++ b/persist/sqlite/encoding.go @@ -28,10 +28,7 @@ func encode(obj any) any { case []types.Hash256: var buf bytes.Buffer e := types.NewEncoder(&buf) - e.WritePrefix(len(obj)) - for _, o := range obj { - o.EncodeTo(e) - } + types.EncodeSlice(e, obj) e.Flush() return buf.Bytes() case uint64: @@ -70,10 +67,7 @@ func (d *decodable) Scan(src any) error { return dec.Err() case *[]types.Hash256: dec := types.NewBufDecoder(src) - *v = make([]types.Hash256, dec.ReadPrefix()) - for i := range *v { - (*v)[i].DecodeFrom(dec) - } + types.DecodeSlice(dec, v) return dec.Err() case *uint64: *v = binary.BigEndian.Uint64(src)