diff --git a/CHANGELOG.md b/CHANGELOG.md index ee85feb6ef..e1b1661320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # Changelog +## v1.1.22 +FEATURE +* [\#1361](https://github.com/bnb-chain/bsc/pull/1361) cmd/faucet: merge ipfaucet2 branch to develop + +IMPROVEMENT +* [\#1412](https://github.com/bnb-chain/bsc/pull/1412) fix: init-network with config.toml without setting TimeFormat +* [\#1401](https://github.com/bnb-chain/bsc/pull/1401) log: support custom time format configuration +* [\#1382](https://github.com/bnb-chain/bsc/pull/1382) consnesus/parlia: abort sealing when block in the same height has updated +* [\#1383](https://github.com/bnb-chain/bsc/pull/1383) miner: no need to broadcast sidechain header mined by this validator + +BUGFIX +* [\#1379](https://github.com/bnb-chain/bsc/pull/1379) UT: fix some flaky tests +* [\#1403](https://github.com/bnb-chain/bsc/pull/1403) Makefile: fix devtools install error +* [\#1381](https://github.com/bnb-chain/bsc/pull/1381) fix: snapshot generation issue after chain reinit from a freezer + ## v1.1.21 FEATURE * [\#1389](https://github.com/bnb-chain/bsc/pull/1389) upgrade: update the fork height of planck upgrade on mainnet diff --git a/Makefile b/Makefile index b35a4a9e4d..c18cdddea9 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ clean: devtools: env GOBIN= go install golang.org/x/tools/cmd/stringer@latest - env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata@latest + env GOBIN= go install github.com/kevinburke/go-bindata@latest env GOBIN= go install github.com/fjl/gencodec@latest env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest env GOBIN= go install ./cmd/abigen diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 639be86159..989b2234b8 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -90,9 +90,6 @@ var ( fixGasPrice = flag.Int64("faucet.fixedprice", 0, "Will use fixed gas price if specified") twitterTokenFlag = flag.String("twitter.token", "", "Bearer token to authenticate with the v2 Twitter API") twitterTokenV1Flag = flag.String("twitter.token.v1", "", "Bearer token to authenticate with the v1.1 Twitter API") - - goerliFlag = flag.Bool("goerli", false, "Initializes the faucet with Görli network config") - rinkebyFlag = flag.Bool("rinkeby", false, "Initializes the faucet with Rinkeby network config") ) var ( @@ -115,7 +112,7 @@ func main() { for i := 0; i < *tiersFlag; i++ { // Calculate the amount for the next tier and format it amount := float64(*payoutFlag) * math.Pow(2.5, float64(i)) - amounts[i] = fmt.Sprintf("%s BNBs", strconv.FormatFloat(amount, 'f', -1, 64)) + amounts[i] = fmt.Sprintf("0.%s BNBs", strconv.FormatFloat(amount, 'f', -1, 64)) if amount == 1 { amounts[i] = strings.TrimSuffix(amounts[i], "s") } @@ -170,9 +167,13 @@ func main() { log.Crit("Failed to render the faucet template", "err", err) } // Load and parse the genesis block requested by the user - genesis, err := getGenesis(genesisFlag, *goerliFlag, *rinkebyFlag) + blob, err := ioutil.ReadFile(*genesisFlag) if err != nil { - log.Crit("Failed to parse genesis config", "err", err) + log.Crit("Failed to read genesis block contents", "genesis", *genesisFlag, "err", err) + } + genesis := new(core.Genesis) + if err = json.Unmarshal(blob, genesis); err != nil { + log.Crit("Failed to parse genesis block json", "err", err) } // Convert the bootnodes to internal enode representations var enodes []*enode.Node @@ -184,13 +185,13 @@ func main() { } } // Load up the account key and decrypt its password - blob, err := ioutil.ReadFile(*accPassFlag) + blob, err = ioutil.ReadFile(*accPassFlag) if err != nil { log.Crit("Failed to read account password contents", "file", *accPassFlag, "err", err) } pass := strings.TrimSuffix(string(blob), "\n") - ks := keystore.NewKeyStore(filepath.Join(os.Getenv("HOME"), ".faucet", "keys"), keystore.StandardScryptN, keystore.StandardScryptP) + ks := keystore.NewKeyStore(filepath.Join(os.Getenv("HOME"), ".faucet", "keys_2"), keystore.StandardScryptN, keystore.StandardScryptP) if blob, err = ioutil.ReadFile(*accJSONFlag); err != nil { log.Crit("Failed to read account key contents", "file", *accJSONFlag, "err", err) } @@ -364,6 +365,11 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { // Start tracking the connection and drop at the end defer conn.Close() + ipsStr := r.Header.Get("X-Forwarded-For") + ips := strings.Split(ipsStr, ",") + if len(ips) < 2 { + return + } f.lock.Lock() wsconn := &wsConn{conn: conn} @@ -460,7 +466,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { form.Add("secret", *captchaSecret) form.Add("response", msg.Captcha) - res, err := http.PostForm("https://www.google.com/recaptcha/api/siteverify", form) + res, err := http.PostForm("https://hcaptcha.com/siteverify", form) if err != nil { if err = sendError(wsconn, err); err != nil { log.Warn("Failed to send captcha post error to client", "err", err) @@ -499,6 +505,19 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { address common.Address ) switch { + case strings.HasPrefix(msg.URL, "https://gist.github.com/"): + if err = sendError(wsconn, errors.New("GitHub authentication discontinued at the official request of GitHub")); err != nil { + log.Warn("Failed to send GitHub deprecation to client", "err", err) + return + } + continue + case strings.HasPrefix(msg.URL, "https://plus.google.com/"): + //lint:ignore ST1005 Google is a company name and should be capitalized. + if err = sendError(wsconn, errors.New("Google+ authentication discontinued as the service was sunset")); err != nil { + log.Warn("Failed to send Google+ deprecation to client", "err", err) + return + } + continue case strings.HasPrefix(msg.URL, "https://twitter.com/"): id, username, avatar, address, err = authTwitter(msg.URL, *twitterTokenV1Flag, *twitterTokenFlag) case strings.HasPrefix(msg.URL, "https://www.facebook.com/"): @@ -526,11 +545,20 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { fund bool timeout time.Time ) + + if ipTimeout := f.timeouts[ips[len(ips)-2]]; time.Now().Before(ipTimeout) { + if err = sendError(wsconn, fmt.Errorf("%s left until next allowance", common.PrettyDuration(time.Until(ipTimeout)))); err != nil { // nolint: gosimple + log.Warn("Failed to send funding error to client", "err", err) + } + f.lock.Unlock() + continue + } + if timeout = f.timeouts[id]; time.Now().After(timeout) { var tx *types.Transaction if msg.Symbol == "BNB" { // User wasn't funded recently, create the funding transaction - amount := new(big.Int).Mul(big.NewInt(int64(*payoutFlag)), ether) + amount := new(big.Int).Div(new(big.Int).Mul(big.NewInt(int64(*payoutFlag)), ether), big.NewInt(10)) amount = new(big.Int).Mul(amount, new(big.Int).Exp(big.NewInt(5), big.NewInt(int64(msg.Tier)), nil)) amount = new(big.Int).Div(amount, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(msg.Tier)), nil)) @@ -578,6 +606,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { grace := timeout / 288 // 24h timeout => 5m grace f.timeouts[id] = time.Now().Add(timeout - grace) + f.timeouts[ips[len(ips)-2]] = time.Now().Add(timeout - grace) fund = true } f.lock.Unlock() @@ -799,7 +828,7 @@ func authTwitter(url string, tokenV1, tokenV2 string) (string, string, string, c address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body))) if address == (common.Address{}) { //lint:ignore ST1005 This error is to be displayed in the browser - return "", "", "", common.Address{}, errors.New("No Binance Smart Chain address found to fund") + return "", "", "", common.Address{}, errors.New("No BNB Smart Chain address found to fund") } var avatar string if parts = regexp.MustCompile(`src="([^"]+twimg\.com/profile_images[^"]+)"`).FindStringSubmatch(string(body)); len(parts) == 2 { @@ -925,7 +954,7 @@ func authFacebook(url string) (string, string, common.Address, error) { address := common.HexToAddress(string(regexp.MustCompile("0x[0-9a-fA-F]{40}").Find(body))) if address == (common.Address{}) { //lint:ignore ST1005 This error is to be displayed in the browser - return "", "", common.Address{}, errors.New("No Binance Smart Chain address found to fund") + return "", "", common.Address{}, errors.New("No BNB Smart Chain address found to fund") } var avatar string if parts = regexp.MustCompile(`src="([^"]+fbcdn\.net[^"]+)"`).FindStringSubmatch(string(body)); len(parts) == 2 { @@ -941,19 +970,7 @@ func authNoAuth(url string) (string, string, common.Address, error) { address := common.HexToAddress(regexp.MustCompile("0x[0-9a-fA-F]{40}").FindString(url)) if address == (common.Address{}) { //lint:ignore ST1005 This error is to be displayed in the browser - return "", "", common.Address{}, errors.New("No Binance Smart Chain address found to fund") + return "", "", common.Address{}, errors.New("No BNB Smart Chain address found to fund") } return address.Hex() + "@noauth", "", address, nil } - -// getGenesis returns a genesis based on input args -func getGenesis(genesisFlag *string, goerliFlag bool, rinkebyFlag bool) (*core.Genesis, error) { - switch { - case genesisFlag != nil: - var genesis core.Genesis - err := common.LoadJSON(*genesisFlag, &genesis) - return &genesis, err - default: - return nil, fmt.Errorf("no genesis flag provided") - } -} diff --git a/cmd/faucet/faucet.html b/cmd/faucet/faucet.html index 849145a60d..4f299857ca 100644 --- a/cmd/faucet/faucet.html +++ b/cmd/faucet/faucet.html @@ -1,220 +1,249 @@ - - - - - - {{.Network}}: Faucet - - - - - - - - - - - - - -
-
-
-
-

