Skip to content

Commit

Permalink
Merge branch 'main' into 3409-fix-snapshot-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Sep 19, 2023
2 parents cc85bcc + 1f432a2 commit 0072058
Show file tree
Hide file tree
Showing 72 changed files with 645 additions and 1,546 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
*.play gitlab-language=markdown
test/testdata/executor-v1-consistency.json filter=lfs merge=lfs -text
test/testdata/api-v2-consistency.json filter=lfs merge=lfs -text
scripts/data/dn-12614506.fix filter=lfs diff=lfs merge=lfs -text
scripts/data/pre-v2-txn-apollo-fix.dat filter=lfs diff=lfs merge=lfs -text
scripts/data/pre-v2-txn-chandrayaan-fix.dat filter=lfs diff=lfs merge=lfs -text
scripts/data/pre-v2-txn-dn-fix.dat filter=lfs diff=lfs merge=lfs -text
scripts/data/pre-v2-txn-yutu-fix.dat filter=lfs diff=lfs merge=lfs -text
scripts/data/revert-12614506-patch.json filter=lfs diff=lfs merge=lfs -text
scripts/data/dn-12614506.diff filter=lfs diff=lfs merge=lfs -text
scripts/bin/v1.2.9/dbrepair-linux-amd64 filter=lfs diff=lfs merge=lfs -text
9 changes: 9 additions & 0 deletions .gitlab/sast-ruleset.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[semgrep]
# This rule complains about importing net/http/pprof. That registers a handler
# with the default HTTP server, but we don't use that server for anything
# except pprof, and that is only enabled if the --pprof flag is passed, so
# this is not relevant.
[[semgrep.ruleset]]
disable = true
[semgrep.ruleset.identifier]
type = "semgrep_id"
value = "gosec.G108-1"

# This rule complains if Mkdir/MkdirAll is called with mode > 0600 and !=
# 0750, which is stupid so I'm disabling it.
Expand Down
1 change: 0 additions & 1 deletion exp/light/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (c *Client) OpenDB(writable bool) *DB {
batch.SetObserver(testing.NullObserver{}) // Ignore the BPT
index := new(indexDB)
index.key = record.NewKey("Light", "Index")
index.label = "light index"
index.store = keyvalue.RecordStore{Store: kvb}
return &DB{batch, index}
}
Expand Down
21 changes: 5 additions & 16 deletions exp/light/model_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ package light
//lint:file-ignore S1008,U1000 generated code

