neo-go/pkg/network
Roman Khimov 55b2cbb74d core: refactor and improve verification and pooling
Now we have VerifyTx() and PoolTx() APIs that either verify transaction in
isolation or verify it against the mempool (either the primary one or the one
given) and then add it there. There is no possibility to check against the
mempool, but not add a transaction to it, but I doubt we really need it.

It allows to remove some duplication between old PoolTx and verifyTx where
they both tried to check transaction against mempool (verifying first and then
adding it). It also saves us utility token balance check because it's done by
the mempool anyway and we no longer need to do that explicitly in verifyTx.

It makes AddBlock() and verifyBlock() transaction's checks more correct,
because previously they could miss that even though sender S has enough
balance to pay for A, B or C, he can't pay for all of them.

Caveats:
 * consensus is running concurrently to other processes, so things could
   change while verifyBlock() is iterating over transactions, this will be
   mitigated in subsequent commits

Improves TPS value for single node by at least 11%.

Fixes #667, fixes #668.
2020-08-20 18:50:18 +03:00
..
capability capability: prevent panic on wrong capabilities receival 2020-05-29 00:11:54 +03:00
metrics cli,pkg: use zap.Logger 2020-01-10 11:14:27 +03:00
payload remove github.com/pkg/errors from dependencies 2020-08-07 12:21:52 +03:00
blockqueue.go network: correct block addition check 2020-08-10 16:51:56 +03:00
blockqueue_test.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
compress.go network: handle length mismatch in decompression routine 2020-08-03 22:38:55 +03:00
discovery.go protocol: add capabilities to address payload 2020-05-27 19:02:25 +03:00
discovery_test.go protocol: add capabilities to address payload 2020-05-27 19:02:25 +03:00
helper_test.go core: refactor and improve verification and pooling 2020-08-20 18:50:18 +03:00
message.go network: decode CMDNotFound 2020-08-18 14:24:27 +03:00
message_string.go network: rename GetBlockData command 2020-08-04 17:52:34 +03:00
message_test.go network: remove outdated fields 2020-05-27 19:32:50 +03:00
peer.go network: request blocks when there is a ping with bigger than ours height 2020-08-14 16:22:15 +03:00
prometheus.go monitoring: add prometheus monitoring 2019-10-29 20:51:17 +03:00
relay_reason.go fix spelling and godoc comments 2019-10-22 17:56:03 +03:00
server.go network: don't request block we already have 2020-08-14 16:25:13 +03:00
server_config.go *: move wallet config from wallet to config package 2020-06-29 09:15:29 +03:00
server_test.go core, network: request blocks instead of headers 2020-08-04 17:52:34 +03:00
tcp_peer.go network: request blocks when there is a ping with bigger than ours height 2020-08-14 16:22:15 +03:00
tcp_peer_test.go protocol: add capabilities to version payload 2020-05-27 19:01:14 +03:00
tcp_transport.go protocol: add capabilities to version payload 2020-05-27 19:01:14 +03:00
transport.go protocol: add capabilities to version payload 2020-05-27 19:01:14 +03:00