{{.Network}} Faucet

-
-
-
-
-
- - + + + + + + {{.Network}}: Faucet + + + + + + + + + + + + + +
+ +
+
+
+
+

{{.Network}} Faucet

+
+
+
+
+
+ + -
{{if .Recaptcha}} -
{{end}} -
-
-
-
-
-
-
+
- +
+
+
+
+
+
+ +
+
+
+
+
+

How does this work?

+

BTC,ETH,XRP,BUSD,USDT,USDC,DAI are issued as BEP20 token.

+

Click to get detail about BEP20.

+ +

Support Discord: discord.gg/bnbchain

+ {{if .Recaptcha}}The faucet is running reCaptcha protection against bots.{{end}}
-
-
- -{{if .Recaptcha}} -{{end}} - + // Start a UI updater to push the progress bars forward until they are done + setInterval(function() { + $('.progress-bar').each(function() { + var progress = Number($(this).attr('aria-valuenow')) + 1; + if (progress < 30) { + $(this).attr('aria-valuenow', progress); + $(this).css('width', (progress * 100 / 30) + '%'); + } else if (progress == 30) { + $(this).css('width', '100%'); + $(this).addClass("progress-bar-danger"); + } + }) + $('.timer').each(function() { + var index = Number($(this).attr('id').substring(5)); + $(this).html(moment.duration(moment(requests[index].time).unix()-moment().unix(), 'seconds').humanize(true)); + }) + }, 1000); + + // Establish a websocket connection to the API server + reconnect(); + {{if .Recaptcha}} + {{end}} + diff --git a/cmd/faucet/website.go b/cmd/faucet/website.go index 854f4404d9..dae64a7f23 100644 --- a/cmd/faucet/website.go +++ b/cmd/faucet/website.go @@ -1,6 +1,6 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// faucet.html (8.959kB) +// faucet.html (10.721kB) package main @@ -10,7 +10,6 @@ import ( "crypto/sha256" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -69,7 +68,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _faucetHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x5a\x5b\x8f\xe3\x36\xb2\x7e\x76\xff\x8a\x8a\xce\x24\x96\x4f\xb7\x24\x7b\x3a\x37\xd8\x92\x0f\xa6\x27\x39\xc1\x2c\x76\x27\x41\x26\xc1\xee\x22\xc9\x03\x2d\x95\x2d\x4e\x53\xa4\x42\x96\xec\x76\x0c\xff\xf7\x05\xa9\x8b\xe5\x4b\xf7\xce\x25\xc0\x62\xe7\xc1\x2d\x92\xc5\xaa\x8f\x55\xc5\xba\x48\x13\x7f\xf2\xcd\xf7\x2f\x7f\xfa\xe7\x0f\xdf\x42\x4e\x85\x98\x5f\xc5\xf6\x0f\x08\x26\x57\x89\x87\xd2\xb3\x13\xc8\xb2\xf9\xd5\x20\x2e\x90\x18\xa4\x39\xd3\x06\x29\xf1\x2a\x5a\x06\x5f\x7b\xdd\x7c\x4e\x54\x06\xf8\x7b\xc5\xd7\x89\xf7\x8f\xe0\xe7\x17\xc1\x4b\x55\x94\x8c\xf8\x42\xa0\x07\xa9\x92\x84\x92\x12\xef\xd5\xb7\x09\x66\x2b\x3c\x6c\x93\xac\xc0\xc4\x5b\x73\xdc\x94\x4a\x53\x8f\x72\xc3\x33\xca\x93\x0c\xd7\x3c\xc5\xc0\x0d\x6e\x80\x4b\x4e\x9c\x89\xc0\xa4\x4c\x60\x32\xf1\xe6\x57\x57\x83\x98\x38\x09\x9c\xef\x76\xe1\x6b\xa4\x8d\xd2\xf7\xfb\xfd\x14\xfe\x9f\x55\x29\x52\x1c\xd5\x6b\x96\x4a\x70\x79\x0f\xb9\xc6\x65\xe2\x59\xa4\x66\x1a\x45\x69\x26\xdf\x9a\x30\x15\xaa\xca\x96\x82\x69\x0c\x53\x55\x44\xec\x2d\x7b\x88\x04\x5f\x98\x88\x36\x9c\x08\x75\xb0\x50\x8a\x0c\x69\x56\x46\xb7\xe1\x6d\xf8\x55\x94\x1a\x13\x75\x73\x61\xc1\x65\x98\x1a\xe3\x81\x46\x91\x78\x86\xb6\x02\x4d\x8e\x48\x1e\x44\xf3\x0f\x12\xbb\x54\x92\x02\xb6\x41\xa3\x0a\x8c\x3e\x0f\xbf\x0a\xc7\x4e\x62\x7f\xfa\x69\xa1\x57\x83\xd8\xa4\x9a\x97\x04\x46\xa7\xef\x2c\xf6\xed\xef\x15\xea\x6d\x74\x1b\x4e\xc2\x49\x33\x70\x62\xde\x1a\x6f\x1e\x47\x35\xc3\xf9\xc7\xb0\x0e\xa4\xa2\x6d\xf4\x3c\xfc\x3c\x9c\x44\x25\x4b\xef\xd9\x0a\xb3\x56\x90\x5d\x0a\xdb\xc9\x3f\x4b\xec\x63\xf6\x7b\x7b\x6a\xbe\x3f\x41\x56\xa1\x0a\x94\x14\xbe\x35\xd1\xf3\x70\xf2\x75\x38\x6e\x27\xce\xd9\x5b\xfe\xd6\x5e\xf3\xab\xc1\x20\x5c\xa3\x26\x9e\x32\x11\xa4\x28\x09\x35\xec\xae\x06\x83\x41\xc1\x65\x90\x23\x5f\xe5\x34\x85\xc9\x78\xfc\xe9\xec\xc2\xe4\x3a\x77\xb3\x19\x37\xa5\x60\xdb\x29\x2c\x05\x3e\xb8\x19\x26\xf8\x4a\x06\x9c\xb0\x30\x53\xa8\xb9\xda\xf9\xbd\x95\x56\x6a\xb5\xd2\x68\x4c\x2d\xa6\x54\x86\x13\x57\x72\x6a\x9d\x88\x11\x5f\xe3\x39\xa1\x29\x99\x3c\xa5\x66\x0b\xa3\x44\x45\x78\x0c\x60\x21\x54\x7a\xef\xa6\xdc\x55\xed\x21\x4f\x95\x50\x7a\x0a\x9b\x9c\x53\x27\xa1\xd4\xd8\xb0\x65\x59\xc6\xe5\x6a\x0a\x5f\x96\x35\xfe\x82\xe9\x15\x97\x53\x18\x37\xa4\x71\xd4\x68\x2b\x8e\xea\x28\x74\x15\x2f\x54\xb6\x9d\x5f\xc5\x19\x5f\x43\x2a\x98\x31\x89\x77\xa2\x46\x17\x5c\x7a\xcb\x36\xa4\x30\x2e\xeb\x85\xa3\x15\xad\x36\x1e\x38\x01\x89\x57\x4b\x0e\x16\x8a\x48\x15\x53\x98\x58\x44\x6e\xc3\x09\x2f\x11\x88\x55\x30\x79\x5e\x2f\x0d\xe2\x7c\xd2\x32\x20\x7c\xa0\xc0\xe9\xbf\xd3\xbc\x37\x8f\x79\xbb\x73\xc9\x60\xc9\x82\x05\xa3\xdc\x03\xa6\x39\x0b\x72\x9e\x65\x28\x13\x8f\x74\x85\xd6\x43\xf8\x1c\xfa\x41\xac\x8b\x61\xf9\xa4\x46\x11\x65\x7c\xed\x0e\xd0\x3d\x9c\x9c\xe4\x31\xb0\x5f\x43\xf3\xa0\x96\x4b\x83\x14\x74\xd8\x7b\xa4\x5c\x96\x15\x05\x2b\xad\xaa\xb2\x59\x1d\xc4\x6e\x0e\x78\x96\x78\x95\x16\x5e\x13\xa9\xdd\x23\x6d\xcb\xe6\xc0\x5e\x77\x3c\xa5\x8b\xc0\x6a\x5a\x2b\xe1\x41\x29\x58\x8a\xb9\x12\x19\xea\xc4\x7b\xa3\x52\xce\x04\xc8\xfa\x64\xf0\xf3\x8f\x7f\x85\xc6\x24\x5c\xae\x60\xab\x2a\x0d\x77\x5c\x32\x99\x22\xbc\x29\x98\x26\x78\x99\x33\x2e\x81\x65\x99\x75\xc2\x30\x0c\x3b\x44\xce\x1f\xcf\x11\x07\x0b\x92\x2d\x8d\x25\x5b\x54\x44\xaa\x23\x5c\x90\x84\x05\xc9\x20\xc3\x25\xab\x04\x41\xa6\x55\x99\xa9\x8d\x0c\x48\xad\x56\x36\x39\xd5\xa7\xa9\x37\x79\x90\x31\x62\xcd\x52\xe2\xb5\xb4\xad\xc9\x98\x29\x55\x59\x95\x8d\xd1\xea\x49\x7c\x28\x99\xcc\x30\xb3\x26\x16\x06\xbd\xf9\x77\x7c\x8d\x50\x20\xdc\xbd\xbe\x1b\x9c\xda\x3f\x65\x1a\x29\xe8\xb3\x3c\xf3\x82\x38\xaa\xa1\xd4\x07\x82\xe6\x5f\x5c\x89\x96\x53\x77\x80\x02\x65\x05\x47\xa3\x40\xdb\x10\xe1\xcd\x77\x3b\xcd\xe4\x0a\xe1\x19\xcf\x1e\x6e\xe0\x19\x2b\x54\x25\x09\xa6\x09\x84\x2f\xdc\xa3\xd9\xef\x8f\xb8\x03\xc4\x82\xcf\x63\xf6\x94\x2f\x83\x92\xa9\xe0\xe9\x7d\xe2\x11\x47\x9d\xec\x76\x96\xf9\x7e\x3f\x33\xdb\x62\xa1\x44\x32\xbc\x7b\x7d\x37\x9c\xc1\x6e\xc7\x97\xf0\x2c\xfc\x11\x53\x56\x52\x9a\xb3\xfd\x7e\xa5\xdb\xe7\x10\x1f\x30\xad\x08\xfd\xd1\x6e\x87\xc2\xe0\x7e\x6f\xaa\x45\xc1\xc9\x6f\x79\xd9\x79\x99\xed\xf7\xf6\x00\x0d\xe8\xfd\x3e\x8e\xd8\x3c\x8e\x04\x9f\x37\x8b\xc7\x6a\x89\x2a\xd1\x59\x3e\x8e\xac\x83\xfc\x77\x39\xcb\x0f\xb8\x5a\x6d\x81\xd4\x3d\x4a\xf3\x1f\x72\x16\xe8\xbc\xa5\x36\xe5\x0d\x3c\x5b\x60\xf9\x1c\x5f\xc9\xa5\x72\x3e\x73\xd7\x8e\x5a\xb7\x71\x8a\x7b\x0f\x87\x69\x5c\x64\xb7\x6b\x24\xec\xf7\x1f\xe6\x28\x0e\x88\xdf\x63\x73\xe4\x30\x1d\xe8\xc6\xc9\xdf\x90\xde\xef\xa1\x47\xfd\x61\x9e\x54\xc7\x5b\x07\xb7\x8f\xf6\x2c\x84\xae\x82\x0e\x7f\xe3\x18\x86\x13\xde\xe3\x36\xf1\x76\xbb\xfe\xce\x66\x35\x65\x42\x2c\x98\x53\x8f\x3b\x5c\xb7\xe9\x0f\xb4\x0e\xbb\xe6\xc6\xd5\xce\xf3\x56\x7e\x07\xf9\xdf\x67\x82\x93\x9c\x46\xaa\x9c\xc2\xed\xf3\xa7\x12\xda\x97\x27\x39\xe2\xf6\x42\x8e\x28\x99\x44\x01\xee\x37\x30\x05\x13\xed\x73\x73\x57\xba\x28\x7d\xba\x25\xb0\x19\xbb\xc3\xd4\xa5\xfc\xf1\x0c\xd4\x1a\xf5\x52\xa8\xcd\x14\x58\x45\x6a\x06\x05\x7b\xe8\xaa\x9c\xdb\xf1\xb8\x03\x6c\xb9\x12\x5b\x08\x74\xd9\x48\xe3\xef\x15\x1a\x32\x5d\xee\xa9\x97\xdc\xaf\x4d\x41\x19\x4a\x83\xd9\x89\x12\xac\x3c\xab\x4b\x47\xd5\x22\x6d\xf5\x77\x11\xf5\x52\xa9\xa6\x98\xe8\x03\x68\x98\xf6\xaa\x1c\x6f\x1e\x93\x3e\x78\x0e\x65\xef\x55\x10\x68\x5b\xc6\x3f\x56\x0f\xd4\x31\xcc\x9e\xb9\x44\xd4\x75\x1d\x69\xfd\x12\xdc\x30\x8e\x28\xfb\x60\xb9\xd6\xd7\x16\xcc\xe0\xbb\x08\x77\xc5\xdd\x41\xb8\x1b\x7e\x9c\xf4\x1c\x99\xa6\x05\x32\x7a\x17\xf1\xcb\x4a\x66\xbd\xb3\xdf\xbd\xbe\xfb\x38\xe1\x95\xe4\x6b\xd4\x86\xd3\xf6\x5d\xa5\x63\x76\x10\x5f\x8f\xfb\x00\xe2\x88\xf4\xe3\x9e\x75\x78\x3c\xbb\xb7\xcd\xdf\xe6\xcf\x55\xdc\xb5\x20\x51\x04\xdf\x09\xb5\x60\x02\xd6\x16\xe0\x42\xa0\x01\x52\x60\x0b\x2a\xa0\x1c\x21\xad\xb4\x46\x49\x60\x88\x51\x65\x40\x2d\xdd\xec\xd2\x15\x8c\x57\x83\x35\xd3\xc0\x88\xb0\x28\x09\x12\x57\x49\xdb\x19\x83\x7a\xed\x9a\x01\x3b\xb0\x19\xbc\xbf\x56\xc7\x67\xcf\x6b\xc6\xed\x0d\x83\x04\x7e\xf9\x6d\x76\xe5\x00\x7d\x83\x4b\x2e\x11\x98\x55\x40\x6a\x5b\x01\xa0\x9c\x11\xa4\x1a\x19\xa1\x81\x54\x28\x53\xe9\x1a\xa7\xcd\x32\x60\xb1\xb6\x7c\x6a\xae\x76\xba\x74\x72\x5b\x16\x7e\xce\x4c\x3e\x72\xad\x80\x46\xaa\xb4\x3c\xac\xd4\xb3\x83\xa5\xd2\xe0\xdb\xcd\x3c\x19\xcf\x80\xc7\x2d\xc7\x50\xa0\x5c\x51\x3e\x03\x7e\x7d\xdd\x90\x0e\xf8\x12\xfc\x76\xfd\x17\xfe\x5b\x48\x0f\xa1\xe5\x0f\x49\x02\x07\x39\x03\x2b\xaa\xe1\x61\x4a\xc1\x53\xf4\xf9\x0d\x4c\x46\xb3\x7a\x6d\xa1\x91\xd5\x7d\x8c\x6b\x54\xdc\xcf\xfe\x6a\xb0\x9f\xf5\x75\xe0\x94\x7d\xa4\x85\x3a\x82\x1b\x60\xb0\xe2\x86\xa0\xd2\xc2\xea\xc1\xd2\xd5\x6a\x6f\xd4\xec\xa8\xfa\xe7\x3f\xcb\x2a\xcd\x43\x13\xed\x6b\xc8\x35\x8b\xd0\xa0\xcc\xfc\xbf\xbc\xf9\xfe\x75\x68\x48\x73\xb9\xe2\xcb\xad\xbf\xab\xb4\x98\xc2\x33\xdf\xfb\x1f\x5b\x97\x8f\x7e\x19\xff\x16\xae\x99\xa8\xf0\xa6\x31\xe9\x14\xda\x94\x6e\x2d\x3e\x75\xbf\x67\x32\x6f\xa0\x79\x9c\xc2\xb1\xf8\xfd\x68\x34\xbb\x94\xf7\x7a\x89\x5a\xa3\x41\xf2\x2d\x59\x93\x9e\x8e\x35\xc5\xa0\x40\xca\x55\x66\xb5\xa1\x31\x55\x52\x62\x4a\x50\x95\x4a\x36\x8a\x01\xa1\x8c\x69\x9d\xae\x5d\x4f\x4e\xdd\xa0\xa1\x4d\x40\xe2\x06\xfe\x8e\x8b\x37\x2a\xbd\x47\xf2\x7d\x7f\xc3\x65\xa6\x36\xa1\x50\x29\xb3\xe4\xb6\x73\x25\x95\x2a\x01\x49\x92\x40\xd3\xbc\x7b\x23\xf8\x3f\xf0\x36\xc6\xb6\xf1\x1e\x4c\xed\xa3\x7d\x1a\xc1\x35\x9c\x6e\xcf\x95\x21\xb8\x06\x2f\xaa\xaf\x92\xcd\x72\x9a\x22\x56\x72\x6f\x64\x6f\x41\x6b\x09\x25\x0b\x34\x86\xad\xb0\x8f\x14\xd7\x28\xa9\xf1\x31\x7b\x9c\xc2\xac\x20\x01\x67\xaf\x92\x69\x83\x35\x41\x68\xe3\x6e\xed\x6c\xd6\x5d\x1d\x51\x92\x80\xac\x84\x68\xfd\xb3\xbe\x09\xb3\xda\xfb\x7a\x84\xa1\x8b\x83\xf0\x49\x92\x80\x0d\x41\x56\xbf\x59\xbb\xc7\x7a\x40\x1d\x26\x47\xa1\x8d\x81\x07\xfa\xd1\xac\x75\xe3\x23\x3e\x98\x3d\xcd\x08\xb3\x53\x4e\x98\x5d\x60\xe5\xf2\xd0\xe3\x9c\xea\xac\xd5\x63\xe4\x26\x2e\xf0\x91\x55\xb1\x40\xfd\x38\xa3\x3a\x03\x35\x8c\x9c\x3a\x5f\x49\xea\xed\xbc\x81\xc9\x97\xa3\x0b\x7c\x51\x6b\xf5\x08\x5b\xa9\x68\xeb\xef\x04\xdb\xaa\x8a\xa6\x30\x24\x55\xbe\x74\x09\x63\x78\x03\x56\xca\x14\xba\xfd\x37\xae\xe8\x9f\xc2\xd0\x8d\xec\x3a\x2f\xd0\xed\xfa\x62\x3c\x1e\xdf\x40\xfb\xba\xe4\x8e\xd9\x1b\xa6\x2b\xdc\x5f\x40\x62\xaa\x34\x45\xf3\x88\xae\xde\x09\x4b\xc3\xa1\x43\xd3\x8c\x3f\x10\x4f\x17\xe2\x8f\x00\xc1\x67\x9f\xc1\xd9\x6a\xdf\x39\xa3\x08\xfe\xc6\xf4\x3d\xb8\xea\x4f\xe3\x9a\xab\xca\x1c\xd2\x45\xc1\x8d\xb1\x3d\x3d\x33\x90\x29\x89\x6e\xc7\xfb\x44\xf0\x33\x74\x0d\x11\xcc\x61\x7c\x0a\xcd\xc6\xba\x5e\x84\xbf\x10\xf8\x3b\xae\xfd\xa8\x3e\xd8\x1f\x24\x1d\xed\xe1\x05\xc2\x27\x09\x78\xde\x61\xdb\xd9\xba\x5d\x6e\xd8\x0c\x0c\xd2\x4f\xb5\xde\xfd\x26\xb1\x5d\x4a\x3e\xa3\x1b\x5b\xc8\x8e\x47\x47\xc2\xf7\xad\x2a\x5f\x94\x25\xca\x0c\x98\xdc\xba\xc8\xd6\xe9\x91\x4b\x52\xa0\x2a\x1b\x1d\x53\x26\x6c\x69\x2e\xd0\x45\x19\xb7\xd1\x2a\x33\x55\x45\xa1\x24\x24\x10\x4c\x66\x67\xc9\xaf\xa7\xb5\xee\x30\xa7\x66\xb8\xa0\xe5\x63\x53\x1c\x6b\xe8\x84\x34\x98\x1c\x29\xff\xc8\x2e\x97\x0c\x30\xe8\xf0\xf2\x56\x7f\x47\x46\x69\xad\xd2\xd7\x4f\x0f\x71\xbd\xfb\x7a\xf2\x4e\xc0\xbb\xc5\xb2\x32\xb9\x7f\x02\x6d\x34\x3b\xb6\xc0\x2b\x42\xcd\x08\x5d\x27\xe2\x34\x8e\x92\xb8\xc6\x33\xc5\x03\x93\xb6\x9c\x09\x34\xca\x0c\x75\x5b\x01\xd8\x46\xa6\xee\x3b\x7a\x86\x71\xdf\x2f\x7a\xae\xd2\x3b\xc7\x99\x16\x67\xc0\x61\x6e\xeb\x30\xe0\x41\xd0\x9d\xc0\x15\x4b\x4a\xa2\x6d\x4b\x4f\x3c\xdb\x79\x61\xcf\x0d\x2d\x29\x0a\x56\x1a\xcc\x20\x81\xfa\xad\xb3\x3f\x0a\x2b\xc9\x1f\xfc\x51\xd0\x8c\x4f\x39\xb4\xeb\x2e\xa7\x39\xe3\xd4\x98\xaf\x13\xf0\x62\xd2\xb6\xec\x1d\x7a\x70\x7d\xe9\x4e\xd9\xec\x38\x9c\xb7\xd2\xfb\x1b\x01\x62\xca\xe6\xae\x8d\xaa\x8b\xf1\x5f\x3d\xdb\xdd\xae\xb4\xaa\x64\x36\xb5\x25\x91\x7f\xc6\x94\xad\x19\x31\xed\x78\x8e\x66\x70\x20\x77\x4d\xf0\x14\x52\x6b\x95\x19\xd4\xbd\x96\xeb\x5f\xa1\xeb\x0e\xdd\x68\xa1\x74\x86\x3a\xd0\x2c\xe3\x95\x99\xc2\xe7\xe5\xc3\xec\xd7\xb6\x61\x76\x15\xfa\x13\x40\x4b\x8d\xf3\x33\x3c\x69\xea\x5e\x94\x5d\x83\x17\x47\x96\xe0\x69\x26\xdd\x41\xfb\xef\xbc\xe1\x42\x0f\x02\xdd\x1b\xea\x66\xbe\xe0\x59\x26\xd0\x82\x6d\x99\xdb\xdb\x66\x6d\x7e\xb8\x33\xc7\xe2\xa0\x69\x3c\x5a\xfa\x3d\xa0\x30\xf8\x28\x71\xd7\xbf\x0c\xad\xc1\x03\x7b\x50\xee\xf4\xdc\xb4\x42\x6e\x5a\x0f\x9d\x06\x9a\x6f\x15\x59\xa5\x5d\x15\xe4\x07\x8d\x43\xdd\xc0\xd0\xd8\x9a\x2c\x33\xc3\x51\x98\x57\x05\x93\xfc\x0f\xf4\x6d\x42\x19\xd5\x1a\x72\x0d\x91\x77\x1c\x57\xcf\x80\x1c\xfa\xea\x61\x9b\x98\x86\x8d\xe2\x86\xad\x35\xad\xe1\xe0\xd0\xa7\x0f\xdf\x43\x2b\x97\x25\x04\x0b\xa6\xa1\x3f\x08\xda\x6c\x09\x5a\x59\xc9\xed\xda\x82\xe9\x61\xdd\x04\xba\xba\x59\xaa\x4d\x32\xbc\x1d\x77\x00\x6b\xc3\x3a\xbb\x0e\x1b\xbf\x3a\x31\x80\x45\xd8\x5e\xc0\x39\xdc\x8e\x3f\x1e\x69\xc6\xe4\x0a\x4f\xd1\x93\xe6\x25\x66\xc0\x52\xe2\x6b\xfc\xd3\x0f\xf1\xd1\xca\x7d\x6f\x78\xd6\xef\x5a\xb5\x39\xb7\x3c\xc2\x6a\x57\x3b\xad\xfe\xaf\xbd\x57\x10\x39\xdd\x5e\x83\x77\xe1\x10\x8f\x78\xde\x11\xd1\xc9\xe5\x7d\xec\x5e\xbb\x5e\xde\xeb\x27\x09\x5b\x7e\x76\x6f\x9c\x46\x61\x4e\x85\xf0\xbd\x98\xdc\x57\x28\x8b\xb3\xdb\xed\x36\xd7\xd3\x87\x7a\x6b\xdf\xef\x1a\x6c\x8f\x8c\x27\xdd\x0d\xf4\xea\x88\xae\x03\x6a\x8b\x06\xb0\xdd\xd4\xde\x35\x54\x6f\x88\x69\x02\x06\x3f\xbf\x82\xaa\xcc\x18\xd9\x24\xa4\xc0\xa6\x38\x97\x8c\xba\x4f\x76\x0b\xa6\x0d\x2c\x95\xde\x30\x9d\x41\x25\x89\x0b\xbb\xbe\x05\xa6\xb1\xa9\xc9\x0c\xd2\x2b\x1b\x95\xd6\x4c\xf8\x27\x7d\xd6\x33\x7f\x18\xf6\x0d\x3b\x1c\x85\xc8\xd2\xfc\x94\xcc\x65\x9d\x4e\x62\x02\xaf\x5d\x0d\xee\x3f\xf3\x29\xe7\x66\x14\x32\x22\xed\x0f\x8f\x0c\x3e\x1c\x59\xdb\x4d\xba\xbe\xa7\xdb\x1c\xf7\xae\xcc\x53\xfb\x0f\x55\x6d\x93\xc1\x5b\xe2\xd4\x18\xbf\xf6\x9a\xe1\x4d\x8f\xef\xb1\xd3\x0c\x3f\x1d\x36\x26\x39\x5c\xda\x03\xfe\xe4\x02\x86\x23\xb6\x43\x7b\x77\x86\x27\x82\x59\x96\xbd\xb4\xf7\xc2\xf7\x2e\xdc\xde\xbe\x07\x8c\x1a\xc5\xd6\x11\xf7\x09\x8d\x72\x99\xe1\xc3\x63\xea\xe4\xd9\x70\x14\x9a\x6a\x51\xf7\xfe\xfe\x17\x4d\xb7\xd3\x12\x39\xb7\x3c\x0d\xe4\x67\xe9\xdf\x0a\x38\x2e\x01\x82\x93\x92\xe1\x89\x98\xef\x04\xda\xd3\xec\x6f\xac\x72\xc7\xa3\xe6\xc5\xd0\xb7\xc6\x56\x40\xdc\xe4\xc0\x60\x83\x0b\xe3\x7a\x73\x68\x3c\xd9\xbd\x21\xa9\xdf\x84\xbc\xf8\xe1\x55\xf7\x36\xa4\xf3\x74\x5b\x84\x74\x1f\xc7\xcf\xdf\x35\x5c\xfc\x16\xbf\xd9\x6c\xc2\x95\x52\x2b\x51\x7f\x85\xef\x5e\x46\xd8\x46\x3d\x7c\x6b\x3c\x60\x66\x2b\x53\xc8\x70\x89\x7a\xde\x63\x5e\xbf\xa1\x88\xa3\xe6\x03\x72\x54\xff\x77\x97\x7f\x05\x00\x00\xff\xff\x1d\xd7\x27\x7a\xff\x22\x00\x00") +var _faucetHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x3a\x6b\x6f\xe3\x38\x92\x9f\xd3\xbf\xa2\x46\xd7\x3b\xb6\xaf\x23\xc9\xef\x38\xb6\xe5\x41\x3b\x49\xef\xe6\x80\xeb\x6d\x6c\xf7\xe0\xf6\x30\x3b\x38\x50\x62\xd9\x66\x47\x22\x35\x24\xe5\xc4\x6b\xf8\xbf\x1f\x48\x3d\x2c\x3f\x92\xe9\xc7\x2c\x0e\x97\x0f\x8e\x48\x16\xeb\xcd\xaa\x62\x49\xd3\x1f\x6e\xff\x7a\xf3\xe9\xbf\x3f\xdc\xc1\x4a\x27\xf1\xec\xd5\xd4\xfc\x83\x98\xf0\x65\xe0\x20\x77\x66\xaf\x2e\xa6\x2b\x24\x74\xf6\xea\xe2\x62\x9a\xa0\x26\x10\xad\x88\x54\xa8\x03\x27\xd3\x0b\x77\xe4\xec\x17\x56\x5a\xa7\x2e\xfe\x96\xb1\x75\xe0\xfc\xdd\xfd\xf9\xad\x7b\x23\x92\x94\x68\x16\xc6\xe8\x40\x24\xb8\x46\xae\x03\xe7\xfe\x2e\x40\xba\xc4\xda\x3e\x4e\x12\x0c\x9c\x35\xc3\xc7\x54\x48\x5d\x03\x7d\x64\x54\xaf\x02\x8a\x6b\x16\xa1\x6b\x07\x97\xc0\x38\xd3\x8c\xc4\xae\x8a\x48\x8c\x41\xc7\x99\xbd\x32\x78\x34\xd3\x31\xce\xb6\x5b\xef\x3d\xea\x47\x21\x1f\x76\xbb\x31\xbc\x23\x59\x84\x7a\xea\xe7\x6b\x16\x2c\x66\xfc\x01\x56\x12\x17\x81\x63\x98\x55\x63\xdf\x8f\x28\xff\xac\xbc\x28\x16\x19\x5d\xc4\x44\xa2\x17\x89\xc4\x27\x9f\xc9\x93\x1f\xb3\x50\xf9\xfa\x91\x69\x8d\xd2\x0d\x85\xd0\x4a\x4b\x92\xfa\x3d\xaf\xe7\x5d\xf9\x91\x52\x7e\x35\xe7\x25\x8c\x7b\x91\x52\x0e\x48\x8c\x03\x47\xe9\x4d\x8c\x6a\x85\xa8\x1d\xf0\x67\xdf\x46\x77\x21\xb8\x76\xc9\x23\x2a\x91\xa0\xdf\xf7\xae\xbc\xb6\x25\x59\x9f\x7e\x99\xaa\x21\xab\x22\xc9\x52\x0d\x4a\x46\x5f\x4c\xf7\xf3\x6f\x19\xca\x8d\xdf\xf3\x3a\x5e\xa7\x18\x58\x3a\x9f\x95\x33\x9b\xfa\x39\xc2\xd9\x77\xe1\x76\xb9\xd0\x1b\xbf\xeb\xf5\xbd\x8e\x9f\x92\xe8\x81\x2c\x91\x96\x94\xcc\x92\x57\x4e\xfe\x61\x74\x9f\xb3\xe1\xe7\x63\x13\xfe\x11\xc4\x12\x91\x20\xd7\xde\x67\xe5\x77\xbd\xce\xc8\x6b\x97\x13\xa7\xf8\x2d\x01\x63\x34\x43\xea\xc2\x5b\xa3\xd4\x2c\x22\xb1\x1b\x21\xd7\x28\x61\x6b\x66\x2f\x12\xc6\xdd\x15\xb2\xe5\x4a\x8f\xa1\xd3\x6e\xff\x69\x72\x6e\x76\xbd\xca\xa7\x29\x53\x69\x4c\x36\x63\x58\xc4\xf8\x94\x4f\x91\x98\x2d\xb9\xcb\x34\x26\x6a\x0c\x39\x66\xbb\xb0\xb3\x34\x53\x29\x96\x12\x95\x2a\x88\xa5\x42\x31\xcd\x04\x1f\x1b\x8f\x22\x9a\xad\xf1\x1c\xac\x4a\x09\x3f\xd9\x40\x42\x25\xe2\x4c\xe3\x11\x23\x61\x2c\xa2\x87\x7c\xce\x9e\xdf\xba\x10\x91\x88\x85\x1c\xc3\xe3\x8a\x15\xdb\xc0\x12\x82\x54\x62\x81\x1e\x52\x42\x29\xe3\xcb\x31\x0c\xd3\x42\x1e\x48\x88\x5c\x32\x3e\x86\xf6\x7e\xcb\xd4\x2f\xd5\x38\xf5\xf3\x50\xf5\xea\x62\x1a\x0a\xba\x31\x33\x94\xad\x81\xd1\xc0\x91\x18\x91\x54\x47\x2b\xf2\x3f\x18\xa3\xb1\x88\x31\x05\x65\x6b\x0b\x5c\x02\xe5\x91\x87\xce\x05\xdd\x38\x10\xc5\x44\xa9\xc0\x39\xb2\x8b\x8d\x5b\xf9\x8e\x02\xc0\x6c\x22\x8c\x97\x4b\x07\x6b\x52\x3c\x3a\x60\xb9\x0b\x9c\x9c\x73\x37\x14\x5a\x8b\x64\x0c\x1d\x23\x53\xb1\xe5\x08\x5f\xec\xc6\x4b\xb7\xd3\x2d\x17\x2f\xa6\xab\x4e\x89\x44\xe3\x93\x76\xad\x51\x2b\x73\x3a\xb3\x29\x2b\xf7\x2e\x08\x2c\x88\x1b\x12\xbd\x72\x80\x48\x46\xdc\x15\xa3\x14\x79\xe0\x68\x99\xa1\x91\x98\xcd\xa0\x1e\x25\xab\x20\xb9\xea\x94\x9c\xe4\x4a\x39\x7e\x3c\x92\xe9\x79\xb6\x47\x50\x3c\x88\xc5\x42\xa1\x76\x6b\x52\xd4\x80\x19\x4f\x33\xed\x2e\xa5\xc8\xd2\x6a\xfd\x62\x6a\x67\xad\x21\x32\x19\x3b\x45\x5e\xb0\x8f\x7a\x93\x16\xc2\x57\x76\x59\x08\x99\xb8\x46\xf7\x52\xc4\x0e\xa4\x31\x89\x70\x25\x62\x8a\x32\x70\xee\x2d\x9e\x8d\xc8\x24\xcc\xdf\xcf\xe1\x63\x42\xa4\x86\x9b\x15\x61\x1c\x08\xa5\xc6\x89\x3d\xcf\xab\xd1\xb5\x1e\x7d\xca\x99\x1b\x6a\xbe\x87\xba\x98\x86\x99\xd6\xa2\x02\x0c\x35\x87\x50\x73\x97\xe2\x82\x64\xb1\x06\x2a\x45\x4a\xc5\x23\x77\xb5\x58\x2e\x4d\xc6\xcb\x79\xce\x37\x39\x40\x89\x26\xc5\x52\xe0\x94\xb0\xa5\x91\x88\x4a\x45\x9a\xa5\x85\x99\xf2\x49\x7c\x4a\x09\xa7\x48\x8d\x51\x63\x85\xce\xec\xcf\x6c\x8d\x90\xa0\x11\xe9\xe2\xd8\xe2\x11\x91\xa8\xdd\x3a\xca\x13\xbb\x4f\xfd\x9c\x95\x5c\x20\x28\xfe\xa6\x59\x5c\x62\xaa\x04\x48\x90\x67\x70\x30\x72\xa5\x89\x35\x95\x2e\x00\xb6\x5b\x49\xf8\x12\xe1\x35\xa3\x4f\x97\xf0\x9a\x24\x22\xe3\x1a\xc6\x01\x78\x6f\xed\xa3\xda\xed\x0e\xc8\x00\x4c\x63\x06\xb3\x29\x79\xc9\x8f\x41\xf0\x28\x66\xd1\x43\xe0\x68\x86\x32\xd8\x6e\x0d\xf6\xdd\x6e\xa2\x36\x49\x28\xe2\xa0\x31\x7f\x3f\x6f\x4c\x54\x16\x26\x4c\x37\x5b\xce\x6c\xbb\x2d\xe8\xee\x76\x53\x9f\xcc\xa6\x7e\xcc\x66\xdb\x2d\x72\x7a\x44\x7b\xea\x67\xf1\xde\xd6\xbe\x31\xf6\xff\x37\xd3\x7f\xc0\xe5\x72\x03\x5a\x3c\x20\x57\xff\x47\xa6\xdf\x9b\x3c\x37\xc7\x25\xbc\x0e\x31\xed\xe2\x3d\x5f\x08\x6b\xf8\x79\x39\x2a\x6d\x6f\x15\x17\xb3\x2f\x36\x7a\x61\xe6\xed\xb6\xa0\xb0\xdb\x4d\xe0\xc0\xda\x15\xbd\xc2\xc9\x3e\x6a\xb9\xdb\x41\x0d\xfe\x5b\xdd\xa0\x16\xe8\xbe\x30\xfe\x1d\xc5\x74\x2d\xd2\x31\xf4\xba\xb5\x80\x7e\x2e\x34\x0e\x8f\x42\x63\xef\x2c\x70\x4a\x38\xc6\x60\x7f\x5d\x95\x90\xb8\x7c\x2e\x9c\xad\x16\xb6\x8e\x37\xb9\xa1\xcd\x5b\x05\x6b\x55\xee\x6c\x4f\x40\xac\x51\x2e\x62\xf1\x38\x06\x92\x69\x31\x81\x84\x3c\x55\xf5\x43\xaf\xdd\xae\xf3\x6d\x8a\x69\x12\xc6\x58\x24\xcd\xdf\x32\x54\x5a\x55\x41\x37\x5f\xb2\xbf\x26\xf6\x52\xe4\x0a\xe9\x91\x36\x0c\x45\xe3\x77\x16\xaa\xa6\xf1\xbd\x8e\xcf\xf1\xbe\x10\xa2\xca\xae\x75\x36\x0a\xd4\xb5\xea\xc1\x99\x4d\xb5\xdc\xc3\x5d\x4c\x35\xfd\xaa\xec\x28\x4d\xc9\xfc\x5c\x72\xcc\x03\x82\x91\x3d\x45\x94\x79\xbd\x66\x3c\x05\xec\x70\xea\x6b\xfa\x1d\x94\x4d\x20\x08\x89\xc2\x2f\x21\x6f\x2b\xa7\x3d\x79\x3b\xfc\x5e\xfa\x2b\x24\x52\x87\x48\xf4\x97\x30\xb0\xc8\x38\xad\xc9\x3f\x7f\x3f\xff\x5e\xf2\x19\x67\x6b\x94\x8a\xe9\xcd\x97\xd2\x47\xba\x67\x20\x1f\x1f\xb2\x30\xf5\xb5\x7c\xd9\xd3\xfe\x05\x47\xfb\xf7\x6a\xb5\xde\xec\x2f\xe2\x11\xa8\x40\x05\x7a\xc5\x14\x98\x4a\xeb\xa7\xa9\xbf\xea\x55\x20\xa9\x89\x89\x87\xd7\x41\x8d\x4a\x73\xd4\x5e\xa8\x22\x15\x11\x9e\x5f\x2a\xf2\x5a\xc5\x6f\x3f\x0d\x23\x1c\xd1\xb7\xdd\xd1\x5d\x77\x31\x1a\xf6\xfb\xdd\xf6\xa8\xdf\x8e\xde\x5d\xf5\xfb\x57\x7d\x7c\xb7\x18\x2c\x6e\x47\xed\xbb\xe1\x60\x3e\x72\x66\xf3\x4f\x37\x26\x0a\x5e\x7e\x25\x01\x3a\x1c\x46\xc3\x79\xff\x5d\x3b\xc4\xd1\xcd\xdd\x20\xec\x5d\xdf\x0e\xba\x77\xed\x77\xb4\xd3\xeb\xf7\xa3\xde\xe8\xfa\xba\x7b\x3d\xef\x5d\x8d\x9c\xd9\xdd\xa7\xbf\x7c\x0b\x01\x32\xea\x0d\xae\x06\xfd\xeb\xf6\xed\x15\x5d\xf4\xef\xba\xef\xfa\x57\xe1\xd5\x6d\x6f\x84\x8b\xde\xa0\x43\xba\x57\xdd\x6e\xf4\xb6\x3f\x08\xaf\x9d\xd9\xdf\xff\xf6\xe1\x5b\x08\x20\xed\xf6\x17\x51\x6f\x48\x07\x88\xdd\x4e\x07\x49\x77\x40\x46\xed\x6e\xef\x7a\x11\x8e\xa2\x7e\xb4\xa0\xa3\xf6\xa2\xd3\x45\x74\x66\xf3\x9f\x3f\xde\x7e\x0b\x85\x5e\xef\x6a\xd8\x69\xd3\xee\x55\x34\x1c\x75\xef\x7a\xfd\xab\x9b\xeb\xe8\x76\xd8\x9e\xdf\xf6\xc3\x5e\xd8\x69\x5f\xdd\x5c\xd3\x5e\x9f\xde\x52\x67\xf6\xf3\xc7\xdb\x4f\xdf\x42\x61\xd8\x1f\xf4\xfb\xd7\xc3\x6b\xa4\x57\x77\xf3\xc5\x60\xd1\x1e\xf5\x86\x57\xd7\xdd\x5e\xaf\xd7\x1d\xf4\x06\xc3\xbb\xf0\xee\xaa\x37\xba\xee\xb5\x2d\x85\x6f\xb2\xf3\xdd\xcd\x80\xde\x84\x83\xdb\x70\xd1\x9f\x77\x3a\xfd\x9b\x6b\xda\x7e\x37\x1c\xcc\xa3\x9b\xb7\x61\xff\xfa\xee\x66\xd0\x7f\x37\x7c\xdb\x1e\x0d\xaf\x9c\xd9\xed\xdb\x7b\x43\x00\x88\x44\x60\x4a\x65\x48\x81\x28\x98\xdf\x7d\xe8\xb6\xf3\x42\xc4\x9b\xfa\x69\xcd\xa3\xe1\xc6\x64\x71\xd0\x02\x96\xa8\x81\xa2\x26\x2c\x06\x12\x8a\x4c\xc3\x09\x8f\x4b\xa6\x57\x59\x68\x59\x0b\x79\xe8\x46\xa6\x32\xf7\xe7\x77\x1f\x94\x1f\xc6\x22\xf4\x13\xa2\x34\x4a\xdf\xd2\xf2\x12\xea\xcc\xec\x93\xe1\x26\xa7\x59\x23\xfa\x31\x4b\x53\x21\x35\xdc\x32\x15\x09\x49\xc7\x87\xb4\xc6\xbe\x4f\xf3\x05\x6f\xb9\x34\xa4\x2c\x25\x67\x06\x67\x66\xc1\x4a\x5b\x93\x69\xbb\x65\x0b\xf0\xfe\x56\x5e\x1b\x77\xbb\x29\x26\xb3\x4f\x2b\x84\x85\xbd\x32\x01\x53\x20\x33\xce\x19\x5f\x82\xc4\x9b\x1c\x08\x52\x29\x34\x46\xe6\x4a\x0c\x64\x49\x18\x57\x1a\x42\xa1\x95\x37\xf5\x31\x39\xa8\x4a\xce\x07\xa3\xea\xa9\xba\x9a\x96\x3d\x08\xbb\xec\xfb\xf0\xe7\x58\x84\x24\x86\xb5\x89\x9f\x61\x6c\x42\x8c\x00\x73\xed\x01\xbd\x42\x88\x32\x29\x91\x6b\x50\x9a\xe8\x4c\x81\x58\xd8\xd9\x9c\x5f\xb3\x7f\x4d\x24\x10\xad\x31\x49\x35\x04\xc5\x0d\xda\xcc\x29\x94\xeb\xa2\x2f\x60\x86\xa6\xfa\x3e\x5c\xcf\x2b\x33\xc7\xa9\x66\xca\xc2\x00\x02\xf8\xe5\xd7\x6a\xb6\x50\xd5\xe4\x55\xc1\xec\x2d\x2e\x18\x47\x20\x26\x76\xe7\x4a\xd1\x2b\xa2\x21\x92\x48\x34\x2a\x88\x62\xa1\x32\x99\xcb\x60\x6a\x4e\x30\x72\x94\x98\x4b\x9c\x66\x21\xb5\xfc\x94\x48\x9a\x2b\xa2\x56\xad\xa2\x45\x20\x51\x67\x92\xef\xd7\xca\xf9\x8b\x85\x90\xd0\x34\x08\x58\xd0\x9e\x00\x9b\x96\x78\xbd\x18\xf9\x52\xaf\x26\xc0\xde\xbc\xa9\x80\x2f\xd8\x02\x9a\x25\xc4\x2f\xec\x57\x4f\x3f\x79\x86\x0a\x04\x01\xd4\xa9\x59\x82\x05\x1e\x95\xc6\x2c\xc2\x26\xbb\x84\x4e\x6b\x52\xae\x86\x12\xc9\x43\x39\x2a\x2c\x9d\xff\xb3\xbf\xbb\x5c\x35\x54\x44\x99\x6d\x0a\x2d\x51\xdf\xe5\xdd\x88\xf9\xe6\x9e\x36\x0f\xfa\x0f\x2d\xcf\x26\x22\xaf\xe8\xa5\x40\x00\x0e\x17\x1c\x9d\x1c\x45\x6e\x84\x42\xe1\x37\x24\x8e\x43\x12\x3d\xd4\x95\x54\xb2\xbc\x2a\x60\x3c\x89\x9c\xa2\x6c\x36\x4e\x1a\x21\x8d\xcb\x52\xba\x86\x62\x1a\x1f\x70\xd3\x80\x31\x34\xb6\xdb\xba\xf3\x37\x2e\x0b\x90\xa8\xa0\x65\x60\x88\x52\x6c\xc9\x4b\xea\x39\xc4\x2e\x57\xc6\x6e\xcf\xe6\x21\x54\x9d\xc7\x65\x81\xbe\xe4\xf5\x5b\xf5\x92\xd7\x4a\x93\x97\x71\x9c\x36\x80\x9e\xd7\xb0\x41\x54\x40\x43\x00\xcb\xca\xaf\x73\xc1\x0e\x9c\xdb\x9e\xb0\x03\xf7\xce\xef\x2c\x0a\x08\x2c\x99\xd2\x90\xc9\xd8\x38\xb8\x81\xcb\xcf\x59\x75\xaa\x2c\xdc\x39\x9b\xe5\x70\x9e\x42\x4e\x9b\xff\xf1\xf1\xaf\xef\x3d\xa5\x25\xe3\x4b\xb6\xd8\x34\xb7\x99\x8c\xc7\xf0\xba\xe9\xfc\x5b\x26\x63\xa7\xf5\x4b\xfb\x57\x6f\x4d\xe2\x0c\x2f\x8b\x43\x3a\x86\xf2\x7a\x66\x4e\xf1\xd8\xfe\x9e\x44\xb2\xcb\xf2\xa4\x8e\xcb\x87\x22\x34\xed\x5a\xad\xc9\x09\xf4\xb1\x1b\x29\xd4\x4d\x03\x56\x05\xb3\x63\x95\x10\x48\x50\xaf\x04\x35\x62\x4b\x8c\x04\xe7\x18\x69\xc8\x52\xc1\x0b\x0d\x40\x2c\x94\xaa\x79\x71\x01\xf1\xac\x26\x20\x00\x8e\x8f\xf0\x5f\x18\x7e\x14\xd1\x03\xea\x66\xb3\xf9\xc8\x38\x15\x8f\x5e\x2c\x22\x62\x36\x78\x26\xf0\x8a\x48\xc4\x10\x04\x01\x14\x89\xc6\x69\xc1\x4f\xe0\x3c\x2a\x93\x72\x1c\x18\x9b\x47\xf3\xd4\x82\x37\x70\xbc\x7d\x25\x94\x86\x37\xe0\xf8\x79\xb0\x34\x17\x2f\xa9\x7d\x92\x32\xa7\x95\x3b\x72\x69\x13\xc1\x13\x54\x8a\x2c\xb1\xce\x2d\xae\x91\xeb\x2a\x46\x18\xa1\x12\xb5\x84\x00\xac\xed\x52\x22\x15\xe6\x20\x9e\xb9\x00\x94\xc1\xc2\x84\x1c\x0b\x16\x04\xc0\xb3\x38\xde\xc7\x98\x3c\xa6\x4d\xca\xe8\x71\x00\xee\xd9\xb2\x1c\x7e\x08\x02\x30\xf5\xb0\xd1\x37\xdd\xef\x34\x7e\x91\xd7\xed\x2d\xcf\x94\xe4\xfb\x1d\xad\x49\x3d\x18\x1d\x60\x43\xfa\x7b\xe8\x90\x1e\xe3\x43\xfa\x0c\x42\x7b\x4d\x7a\x09\x5f\x7e\xad\xaa\xa1\xb3\x13\xcf\x60\xe3\x59\x12\xa2\x7c\x09\x5d\x7e\xf4\x0b\x74\x56\xd5\xf7\x5c\xd7\xf6\x5e\x42\x67\xd8\x7a\x06\x3b\x4a\x29\x9e\x45\xce\x85\xde\x34\xb7\x31\xd9\x88\x4c\x8f\xa1\xa1\x45\x7a\x63\xef\x35\x8d\x4b\x30\xb4\xc6\x50\x61\xb8\xb4\xed\x9e\x31\x34\xec\xc8\xac\xb3\x04\xed\xae\x41\xbb\xdd\xbe\x84\xb2\x71\x3e\x27\xe6\x3c\xca\x0c\x77\xcf\xf0\xa3\xb2\x28\x42\xf5\xac\xf6\xbe\x88\xa3\x02\x47\xc5\x53\x31\xfe\x0e\xae\xaa\x54\x7f\xc0\x16\xfc\xf8\x23\x9c\xac\x1e\xba\xb1\xef\xc3\x7f\x12\xf9\x00\xb6\x85\x21\x71\xcd\x44\xa6\xf6\x85\x43\xc2\x94\x32\xb5\x13\x51\x40\x05\xc7\x62\xcf\xd7\x65\xed\x13\x1e\x0b\x30\x98\x41\xfb\x98\x41\x13\x29\x6b\x59\xfd\x4c\xb2\xaf\xe1\x3d\xcc\xe3\x17\xbb\x3a\xbd\x83\x9d\x2c\x41\xf8\x21\x00\xc7\xa9\x6f\x3e\x81\x30\x00\x15\xb2\x0b\x85\xfa\x53\x6e\x8b\x66\x51\xdc\x9c\x2b\x3d\x5a\x97\xd0\x6b\xb7\xdb\xad\x13\x26\x76\x7b\xf5\xbe\x4d\x53\xe4\x14\x08\xdf\xd8\xf8\x58\xe9\x96\x71\x2d\x40\x64\x26\xce\x46\x24\x86\x48\xc4\x71\x5e\x94\x16\x5b\x6d\xad\x26\x92\x44\x70\x08\xc0\xed\x4c\xce\x14\x41\x35\x4d\xd6\x44\x3b\x36\xcf\x19\xdd\x1f\x9b\xe8\x50\x67\x47\xc0\x6e\xe7\xc0\x28\x07\xf6\x3a\x6f\x98\x8b\x8a\x6f\xb6\xd7\xe8\x91\xb9\xf6\xf6\x3a\xd6\x59\x8d\xff\x1c\xcf\x9b\xce\x17\x8a\x51\x2d\xa7\x99\x5a\x35\x8f\x18\x6d\x4d\x4e\x6d\x73\xaf\x51\x12\x8d\xb6\xf5\x66\x6d\x81\x5c\x33\x89\x27\x26\x01\xc2\x4d\xd1\xeb\xe6\xe5\x59\x59\x4e\x50\x73\x34\x6c\x5b\xe3\xc0\x64\xf6\xbd\xf8\x81\x3b\x7d\xe5\x81\xb1\x15\xb5\xe0\x08\x00\x70\x74\x08\xac\xa3\x1e\x78\xaa\x01\xc6\x98\xa4\x0a\x29\x04\x90\xbf\xc7\x6c\xb6\xbc\x8c\xb3\xa7\x66\xcb\x2d\xc6\xc7\x38\xca\xf5\x49\x79\x4d\xbb\x28\xd9\x7e\x13\x80\x33\xd5\x12\x18\x0d\x1a\x0e\xbc\x39\x77\x04\x4d\x0a\x6e\xcc\xf6\x1c\xd4\xb7\x02\x4c\x35\x9d\xd9\xe6\x4b\xde\xa1\xf9\x87\x63\xea\xc9\xa5\x14\x19\xa7\x63\x53\x66\x35\x4f\xd0\x92\x35\xd1\x44\x5a\xac\xad\x09\xec\xc1\x5d\xc5\xfe\x89\x63\x88\x8c\x71\x26\x90\xf7\x16\x6d\x8f\x07\xaa\xae\xa8\x1d\x85\x42\x52\x94\xae\x24\x94\x65\x6a\x0c\xfd\xf4\x69\xf2\x8f\xf2\xbd\xa1\xed\x44\xbd\xc8\x6a\x2a\x71\x76\xc2\x51\x14\xd9\x57\x25\x6f\xc0\x99\xfa\x06\xe0\xf7\xd0\x54\xc2\xd6\xdf\x9f\xc2\x99\x7e\x1b\x54\x2f\x2a\x8b\xf9\x84\x51\x1a\xa3\x61\x78\x8f\xde\x1c\x46\x63\xff\xfa\x91\x3a\x24\x09\x45\xa3\x6d\xbf\x67\x07\x18\x2b\x7c\x61\x43\xd5\xb3\x6b\x18\x07\x70\x8d\xc8\xcc\xea\xbc\xe8\x92\xd9\x69\xd9\xb0\xba\x28\xde\x86\xd3\x4c\xda\xc2\xab\xe9\x16\x0e\x76\x09\x0d\x65\x0a\x41\xaa\x1a\x2d\x6f\x95\x25\x84\xb3\x7f\x62\xd3\xe4\xa5\x56\xae\x2b\xdb\x04\x74\x4e\x43\xf2\x09\x33\xfb\xee\x5c\xa3\xcc\x71\x8d\x42\x89\x8d\xd2\xba\xc6\x90\xb5\x37\xc9\x8d\xaf\xd4\xd0\x79\x2a\x6e\x48\x24\xd4\x07\x6e\x99\x7c\x41\x0a\x43\xbd\x5c\x0b\x89\x6c\xe4\x0d\x50\x5b\xba\x73\xf1\x18\x34\x7a\xed\x8a\xc9\xdc\xd0\xd6\xce\x8d\xc2\xd7\x4e\x8c\x61\xb8\x2c\x8f\xe6\x0c\x7a\xed\x3f\x82\x5b\x4a\xf8\x12\x8f\x25\xd0\x92\xa5\x48\x81\x44\x9a\xad\xf1\x5f\x20\xc8\x1f\xa0\xe4\xaf\x66\xd1\xf8\x61\xa9\x3c\xeb\xa6\x07\xfc\x9a\xd5\x4a\xb7\xff\x6e\xce\x1b\xf8\x56\xc3\x6f\xc0\x39\x2b\xc8\xb3\x9e\x78\x04\x78\x74\xb4\x9f\x3f\xf7\xb6\xab\xed\x1c\xe7\x14\x53\xed\x56\xef\x63\x5a\xde\x4a\x27\x71\xd3\x99\x6a\xfb\x9d\x83\xe1\xb9\xc2\x60\x11\xe4\xd3\x87\x25\xdd\xee\xf0\x22\x13\xc5\x42\xe1\xd1\xa5\x0b\x6a\xc5\x49\x75\x31\x2b\x2b\x11\xd8\xed\x3f\x07\xf1\x7d\xf8\xa8\x89\xd4\x40\xe0\xe7\x7b\xc8\x52\x4a\xb4\xc9\x5e\x02\x4c\x7e\xb4\x59\xac\xfa\x5e\x24\x24\x52\xc1\x42\xc8\x47\x22\x29\x64\x5c\xb3\xd8\xac\x6f\x6c\x67\xb1\x2c\xfd\x14\xea\x7b\x13\xc5\xd6\x24\x6e\x9e\x5c\x02\x5f\x37\x1b\x5e\xdd\xe4\x8d\x96\x87\x24\x5a\x9d\x02\xda\x8c\x55\xd1\x0d\xe0\xbd\xbd\x02\x34\x5f\x37\xf5\x8a\xa9\x96\x47\xb4\x96\xcd\xc6\x81\x33\x34\x5a\xc6\xae\x9d\xda\x95\xac\xda\x3e\x3d\x38\x56\x2f\xe1\xd8\x17\xd3\x55\x21\x50\x82\x47\x4a\x35\x73\xbf\x6a\x5c\xd6\x70\x1f\xba\x55\xe3\x4f\x8d\xca\x50\xfb\xe3\xbd\x97\x23\x38\xcb\xc9\x01\xea\x86\x39\x65\x8d\x13\xf2\x84\xd2\x1b\x73\x7e\x9a\xce\x99\x93\x7e\xec\x1d\xad\x4a\xd9\x79\xbc\x7e\x51\xcb\x8c\x53\x7c\x7a\x4e\xc5\x8c\x36\x5a\x9e\xca\xc2\xbc\x6d\xd1\x1c\x54\x17\xb0\x12\xcc\x3a\xef\x71\x2a\x38\x29\x28\x0c\x89\xc3\xa2\xc2\x3d\x2a\x42\x5e\xc8\x1a\x05\xc9\x5c\xaa\xdd\xa5\x51\x78\xbb\x55\x75\x26\xef\x94\x29\xae\x98\x5a\x01\x81\x47\x0c\x95\x6d\x2b\x40\xe1\xef\xb6\x93\x93\x77\x6c\xde\x7e\xb8\xaf\x75\x6d\xaa\x13\xd1\xb4\xd8\xab\x4f\xb9\xce\xb5\x4c\xce\x7e\x3b\xf6\x59\x79\x55\x23\x25\x12\x89\xdf\xf1\x49\xca\xbc\xcf\xea\x27\xc1\x63\x41\x68\x70\xd2\xd1\xfb\x31\x2f\x0b\x03\x7c\x4a\x63\x16\x31\xed\x58\xa1\x88\xda\xf0\x08\x28\x2e\x50\xce\x6a\x4c\x14\x0d\x99\xa9\x9f\x7f\xfb\x34\xf5\xf3\x0f\x3a\xff\x37\x00\x00\xff\xff\x9e\xad\x18\xb9\xe1\x29\x00\x00") func faucetHtmlBytes() ([]byte, error) { return bindataRead( @@ -85,7 +84,7 @@ func faucetHtml() (*asset, error) { } info := bindataFileInfo{name: "faucet.html", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0x4d, 0x5d, 0x6d, 0x7f, 0xf1, 0x26, 0x19, 0x7, 0xee, 0xd2, 0xb3, 0x2, 0xdf, 0xd2, 0x8c, 0x36, 0x87, 0x8e, 0x17, 0x50, 0xb6, 0x8f, 0xb0, 0xb5, 0xce, 0x73, 0xcc, 0x24, 0xd3, 0xd6, 0x8e}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x52, 0x9f, 0x7a, 0x51, 0x16, 0x30, 0x5c, 0xd0, 0xef, 0xb1, 0xd6, 0xf2, 0xd6, 0xea, 0xe6, 0x6d, 0xd, 0xca, 0x7f, 0x57, 0x5b, 0xb7, 0x2c, 0xab, 0xe8, 0xca, 0x73, 0xa2, 0x0, 0xc9, 0xa9, 0x75}} return a, nil } @@ -190,11 +189,13 @@ const AssetDebug = false // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png +// +// data/ +// foo.txt +// img/ +// a.png +// b.png +// // then AssetDir("data") would return []string{"foo.txt", "img"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and @@ -244,7 +245,7 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + err = os.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index b1abc1221f..7a483a8fb4 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -454,8 +454,10 @@ func (p *Parlia) snapshot(chain consensus.ChainHeaderReader, number uint64, hash } } - // If we're at the genesis, snapshot the initial state. - if number == 0 { + // If we're at the genesis, snapshot the initial state. Alternatively if we have + // piled up more headers than allowed to be reorged (chain reinit from a freezer), + // consider the checkpoint trusted and snapshot it. + if number == 0 || (number%p.config.Epoch == 0 && (len(headers) > params.FullImmutabilityThreshold)) { checkpoint := chain.GetHeaderByNumber(number) if checkpoint != nil { // get checkpoint data @@ -891,6 +893,10 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res log.Info("Received block process finished, abort block seal") return case <-time.After(time.Duration(processBackOffTime) * time.Second): + if chain.CurrentHeader().Number.Uint64() >= header.Number.Uint64() { + log.Info("Process backoff time exhausted, and current header has updated to abort this seal") + return + } log.Info("Process backoff time exhausted, start to seal block") } } diff --git a/core/blockchain.go b/core/blockchain.go index b119270b99..b7838a7719 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1552,7 +1552,11 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types. bc.triegc.Push(root, number) break } - go triedb.Dereference(root.(common.Hash)) + wg.Add(1) + go func() { + triedb.Dereference(root.(common.Hash)) + wg.Done() + }() } } } diff --git a/core/state/statedb.go b/core/state/statedb.go index 617dbfa1b7..a89d7143d4 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -251,6 +251,7 @@ func (s *StateDB) StopPrefetcher() { s.prefetcherLock.Lock() if s.prefetcher != nil { s.prefetcher.close() + s.prefetcher = nil } s.prefetcherLock.Unlock() } diff --git a/eth/protocols/diff/handler_test.go b/eth/protocols/diff/handler_test.go index 5244687331..17af5a0012 100644 --- a/eth/protocols/diff/handler_test.go +++ b/eth/protocols/diff/handler_test.go @@ -134,9 +134,9 @@ func testGetDiffLayers(t *testing.T, protocol uint) { missDiffPackets := make([]FullDiffLayersPacket, 0) for i := 0; i < 100; i++ { - number := uint64(rand.Int63n(1024)) - if number == 0 { - continue + // Find a non 0 random number + var number uint64 + for ; number == 0; number = uint64(rand.Int63n(1024)) { } foundHash := backend.chain.GetCanonicalHash(number + 1024) missHash := backend.chain.GetCanonicalHash(number) diff --git a/go.mod b/go.mod index 8405c9661a..1f6561f4a7 100644 --- a/go.mod +++ b/go.mod @@ -74,6 +74,8 @@ require ( github.com/fatih/structs v1.1.0 ) +require github.com/yusufpapurcu/wmi v1.2.2 // indirect + require ( github.com/Azure/azure-pipeline-go v0.2.2 // indirect github.com/Azure/go-autorest/autorest/adal v0.8.0 // indirect @@ -111,7 +113,6 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect go.etcd.io/bbolt v1.3.7 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.5.0 // indirect diff --git a/go.sum b/go.sum index 5ce59554c8..e838e4df64 100644 --- a/go.sum +++ b/go.sum @@ -62,7 +62,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -101,18 +100,10 @@ github.com/bnb-chain/ics23 v0.1.0/go.mod h1:cU6lTGolbbLFsGCgceNB2AzplH1xecLp6+KX github.com/bnb-chain/tendermint v0.31.15 h1:Xyn/Hifb/7X4E1zSuMdnZdMSoM2Fx6cZuKCNnqIxbNU= github.com/bnb-chain/tendermint v0.31.15/go.mod h1:cmt8HHmQUSVaWQ/hoTefRxsh5X3ERaM1zCUIR0DPbFU= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= @@ -135,7 +126,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -322,13 +312,11 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -347,7 +335,6 @@ github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= @@ -414,11 +401,9 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -546,7 +531,6 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/miner/worker.go b/miner/worker.go index 37f458693e..9f4cce2988 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -666,20 +666,23 @@ func (w *worker) resultLoop() { w.recentMinedBlocks.Add(block.NumberU64(), []common.Hash{block.ParentHash()}) } - // Broadcast the block and announce chain insertion event - w.mux.Post(core.NewMinedBlockEvent{Block: block}) - // Commit block and state to database. task.state.SetExpectedStateRoot(block.Root()) start := time.Now() - _, err := w.chain.WriteBlockAndSetHead(block, receipts, logs, task.state, true) - if err != nil { - log.Error("Failed writing block to chain", "err", err) + status, err := w.chain.WriteBlockAndSetHead(block, receipts, logs, task.state, true) + if status != core.CanonStatTy { + if err != nil { + log.Error("Failed writing block to chain", "err", err, "status", status) + } else { + log.Info("Written block as SideChain and avoid broadcasting", "status", status) + } continue } writeBlockTimer.UpdateSince(start) log.Info("Successfully sealed new block", "number", block.Number(), "sealhash", sealhash, "hash", hash, "elapsed", common.PrettyDuration(time.Since(task.createdAt))) + // Broadcast the block and announce chain insertion event + w.mux.Post(core.NewMinedBlockEvent{Block: block}) // Insert the block into the set of pending ones to resultLoop for confirmations w.unconfirmed.Insert(block.NumberU64(), block.Hash()) diff --git a/node/config.go b/node/config.go index baa7a8f50d..b4f1378c8f 100644 --- a/node/config.go +++ b/node/config.go @@ -502,13 +502,13 @@ func (c *Config) warnOnce(w *bool, format string, args ...interface{}) { } type LogConfig struct { - FileRoot *string - FilePath *string - MaxBytesSize *uint - Level *string + FileRoot *string `toml:",omitempty"` + FilePath *string `toml:",omitempty"` + MaxBytesSize *uint `toml:",omitempty"` + Level *string `toml:",omitempty"` // TermTimeFormat is the time format used for console logging. - TermTimeFormat *string + TermTimeFormat *string `toml:",omitempty"` // TimeFormat is the time format used for file logging. - TimeFormat *string + TimeFormat *string `toml:",omitempty"` } diff --git a/params/version.go b/params/version.go index 5468e71e1d..4561af6570 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release - VersionPatch = 21 // Patch version component of the current release + VersionPatch = 22 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )