diff --git a/.github/workflows/packager.yml b/.github/workflows/packager.yml index a898ce7c2b..f2aef42485 100644 --- a/.github/workflows/packager.yml +++ b/.github/workflows/packager.yml @@ -47,7 +47,7 @@ jobs: run: cp -rp packaging/deb/bor packaging/deb/bor-${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: amd64 - + - name: Running package build run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.GIT_TAG }}-${{ env.ARCH }} env: @@ -366,7 +366,7 @@ jobs: ARCH: amd64 NODE: archive NETWORK: mainnet - - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile + - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.NETWORK }}-${{ env.NODE }}-config_${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: amd64 @@ -519,7 +519,7 @@ jobs: ARCH: arm64 NODE: sentry NETWORK: mainnet - - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile + - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.NETWORK }}-${{ env.NODE }}-config_${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: arm64 @@ -629,13 +629,13 @@ jobs: ARCH: arm64 NODE: validator NETWORK: mainnet - - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile + - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.NETWORK }}-${{ env.NODE }}-config_${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: arm64 NODE: validator NETWORK: mainnet - + - name: Updating the control file to use with the arm64 profile run: cp -rp packaging/templates/package_scripts/control.profile.arm64 packaging/deb/bor/DEBIAN/control @@ -675,7 +675,7 @@ jobs: ARCH: arm64 NODE: archive NETWORK: mumbai - - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile + - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.NETWORK }}-${{ env.NODE }}-config_${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: arm64 @@ -718,7 +718,7 @@ jobs: ARCH: arm64 NODE: archive NETWORK: mainnet - - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile + - name: Building bor ${{ env.NODE }} on ${{ env.NETWORK }} on ${{ env.ARCH }} profile run: dpkg-deb --build --root-owner-group packaging/deb/bor-${{ env.NETWORK }}-${{ env.NODE }}-config_${{ env.GIT_TAG }}-${{ env.ARCH }} env: ARCH: arm64 diff --git a/Makefile b/Makefile index 0527284aa8..eb9c734af0 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) $(GO_LDFLAGS) -p 1 bor: mkdir -p $(GOPATH)/bin/ - go build -o $(GOBIN)/bor $(GO_LDFLAGS) ./cmd/cli/main.go + go build -o $(GOBIN)/bor $(GO_LDFLAGS) ./cmd/cli/main.go cp $(GOBIN)/bor $(GOPATH)/bin/ @echo "Done building." diff --git a/docs/cli/bootnode.md b/docs/cli/bootnode.md index e4111160a0..465eadd9ff 100644 --- a/docs/cli/bootnode.md +++ b/docs/cli/bootnode.md @@ -16,4 +16,4 @@ - ```save-key```: path to save the ecdsa private key -- ```dry-run```: validates parameters and prints bootnode configurations, but does not start bootnode (default: false) \ No newline at end of file +- ```dry-run```: validates parameters and prints bootnode configurations, but does not start bootnode (default: false) diff --git a/docs/cli/debug_pprof.md b/docs/cli/debug_pprof.md index 78e75f2134..fbc9a70c52 100644 --- a/docs/cli/debug_pprof.md +++ b/docs/cli/debug_pprof.md @@ -10,4 +10,4 @@ The ```debug pprof ``` command will create an archive containing bor ppro - ```output```: Output directory -- ```skiptrace```: Skip running the trace (default: false) \ No newline at end of file +- ```skiptrace```: Skip running the trace (default: false) diff --git a/docs/cli/example_config.toml b/docs/cli/example_config.toml index a43901c5d2..f62fcfebdb 100644 --- a/docs/cli/example_config.toml +++ b/docs/cli/example_config.toml @@ -35,9 +35,9 @@ devfakeauthor = false # Run miner without validator set authorization port = 30303 # Network listening port nodiscover = false # Disables the peer discovery mechanism (manual peer addition) nat = "any" # NAT port mapping mechanism (any|none|upnp|pmp|extip:) - netrestrict = "" # Restricts network communication to the given IP networks (CIDR masks) - nodekey = "" # P2P node key file - nodekeyhex = "" # P2P node key as hex + netrestrict = "" # Restricts network communication to the given IP networks (CIDR masks) + nodekey = "" # P2P node key file + nodekeyhex = "" # P2P node key as hex txarrivalwait = "500ms" # Maximum duration to wait before requesting an announced transaction [p2p.discovery] v5disc = false # Enables the experimental RLPx V5 (Topic Discovery) mechanism @@ -130,7 +130,7 @@ devfakeauthor = false # Run miner without validator set authorization metrics = false # Enable metrics collection and reporting expensive = false # Enable expensive metrics collection and reporting prometheus-addr = "127.0.0.1:7071" # Address for Prometheus Server - opencollector-endpoint = "" # OpenCollector Endpoint (host:port) + opencollector-endpoint = "" # OpenCollector Endpoint (host:port) [telemetry.influx] influxdb = false # Enable metrics export/push to an external InfluxDB database (v1) endpoint = "" # InfluxDB API endpoint to report metrics to diff --git a/docs/cli/server.md b/docs/cli/server.md index 4869e0ef17..d7a9a1296e 100644 --- a/docs/cli/server.md +++ b/docs/cli/server.md @@ -258,7 +258,7 @@ The ```bor server``` command runs the Bor client. - ```metrics.prometheus-addr```: Address for Prometheus Server (default: 127.0.0.1:7071) -- ```metrics.opencollector-endpoint```: OpenCollector Endpoint (host:port) +- ```metrics.opencollector-endpoint```: OpenCollector Endpoint (host:port) (default: 127.0.0.1:4317) - ```metrics.influxdbv2```: Enable metrics export/push to an external InfluxDB v2 database (default: false) @@ -290,4 +290,4 @@ The ```bor server``` command runs the Bor client. - ```txpool.globalqueue```: Maximum number of non-executable transaction slots for all accounts (default: 32768) -- ```txpool.lifetime```: Maximum amount of time non-executable transaction are queued (default: 3h0m0s) \ No newline at end of file +- ```txpool.lifetime```: Maximum amount of time non-executable transaction are queued (default: 3h0m0s) diff --git a/go.sum b/go.sum index 99639bfeb0..99084176ed 100644 --- a/go.sum +++ b/go.sum @@ -149,6 +149,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.1.3 h1:xM/n3yIhHAhHy04z4i43C8p4ehixJZMsnrVJkgl+MTE= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -323,6 +324,7 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 8904e64810..5cf3d3064b 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -129,6 +129,7 @@ type Config struct { // ParallelEVM has the parallel evm related settings ParallelEVM *ParallelEVMConfig `hcl:"parallelevm,block" toml:"parallelevm,block"` + // Develop Fake Author mode to produce blocks without authorisation DevFakeAuthor bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"` @@ -311,9 +312,10 @@ type SealerConfig struct { GasPriceRaw string `hcl:"gasprice,optional" toml:"gasprice,optional"` // The time interval for miner to re-create mining work. - Recommit time.Duration `hcl:"-,optional" toml:"-"` - RecommitRaw string `hcl:"recommit,optional" toml:"recommit,optional"` - CommitInterruptFlag bool `hcl:"commitinterrupt,optional" toml:"commitinterrupt,optional"` + Recommit time.Duration `hcl:"-,optional" toml:"-"` + RecommitRaw string `hcl:"recommit,optional" toml:"recommit,optional"` + + CommitInterruptFlag bool `hcl:"commitinterrupt,optional" toml:"commitinterrupt,optional"` } type JsonRPCConfig struct { diff --git a/miner/fake_miner.go b/miner/fake_miner.go index b33ae1e05a..3176994a4e 100644 --- a/miner/fake_miner.go +++ b/miner/fake_miner.go @@ -212,7 +212,7 @@ var ( // Test accounts testBankKey, _ = crypto.GenerateKey() TestBankAddress = crypto.PubkeyToAddress(testBankKey.PublicKey) - testBankFunds = big.NewInt(8000000000000000000) + testBankFunds = big.NewInt(9000000000000000000) testUserKey, _ = crypto.GenerateKey() testUserAddress = crypto.PubkeyToAddress(testUserKey.PublicKey) diff --git a/miner/test_backend.go b/miner/test_backend.go index 26489accff..a0d04c7923 100644 --- a/miner/test_backend.go +++ b/miner/test_backend.go @@ -421,27 +421,13 @@ func (w *worker) mainLoopWithDelay(ctx context.Context, delay uint, opcodeDelay txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs, cmath.FromBig(w.current.header.BaseFee)) tcount := w.current.tcount - var interruptCtx = context.Background() - stopFn := func() {} - defer func() { - stopFn() - }() - - if w.interruptCommitFlag { - interruptCtx, stopFn = getInterruptTimer(ctx, w.current, w.chain.CurrentBlock()) - // nolint : staticcheck - interruptCtx = vm.PutCache(interruptCtx, w.interruptedTxCache) - } - - w.commitTransactionsWithDelay(w.current, txset, nil, interruptCtx) + w.commitTransactions(w.current, txset, nil, context.Background()) // Only update the snapshot if any new transactions were added // to the pending block if tcount != w.current.tcount { w.updateSnapshot(w.current) } - - stopFn() } else { // Special case, if the consensus engine is 0 period clique(dev mode), // submit sealing work here since all empty submission will be rejected @@ -497,7 +483,7 @@ func (w *worker) commitWorkWithDelay(ctx context.Context, interrupt *int32, noem return } - // nolint : contextcheck + //nolint:contextcheck var interruptCtx = context.Background() stopFn := func() {} diff --git a/miner/worker.go b/miner/worker.go index f546b37029..219322362a 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1627,7 +1627,7 @@ func (w *worker) commitWork(ctx context.Context, interrupt *int32, noempty bool, return } - // nolint : contextcheck + // nolint:contextcheck var interruptCtx = context.Background() stopFn := func() {} diff --git a/miner/worker_test.go b/miner/worker_test.go index 8edd40996a..81743dd59d 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -793,11 +793,6 @@ func BenchmarkBorMining(b *testing.B) { chain, _ := core.NewBlockChain(db2, nil, back.chain.Config(), engine, vm.Config{}, nil, nil, nil) defer chain.Stop() - // Ignore empty commit here for less noise. - w.skipSealHook = func(task *task) bool { - return len(task.receipts) == 0 - } - // fulfill tx pool const ( totalGas = testGas + params.TxGas diff --git a/params/version.go b/params/version.go index 7f99ac828a..178c503e94 100644 --- a/params/version.go +++ b/params/version.go @@ -43,7 +43,7 @@ var VersionWithMeta = func() string { return v }() -// VersionWithMetaCommitDetails holds the textual version string including the metadata and Git Details. +// VersionWithCommitDetails holds the textual version string including the metadata and Git Details. var VersionWithMetaCommitDetails = func() string { v := Version if VersionMeta != "" {