[project] Unused yaml files, staticcheck fixes, dead tests that only delay build (#2755)
* [project] Unused yaml files * [core] Remove dead tx_cacher.go * [project] Further fixes from staticcheckpull/2758/head
parent
a7b79616e2
commit
094a61301d
@ -1,2 +0,0 @@ |
||||
repo_token: cr4Aim5IFC8A7IvStlMHQbVMRvBhRq0YH |
||||
|
@ -1,22 +0,0 @@ |
||||
version: 0.0 |
||||
os: linux |
||||
files: |
||||
- source: / |
||||
destination: /home/ec2-user/projects/src/harmony |
||||
hooks: |
||||
BeforeInstall: |
||||
- location: aws-scripts/say_hello.sh |
||||
timeout: 10 |
||||
runas: root |
||||
AfterInstall: |
||||
- location: aws-scripts/setup.sh |
||||
timeout: 300 |
||||
runas: root |
||||
ApplicationStart: |
||||
- location: aws-scripts/run_instance.sh |
||||
timeout: 300 |
||||
runas: root |
||||
ApplicationStop: |
||||
- location: aws-scripts/say_bye.sh |
||||
timeout: 10 |
||||
runas: root |
@ -1,63 +0,0 @@ |
||||
// Copyright 2018 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package core |
||||
|
||||
import ( |
||||
"github.com/ethereum/go-ethereum/core/types" |
||||
) |
||||
|
||||
// txSenderCacherRequest is a request for recovering transaction senders with a
|
||||
// specific signature scheme and caching it into the transactions themselves.
|
||||
//
|
||||
// The inc field defines the number of transactions to skip after each recovery,
|
||||
// which is used to feed the same underlying input array to different threads but
|
||||
// ensure they process the early transactions fast.
|
||||
type txSenderCacherRequest struct { |
||||
signer types.Signer |
||||
txs []*types.Transaction |
||||
inc int |
||||
} |
||||
|
||||
// txSenderCacher is a helper structure to concurrently ecrecover transaction
|
||||
// senders from digital signatures on background threads.
|
||||
type txSenderCacher struct { |
||||
threads int |
||||
tasks chan *txSenderCacherRequest |
||||
} |
||||
|
||||
// newTxSenderCacher creates a new transaction sender background cacher and starts
|
||||
// as many processing goroutines as allowed by the GOMAXPROCS on construction.
|
||||
func newTxSenderCacher(threads int) *txSenderCacher { |
||||
cacher := &txSenderCacher{ |
||||
tasks: make(chan *txSenderCacherRequest, threads), |
||||
threads: threads, |
||||
} |
||||
for i := 0; i < threads; i++ { |
||||
go cacher.cache() |
||||
} |
||||
return cacher |
||||
} |
||||
|
||||
// cache is an infinite loop, caching transaction senders from various forms of
|
||||
// data structures.
|
||||
func (cacher *txSenderCacher) cache() { |
||||
for task := range cacher.tasks { |
||||
for i := 0; i < len(task.txs); i += task.inc { |
||||
types.Sender(task.signer, task.txs[i]) |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue