mirror of https://github.com/poanetwork/quorum.git
Merge remote-tracking branch 'remotes/origin/master' into geth-upgrade-1.8.18-latest
# Conflicts: # .travis.yml # cmd/geth/consolecmd_test.go # vendor/github.com/rjeczalik/notify/watcher_readdcw.go # vendor/golang.org/x/sys/cpu/cpu.go # vendor/golang.org/x/sys/cpu/cpu_arm.go # vendor/golang.org/x/sys/cpu/cpu_arm64.go # vendor/golang.org/x/sys/cpu/cpu_mips64x.go # vendor/golang.org/x/sys/cpu/cpu_mipsx.go # vendor/golang.org/x/sys/cpu/cpu_ppc64x.go # vendor/golang.org/x/sys/cpu/cpu_s390x.go # vendor/vendor.json
This commit is contained in:
commit
c2b98220eb
159
.travis.yml
159
.travis.yml
|
@ -1,104 +1,32 @@
|
|||
# simplified version of the upstream travis configuration.
|
||||
# automated acceptance test is run[in linux box] for raft, istanbul and clique consensus in parallel as part of every build
|
||||
# unit test is run in linux and macOS boxes as part of every build
|
||||
# simplifed version of the upstream travis configuration
|
||||
|
||||
language: go
|
||||
go_import_path: github.com/ethereum/go-ethereum
|
||||
sudo: false
|
||||
|
||||
go: 1.11.x
|
||||
sudo: true
|
||||
branches:
|
||||
only:
|
||||
- /.*/ # everything including tags
|
||||
env:
|
||||
global:
|
||||
- TESSERA_JAR="$HOME/tessera.jar"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
update: true
|
||||
sources:
|
||||
- sourceline: ppa:ethereum/ethereum
|
||||
- sourceline: ppa:openjdk-r/ppa
|
||||
packages:
|
||||
- openjdk-8-jdk
|
||||
- dpkg # fixes issue with dpkg-deb error due to travis image
|
||||
- openssh-client
|
||||
- dnsutils
|
||||
- maven
|
||||
- solc
|
||||
- jq
|
||||
- curl
|
||||
|
||||
before_install:
|
||||
- if [ $TRAVIS_OS_NAME = linux ]; then git clone https://github.com/amalrajmani/quorum-acceptance-tests.git $TRAVIS_HOME/quorum-acceptance-tests; fi;
|
||||
- if [ $TRAVIS_OS_NAME = linux ]; then sudo chmod 755 $TRAVIS_HOME/quorum-acceptance-tests/src/travis/install-linux.sh; fi;
|
||||
- if [ $TRAVIS_OS_NAME = linux ]; then sudo chmod 755 $TRAVIS_HOME/quorum-acceptance-tests/src/travis/script-linux.sh; fi;
|
||||
|
||||
- BINTRAY_ORGANIZATION=quorumengineering
|
||||
- BINTRAY_USER=quorumbot
|
||||
# Bintray API Key
|
||||
- secure: "QHiPcd3zQoJEsT3VSpxoLVTYwbiYzS8H18EpY7Tk0EqCIfswS2AvRlyRXUxNvCf9ktzpaeXV4b5cPYJ67dwdp5V/O/ARaK5AL6ZjjrTPR1avPnmz/X2VeQEP0aWk1UGMs1nBUj5rzMbIIxlVhpbiITTLAI4Ao0+xRcBi215mDbv271Z7mACEZfXxjaoJA0/3IkbKz9pu1nC7bTjaaExCDAeLp2p8fHi2YQPnBll/7dkn/m1rnsIY9M3KWNCx6xBmQOr1hulrrB6tZoHwFBoDsVTFJFLckPfrWUZsYUgtfWJMQWc6ntv1gFl0f9x6s5fYEphCU2m1JYjEczlQ03B5ro9EyPGKjO7vQxAaFd5nVd2Xf34ZbssEIyXxlSnP/4Gv1GXl9L9aU1Hth9ckYvT5gYP5t/Nw3CDbKD0HelPBvkf8jZwfdlotzFPS2bOZNdl/rJLWgQrX18a/mC3BH9l4TSRz13tbRfo6YcC3Y/uOvG1n4GxzcVaWojAxn86SkknOczPTf2pk9F3JOcGVSYA2R4kGQAe+ErJH2X5g2sh1D5cCYDjQyl5rzWg6P3eK//HYW+mg2+TQ8k2iQVVSwFwrR0Yn4P+5cRDCW9mjtktgq1rTtslj41gSH49Avqr9oXGM2rqdcJPdN8dnmLMrAtmeSUNMMoexiRMmlF2OQKLrW3k="
|
||||
matrix:
|
||||
include:
|
||||
- name: linux-raft
|
||||
- if: tag IS blank
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: true
|
||||
go: 1.10.x
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
|
||||
env:
|
||||
- TF_VAR_consensus_mechanism=raft
|
||||
|
||||
install: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/install-linux.sh
|
||||
|
||||
script: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/script-linux.sh
|
||||
|
||||
|
||||
- name: linux-istanbul
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: true
|
||||
go: 1.10.x
|
||||
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
|
||||
env:
|
||||
- TF_VAR_consensus_mechanism=istanbul
|
||||
|
||||
install: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/install-linux.sh
|
||||
|
||||
script: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/script-linux.sh
|
||||
|
||||
- name: linux-clique
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: true
|
||||
go: 1.10.x
|
||||
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
|
||||
env:
|
||||
- TF_VAR_consensus_mechanism=clique
|
||||
|
||||
install: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/install-linux.sh
|
||||
|
||||
script: $TRAVIS_HOME/quorum-acceptance-tests/src/travis/script-linux.sh
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
go: 1.10.x
|
||||
dist: xenial
|
||||
script:
|
||||
- sudo modprobe fuse
|
||||
- sudo chmod 666 /dev/fuse
|
||||
- sudo chown root:$USER /etc/fuse.conf
|
||||
- go run build/ci.go install
|
||||
- go run build/ci.go test -coverage $TEST_PACKAGES
|
||||
|
||||
|
||||
- os: osx
|
||||
- if: tag IS blank
|
||||
os: osx
|
||||
osx_image: xcode9.2 # so we don't have to deal with Kernel Extension Consent UI which is never possible in CI
|
||||
go: 1.10.x
|
||||
sudo: required
|
||||
script:
|
||||
- brew update
|
||||
- brew install caskroom/cask/brew-cask
|
||||
|
@ -106,3 +34,62 @@ matrix:
|
|||
- go run build/ci.go install
|
||||
- go run build/ci.go test -coverage $TEST_PACKAGES
|
||||
|
||||
- if: tag IS present
|
||||
os: linux
|
||||
dist: xenial
|
||||
env: OUTPUT_FILE=geth_${TRAVIS_TAG}_linux_amd64.tar.gz
|
||||
script:
|
||||
- build/env.sh go run build/ci.go install ./cmd/geth
|
||||
- sudo mkdir -p /dist
|
||||
- cd build/bin
|
||||
- sudo tar cfvz /dist/${OUTPUT_FILE} geth
|
||||
- if: tag IS present
|
||||
os: osx
|
||||
osx_image: xcode9.2
|
||||
env: OUTPUT_FILE=geth_${TRAVIS_TAG}_darwin_amd64.tar.gz
|
||||
script:
|
||||
- build/env.sh go run build/ci.go install ./cmd/geth
|
||||
- sudo mkdir -p /dist
|
||||
- cd build/bin
|
||||
- sudo tar cfvz /dist/${OUTPUT_FILE} geth
|
||||
|
||||
before_deploy:
|
||||
- |
|
||||
echo "Prepare Bintray descriptor"
|
||||
export GETH_VERSION=$(cat ${TRAVIS_BUILD_DIR}/VERSION)
|
||||
export RELEASED_DATE=$(date +'%Y-%m-%d')
|
||||
sed -e "s/_TRAVIS_TAG_/${TRAVIS_TAG}/g" \
|
||||
-e "s/_TRAVIS_BUILD_NUMBER_/${TRAVIS_BUILD_NUMBER}/g" \
|
||||
-e "s/_GETH_VERSION_/${GETH_VERSION}/g" \
|
||||
-e "s/_RELEASED_DATE_/${RELEASED_DATE}/g" \
|
||||
-e "s/_TRAVIS_COMMIT_/${TRAVIS_COMMIT}/g" \
|
||||
-e "s/_TRAVIS_JOB_WEB_URL_/${TRAVIS_JOB_WEB_URL//\//\\/}/g" \
|
||||
-e "s/_ORGANIZATION_/${BINTRAY_ORGANIZATION}/g" \
|
||||
${TRAVIS_BUILD_DIR}/.bintray.json > /tmp/bintray.json
|
||||
after_deploy:
|
||||
- |
|
||||
published=""
|
||||
while [ "$published" == "" ]; do
|
||||
echo "Sleep 5s to wait until ${OUTPUT_FILE} is published"
|
||||
sleep 5
|
||||
result=$(curl -u ${BINTRAY_USER}:${BINTRAY_API_KEY} "https://api.bintray.com/packages/${BINTRAY_ORGANIZATION}/quorum/geth/versions/${TRAVIS_TAG}/files")
|
||||
echo "$result"
|
||||
if [[ "$result" == *"${OUTPUT_FILE}"* ]]; then
|
||||
published="done"
|
||||
fi
|
||||
done
|
||||
- |
|
||||
echo "Add ${OUTPUT_FILE} to Download List"
|
||||
curl -u ${BINTRAY_USER}:${BINTRAY_API_KEY} \
|
||||
-H "Content-type: application/json" \
|
||||
-X PUT \
|
||||
--data "{\"list_in_downloads\": true}" \
|
||||
https://api.bintray.com/file_metadata/${BINTRAY_ORGANIZATION}/quorum/${TRAVIS_TAG}/${OUTPUT_FILE}
|
||||
deploy:
|
||||
provider: bintray
|
||||
file: /tmp/bintray.json
|
||||
user: ${BINTRAY_USER}
|
||||
key: ${BINTRAY_API_KEY}
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
|
@ -85,7 +85,8 @@ func TestConsoleWelcome(t *testing.T) {
|
|||
geth.SetTemplateFunc("goos", func() string { return runtime.GOOS })
|
||||
geth.SetTemplateFunc("goarch", func() string { return runtime.GOARCH })
|
||||
geth.SetTemplateFunc("gover", runtime.Version)
|
||||
geth.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta })
|
||||
geth.SetTemplateFunc("gethver", func() string { return params.Version })
|
||||
geth.SetTemplateFunc("quorumver", func() string { return params.QuorumVersion })
|
||||
geth.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) })
|
||||
geth.SetTemplateFunc("apis", func() string { return ipcAPIs })
|
||||
|
||||
|
@ -93,7 +94,7 @@ func TestConsoleWelcome(t *testing.T) {
|
|||
geth.Expect(`
|
||||
Welcome to the Geth JavaScript console!
|
||||
|
||||
instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
|
||||
instance: Geth/v{{gethver}}(quorum-v{{quorumver}})/{{goos}}-{{goarch}}/{{gover}}
|
||||
coinbase: {{.Etherbase}}
|
||||
at block: 0 ({{niltime}})
|
||||
datadir: {{.Datadir}}
|
||||
|
@ -178,7 +179,8 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) {
|
|||
attach.SetTemplateFunc("goos", func() string { return runtime.GOOS })
|
||||
attach.SetTemplateFunc("goarch", func() string { return runtime.GOARCH })
|
||||
attach.SetTemplateFunc("gover", runtime.Version)
|
||||
attach.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta })
|
||||
attach.SetTemplateFunc("gethver", func() string { return params.Version })
|
||||
attach.SetTemplateFunc("quorumver", func() string { return params.QuorumVersion })
|
||||
attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase })
|
||||
attach.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) })
|
||||
attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") })
|
||||
|
@ -189,7 +191,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) {
|
|||
attach.Expect(`
|
||||
Welcome to the Geth JavaScript console!
|
||||
|
||||
instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}}
|
||||
instance: Geth/v{{gethver}}(quorum-v{{quorumver}})/{{goos}}-{{goarch}}/{{gover}}
|
||||
coinbase: {{etherbase}}
|
||||
at block: 0 ({{niltime}}){{if ipc}}
|
||||
datadir: {{datadir}}{{end}}
|
||||
|
|
|
@ -4,6 +4,12 @@ package bn256
|
|||
|
||||
// This file contains forward declarations for the architecture-specific
|
||||
// assembly implementations of these functions, provided that they exist.
|
||||
import (
|
||||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
//nolint:varcheck
|
||||
var hasBMI2 = cpu.X86.HasBMI2
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/cpu"
|
||||
|
|
|
@ -400,11 +400,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
|
|||
return errUnknownPeer
|
||||
}
|
||||
if d.mode == BoundedFullSync {
|
||||
err := d.syncWithPeerUntil(p, hash, td)
|
||||
if err == nil {
|
||||
d.processFullSyncContent()
|
||||
}
|
||||
return err
|
||||
return d.syncWithPeerUntil(p, hash, td)
|
||||
}
|
||||
return d.syncWithPeer(p, hash, td)
|
||||
}
|
||||
|
@ -1739,6 +1735,7 @@ func (d *Downloader) syncWithPeerUntil(p *peerConnection, hash common.Hash, td *
|
|||
func() error { return d.fetchBodies(localHeight + 1) },
|
||||
func() error { return d.fetchReceipts(localHeight + 1) }, // Receipts are only retrieved during fast sync
|
||||
func() error { return d.processHeaders(localHeight+1, pivot, td) },
|
||||
d.processFullSyncContent, //This must be added to clear the buffer of downloaded content as it's being filled
|
||||
}
|
||||
return d.spawnSync(fetchers)
|
||||
}
|
||||
|
|
|
@ -69,5 +69,8 @@ func VersionWithCommit(gitCommit string) string {
|
|||
if len(gitCommit) >= 8 {
|
||||
vsn += "-" + gitCommit[:8]
|
||||
}
|
||||
|
||||
vsn += "(quorum-v" + QuorumVersion + ")"
|
||||
|
||||
return vsn
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/rjeczalik/notify
|
||||
|
||||
require golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7
|
|
@ -0,0 +1,61 @@
|
|||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//+build !amd64,!amd64p32,!386
|
||||
|
||||
package cpu
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"io/ioutil"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
const (
|
||||
_AT_HWCAP = 16
|
||||
_AT_HWCAP2 = 26
|
||||
|
||||
procAuxv = "/proc/self/auxv"
|
||||
|
||||
uintSize uint = 32 << (^uint(0) >> 63)
|
||||
)
|
||||
|
||||
// For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2
|
||||
// These are initialized in cpu_$GOARCH.go
|
||||
// and should not be changed after they are initialized.
|
||||
var HWCap uint
|
||||
var HWCap2 uint
|
||||
|
||||
func init() {
|
||||
buf, err := ioutil.ReadFile(procAuxv)
|
||||
if err != nil {
|
||||
panic("read proc auxv failed: " + err.Error())
|
||||
}
|
||||
|
||||
pb := int(uintSize / 8)
|
||||
|
||||
for i := 0; i < len(buf)-pb*2; i += pb * 2 {
|
||||
var tag, val uint
|
||||
switch uintSize {
|
||||
case 32:
|
||||
tag = uint(binary.LittleEndian.Uint32(buf[i:]))
|
||||
val = uint(binary.LittleEndian.Uint32(buf[i+pb:]))
|
||||
case 64:
|
||||
if runtime.GOARCH == "ppc64" {
|
||||
tag = uint(binary.BigEndian.Uint64(buf[i:]))
|
||||
val = uint(binary.BigEndian.Uint64(buf[i+pb:]))
|
||||
} else {
|
||||
tag = uint(binary.LittleEndian.Uint64(buf[i:]))
|
||||
val = uint(binary.LittleEndian.Uint64(buf[i+pb:]))
|
||||
}
|
||||
}
|
||||
switch tag {
|
||||
case _AT_HWCAP:
|
||||
HWCap = val
|
||||
case _AT_HWCAP2:
|
||||
HWCap2 = val
|
||||
}
|
||||
}
|
||||
doinit()
|
||||
}
|
Loading…
Reference in New Issue