Skip to content
Merged
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
22 changes: 11 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ commands:
- restore_libsodium
- restore_cache:
keys:
- 'go-mod-1-14-7-v2-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}'
- 'go-mod-1.17.9-v3-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}'
- restore_cache:
keys:
- 'go-cache-v2-{{ .Environment.CIRCLE_STAGE }}-'
- 'go-cache-v3-{{ arch }}-{{ .Branch }}-{{ .Revision }}'
- 'go-cache-v3-{{ arch }}-{{ .Branch }}-'
- 'go-cache-v3-{{ arch }}-'
- run:
name: scripts/travis/build.sh --make_debug
command: |
Expand All @@ -233,11 +235,11 @@ commands:
scripts/travis/build.sh --make_debug
- cache_libsodium
- save_cache:
key: 'go-mod-1-14-7-v2-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}'
key: 'go-mod-1.17.9-v3-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}'
paths:
- << parameters.build_dir >>/go/pkg/mod
- save_cache:
key: 'go-cache-v2-{{ .Environment.CIRCLE_STAGE }}-{{ .Environment.CIRCLE_BUILD_NUM }}'
key: 'go-cache-v3-{{ arch }}-{{ .Branch }}-{{ .Revision }}'
paths:
- tmp/go-cache
- persist_to_workspace:
Expand All @@ -257,7 +259,7 @@ commands:
mkdir -p tmp
find crypto/libsodium-fork -type f -exec openssl md5 "{}" + > tmp/libsodium.md5
- save_cache:
key: 'libsodium-fork-v2-{{ .Environment.CIRCLE_STAGE }}-{{ checksum "tmp/libsodium.md5" }}'
key: 'libsodium-fork-v2-{{ arch }}-{{ checksum "tmp/libsodium.md5" }}'
paths:
- crypto/libs

Expand All @@ -271,7 +273,7 @@ commands:
find crypto/libsodium-fork -type f -exec openssl md5 "{}" + > tmp/libsodium.md5
- restore_cache:
keys:
- 'libsodium-fork-v2-{{ .Environment.CIRCLE_STAGE }}-{{ checksum "tmp/libsodium.md5" }}'
- 'libsodium-fork-v2-{{ arch }}-{{ checksum "tmp/libsodium.md5" }}'

generic_test:
description: Run build tests from build workspace, for re-use by diferent architectures
Expand Down Expand Up @@ -301,7 +303,9 @@ commands:
touch << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json
- restore_cache:
keys:
- 'go-cache-v2-{{ .Environment.CIRCLE_STAGE }}-'
- 'go-cache-v3-{{ arch }}-{{ .Branch }}-{{ .Revision }}'
- 'go-cache-v3-{{ arch }}-{{ .Branch }}-'
- 'go-cache-v3-{{ arch }}-'
- run:
name: Run build tests
no_output_timeout: << parameters.no_output_timeout >>
Expand Down Expand Up @@ -333,10 +337,6 @@ commands:
root: << parameters.result_path >>
paths:
- << parameters.result_subdir >>
- save_cache:
key: 'go-cache-v2-{{ .Environment.CIRCLE_STAGE }}-{{ .Environment.CIRCLE_BUILD_NUM }}'
paths:
- tmp/go-cache

upload_coverage:
description: Collect coverage reports and upload them
Expand Down
21 changes: 16 additions & 5 deletions cmd/buildtools/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ var dumpGenesisHashCmd = &cobra.Command{
os.Exit(1)
}

hash := crypto.HashObj(genesis)
fmt.Print(hash.String())
fmt.Print(genesis.Hash().String())
},
}

Expand Down Expand Up @@ -237,7 +236,7 @@ func ensureReleaseGenesis(src bookkeeping.Genesis, releaseFile string) (err erro
return fmt.Errorf("error saving file: %v", err)
}

hash := crypto.HashObj(releaseGenesis)
hash := releaseGenesis.Hash()
err = ioutil.WriteFile(releaseFileHash, []byte(hash.String()), 0666)
if err != nil {
return fmt.Errorf("error saving hash file '%s': %v", releaseFileHash, err)
Expand All @@ -261,8 +260,20 @@ func verifyReleaseGenesis(src bookkeeping.Genesis, releaseFile string) (updateGe
func verifyGenesisHashes(src, release bookkeeping.Genesis, hashFile string) (err error) {
src.Timestamp = release.Timestamp

srcHash := crypto.HashObj(src)
releaseHash := crypto.HashObj(release)
srcHash := src.Hash()
releaseHash := release.Hash()

srcHashCrypo := crypto.HashObj(src)
releaseHashCrypto := crypto.HashObj(release)

if srcHash != srcHashCrypo {
return fmt.Errorf("source hashes differ - genesis.json our hashing function isn't consistent")
}

if releaseHash != releaseHashCrypto {
return fmt.Errorf("release hashes differ - genesis.json our hashing function isn't consistent")
}

if srcHash != releaseHash {
return fmt.Errorf("source and release hashes differ - genesis.json may have diverge from released version")
}
Expand Down
Loading