import (
"encoding/hex"

"gitlab.com/accumulatenetwork/accumulate/internal/logging"
record "gitlab.com/accumulatenetwork/accumulate/pkg/database"
"gitlab.com/accumulatenetwork/accumulate/pkg/database/values"
Expand All @@ -32,7 +30,6 @@ type indexDB struct {
logger logging.OptionalLogger
store record.Store
key *record.Key
label string

account map[indexDBAccountMapKey]*indexDBAccount
partition map[indexDBPartitionMapKey]*indexDBPartition
Expand Down Expand Up @@ -87,7 +84,6 @@ func (c *indexDB) newAccount(k indexDBAccountKey) *indexDBAccount {
v.store = c.store
v.key = c.key.Append("Account", k.Url)
v.parent = c
v.label = c.label + " " + "account" + " " + k.Url.RawString()
return v
}

Expand All @@ -101,7 +97,6 @@ func (c *indexDB) newPartition(k indexDBPartitionKey) *indexDBPartition {
v.store = c.store
v.key = c.key.Append("Partition", k.Url)
v.parent = c
v.label = c.label + " " + "partition" + " " + k.Url.RawString()
return v
}

Expand All @@ -115,7 +110,6 @@ func (c *indexDB) newTransaction(k indexDBTransactionKey) *indexDBTransaction {
v.store = c.store
v.key = c.key.Append("Transaction", k.Hash)
v.parent = c
v.label = c.label + " " + "transaction" + " " + hex.EncodeToString(k.Hash[:])
return v
}

Expand Down Expand Up @@ -229,7 +223,6 @@ type indexDBAccount struct {
logger logging.OptionalLogger
store record.Store
key *record.Key
label string
parent *indexDB

didIndexTransactionExecution values.Set[[32]byte]
Expand All @@ -256,15 +249,15 @@ func (c *indexDBAccount) DidIndexTransactionExecution() values.Set[[32]byte] {
}

func (c *indexDBAccount) newDidIndexTransactionExecution() values.Set[[32]byte] {
return values.NewSet(c.logger.L, c.store, c.key.Append("DidIndexTransactionExecution"), c.label+" "+"did index transaction execution", values.Wrapped(values.HashWrapper), values.CompareHash)
return values.NewSet(c.logger.L, c.store, c.key.Append("DidIndexTransactionExecution"), values.Wrapped(values.HashWrapper), values.CompareHash)
}

func (c *indexDBAccount) DidLoadTransaction() values.Set[[32]byte] {
return values.GetOrCreate(c, &c.didLoadTransaction, (*indexDBAccount).newDidLoadTransaction)
}

func (c *indexDBAccount) newDidLoadTransaction() values.Set[[32]byte] {
return values.NewSet(c.logger.L, c.store, c.key.Append("DidLoadTransaction"), c.label+" "+"did load transaction", values.Wrapped(values.HashWrapper), values.CompareHash)
return values.NewSet(c.logger.L, c.store, c.key.Append("DidLoadTransaction"), values.Wrapped(values.HashWrapper), values.CompareHash)
}

func (c *indexDBAccount) Chain(name string) IndexDBAccountChain {
Expand All @@ -277,7 +270,6 @@ func (c *indexDBAccount) newChain(k indexDBAccountChainKey) *indexDBAccountChain
v.store = c.store
v.key = c.key.Append("Chain", k.Name)
v.parent = c
v.label = c.label + " " + "chain" + " " + k.Name
return v
}

Expand Down Expand Up @@ -365,7 +357,6 @@ type indexDBAccountChain struct {
logger logging.OptionalLogger
store record.Store
key *record.Key
label string
parent *indexDBAccount

index values.List[*protocol.IndexEntry]
Expand All @@ -378,7 +369,7 @@ func (c *indexDBAccountChain) Index() values.List[*protocol.IndexEntry] {
}

func (c *indexDBAccountChain) newIndex() values.List[*protocol.IndexEntry] {
return values.NewList(c.logger.L, c.store, c.key.Append("Index"), c.label+" "+"index", values.Struct[protocol.IndexEntry]())
return values.NewList(c.logger.L, c.store, c.key.Append("Index"), values.Struct[protocol.IndexEntry]())
}

func (c *indexDBAccountChain) Resolve(key *record.Key) (record.Record, *record.Key, error) {
Expand Down Expand Up @@ -441,7 +432,6 @@ type indexDBPartition struct {
logger logging.OptionalLogger
store record.Store
key *record.Key
label string
parent *indexDB

anchors values.List[*AnchorMetadata]
Expand All @@ -454,7 +444,7 @@ func (c *indexDBPartition) Anchors() values.List[*AnchorMetadata] {
}

func (c *indexDBPartition) newAnchors() values.List[*AnchorMetadata] {
return values.NewList(c.logger.L, c.store, c.key.Append("Anchors"), c.label+" "+"anchors", values.Struct[AnchorMetadata]())
return values.NewList(c.logger.L, c.store, c.key.Append("Anchors"), values.Struct[AnchorMetadata]())
}

func (c *indexDBPartition) Resolve(key *record.Key) (record.Record, *record.Key, error) {
Expand Down Expand Up @@ -515,7 +505,6 @@ type indexDBTransaction struct {
logger logging.OptionalLogger
store record.Store
key *record.Key
label string
parent *indexDB

executed values.Value[*EventMetadata]
Expand All @@ -528,7 +517,7 @@ func (c *indexDBTransaction) Executed() values.Value[*EventMetadata] {
}

func (c *indexDBTransaction) newExecuted() values.Value[*EventMetadata] {
return values.NewValue(c.logger.L, c.store, c.key.Append("Executed"), c.label+" "+"executed", false, values.Struct[EventMetadata]())
return values.NewValue(c.logger.L, c.store, c.key.Append("Executed"), false, values.Struct[EventMetadata]())
}

func (c *indexDBTransaction) Resolve(key *record.Key) (record.Record, *record.Key, error) {
Expand Down
111 changes: 54 additions & 57 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ require (
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
gitlab.com/ethan.reesor/vscode-notebooks/go-playbooks v0.0.0-20220417214602-1121b9fae118
gitlab.com/ethan.reesor/vscode-notebooks/yaegi v0.0.0-20220417214422-5c573557938e
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53
golang.org/x/sync v0.1.0
golang.org/x/sys v0.7.0
golang.org/x/term v0.7.0
golang.org/x/text v0.9.0
golang.org/x/tools v0.7.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/sync v0.3.0
golang.org/x/sys v0.11.0
golang.org/x/term v0.11.0
golang.org/x/text v0.12.0
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846
gopkg.in/yaml.v3 v3.0.1
gotest.tools/gotestsum v1.8.1
)
Expand All @@ -45,17 +45,17 @@ require (
github.com/FactomProject/factomd v1.13.0
github.com/chzyer/readline v1.5.1
github.com/cometbft/cometbft v0.38.0-rc3
github.com/ethereum/go-ethereum v1.10.25
github.com/ethereum/go-ethereum v1.12.2
github.com/fatih/astrewrite v0.0.0-20191207154002-9094e544fcef
github.com/gobeam/stringy v0.0.6
github.com/libp2p/go-libp2p v0.25.1
github.com/libp2p/go-libp2p v0.31.0
github.com/libp2p/go-libp2p-kad-dht v0.21.1
github.com/libp2p/go-libp2p-pubsub v0.9.1
github.com/mattn/go-shellwords v1.0.12
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multiaddr v0.8.0
github.com/multiformats/go-multibase v0.1.1
github.com/multiformats/go-multihash v0.2.1
github.com/multiformats/go-multiaddr v0.11.0
github.com/multiformats/go-multibase v0.2.0
github.com/multiformats/go-multihash v0.2.3
github.com/robfig/cron/v3 v3.0.0
github.com/sergi/go-diff v1.2.0
github.com/ulikunitz/xz v0.5.11
Expand All @@ -79,37 +79,38 @@ require (
github.com/FactomProject/netki-go-partner-client v0.0.0-20160324224126-426acb535e66 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect
github.com/alingse/asasalint v0.0.11 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuitereleases/btcutil v0.0.0-20150612230727-f2b1058a8255 // indirect
github.com/chigopher/pathlib v0.12.0 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/containerd/cgroups v1.0.4 // indirect
github.com/cosmos/gogoproto v1.4.6 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/cosmos/gogoproto v1.4.11 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/firefart/nonamedreturns v1.0.4 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/huin/goupnp v1.2.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipns v0.2.0 // indirect
Expand All @@ -123,50 +124,48 @@ require (
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/junk1tm/musttag v0.5.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.4 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.1 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect
github.com/libp2p/go-libp2p-kbucket v0.5.0 // indirect
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/libp2p/go-reuseport v0.4.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.1 // indirect
github.com/lufeee/execinquery v1.2.1 // indirect
github.com/maratori/testableexamples v1.0.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/dns v1.1.55 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multicodec v0.8.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multistream v0.4.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/nunnatsa/ginkgolinter v0.9.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/onsi/ginkgo/v2 v2.8.0 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/opencontainers/runtime-spec v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
github.com/quic-go/qtls-go1-20 v0.1.0 // indirect
github.com/quic-go/quic-go v0.32.0 // indirect
github.com/quic-go/webtransport-go v0.5.1 // indirect
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
github.com/quic-go/quic-go v0.38.1 // indirect
github.com/quic-go/webtransport-go v0.5.3 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
Expand All @@ -179,12 +178,12 @@ require (
github.com/timonwong/loggercheck v0.9.4 // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/dig v1.15.0 // indirect
go.uber.org/fx v1.18.2 // indirect
go.uber.org/dig v1.17.0 // indirect
go.uber.org/fx v1.20.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
gotest.tools/v3 v3.2.0 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
nhooyr.io/websocket v1.8.7 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)

require (
Expand Down Expand Up @@ -241,7 +240,7 @@ require (
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect
Expand Down Expand Up @@ -288,7 +287,7 @@ require (
github.com/maratori/testpackage v1.1.1 // indirect
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
Expand All @@ -306,8 +305,8 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v1.4.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/quasilyte/go-ruleguard v0.3.19 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
Expand Down Expand Up @@ -345,15 +344,13 @@ require (
github.com/yeya24/promlinter v0.2.0 // indirect
gitlab.com/bosi/decorder v0.2.3 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.8.0
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/crypto v0.12.0
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
Loading

0 comments on commit 0072058

Please sign in to comment.