Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.16"
go-version: "1.18"

- name: Checkout branch
uses: actions/checkout@v3
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.16"
go-version: "1.18"

- name: Checkout branch
uses: actions/checkout@v3
Expand Down
10 changes: 10 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Config struct {

// Snapshot
HyperSync bool
ForceChecksum bool
SyncType lib.NodeSyncType
MaxSyncBlockHeight uint32
SnapshotBlockHeightPeriod uint64
Expand Down Expand Up @@ -95,6 +96,7 @@ func LoadConfig() *Config {
config.Regtest = viper.GetBool("regtest")
config.PostgresURI = viper.GetString("postgres-uri")
config.HyperSync = viper.GetBool("hypersync")
config.ForceChecksum = viper.GetBool("force-checksum")
config.SyncType = lib.NodeSyncType(viper.GetString("sync-type"))
config.MaxSyncBlockHeight = viper.GetUint32("max-sync-block-height")
config.SnapshotBlockHeightPeriod = viper.GetUint64("snapshot-block-height-period")
Expand Down Expand Up @@ -162,6 +164,14 @@ func (config *Config) Print() {
glog.Infof("HyperSync: ON")
}

if config.ForceChecksum {
glog.Infof("ForceChecksum: ON")
} else {
glog.V(0).Infof(lib.CLog(lib.Red, "ForceChecksum: OFF - This could "+
"allow a peer to trick you into downloading bad hypersync state. Be sure you're "+
"connecting to a trustworthy sync peer."))
}

if config.SnapshotBlockHeightPeriod > 0 {
glog.Infof("SnapshotBlockHeightPeriod: %v", config.SnapshotBlockHeightPeriod)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (node *Node) Start(exitChannels ...*chan struct{}) {
node.Config.TrustedBlockProducerStartHeight,
eventManager,
node.nodeMessageChan,
)
node.Config.ForceChecksum)
if err != nil {
if shouldRestart {
glog.Infof(lib.CLog(lib.Red, fmt.Sprintf("Start: Got en error while starting server and shouldRestart "+
Expand Down
2 changes: 2 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func SetupRunFlags(cmd *cobra.Command) {
"Max sync block height")
// Hyper Sync
cmd.PersistentFlags().Bool("hypersync", true, "Use hyper sync protocol for faster block syncing")
cmd.PersistentFlags().Bool("force-checksum", true, "When true, the node will panic if the "+
"local state checksum differs from the network checksum reported by its peers.")
// Snapshot
cmd.PersistentFlags().Uint64("snapshot-block-height-period", 1000, "Set the snapshot epoch period. Snapshots are taken at block heights divisible by the period.")
// Archival mode
Expand Down
97 changes: 75 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,63 +1,116 @@
module github.com/deso-protocol/core

go 1.14
go 1.18

require (
github.com/DataDog/datadog-go v4.5.0+incompatible
github.com/DataDog/zstd v1.4.8 // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/NVIDIA/sortedmap v0.0.0-20210902154213-c8c741ed94c5
github.com/brianvoe/gofakeit v3.18.0+incompatible // indirect
github.com/brianvoe/gofakeit v3.18.0+incompatible
github.com/btcsuite/btcd v0.21.0-beta
github.com/btcsuite/btcutil v1.0.2
github.com/bwesterb/go-ristretto v1.2.0
github.com/bxcodec/faker v2.0.1+incompatible
github.com/cloudflare/circl v1.1.0
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/decred/dcrd/lru v1.1.1
github.com/deso-protocol/go-deadlock v1.0.0
github.com/deso-protocol/go-merkle-tree v1.0.0
github.com/dgraph-io/badger/v3 v3.2103.0
github.com/dgraph-io/ristretto v0.1.0
github.com/ethereum/go-ethereum v1.9.25
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/color v1.13.0
github.com/gernest/mention v2.0.0+incompatible
github.com/go-pg/pg/v10 v10.10.0
github.com/gobuffalo/packr v1.30.1
github.com/golang/glog v1.0.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/flatbuffers v2.0.0+incompatible // indirect
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/holiman/uint256 v1.1.1
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/oleiade/lane v1.0.1
github.com/onsi/ginkgo v1.15.0 // indirect
github.com/onsi/gomega v1.10.5 // indirect
github.com/pelletier/go-toml v1.7.0 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0
github.com/robinjoseph08/go-pg-migrations/v3 v3.0.0
github.com/sasha-s/go-deadlock v0.3.1
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
github.com/tyler-smith/go-bip39 v1.0.2
github.com/unrolled/secure v1.0.8
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
gopkg.in/DataDog/dd-trace-go.v1 v1.29.0
)

require (
github.com/DataDog/zstd v1.4.8 // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/NVIDIA/cstruct v0.0.0-20210817223100-441a06a021c8 // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/bwesterb/go-ristretto v1.2.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/git-chglog/git-chglog v0.0.0-20200414013904-db796966b373 // indirect
github.com/go-pg/zerochecker v0.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/flatbuffers v2.0.0+incompatible // indirect
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.8 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/goveralls v0.0.6 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/onsi/ginkgo v1.15.0 // indirect
github.com/onsi/gomega v1.10.5 // indirect
github.com/pelletier/go-toml v1.7.0 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/tinylib/msgp v1.1.2 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect
github.com/urfave/cli v1.22.1 // indirect
github.com/vmihailenco/bufpool v0.1.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.1 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
<<<<<<< HEAD
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
golang.org/x/text v0.3.6 // indirect
=======
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/text v0.3.7 // indirect
>>>>>>> fb4e83e6a39e4f8e22d0729d4bcda3912e4f4141
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
golang.org/x/tools v0.1.0 // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.29.0
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/AlecAivazis/survey.v1 v1.8.7 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
mellium.im/sasl v0.2.1 // indirect
)
Loading