neoneo-go/pkg
Roman Khimov dfd4f6978f bigint: don't reallocate big.Int in ToBytes(), fix #2864
In some cases n.Add() can reuse the []Word buffer and n.Sub() reallocate it
away. If that happens, we're out of luck with 0.99.0+ versions (since
3945e81857). I'm not sure why it does that, bit
width doesn't change in most of the cases and even if it does, we still have
enough of it in cap() to hold the old Abs() value (when we have a negative
value we in fact decreate its Abs() first and increase it back
afterwards). Still, that's what we have.

So when we have processTokenTransfer() doing Neg/Neg in-place its value is not
affected, but the original []Word bits that are reused by amount value are
(they're shared initially, Amount: *amount).

name                   old time/op    new time/op    delta
ToPreallocatedBytes-8    65.8ns ± 2%    45.6ns ± 2%  -30.73%  (p=0.008 n=5+5)

name                   old alloc/op   new alloc/op   delta
ToPreallocatedBytes-8     0.00B          0.00B          ~     (all equal)

name                   old allocs/op  new allocs/op  delta
ToPreallocatedBytes-8      0.00           0.00          ~     (all equal)
2023-01-10 22:51:45 +03:00
..
compiler *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
config config: fix the default P2P ping settings 2022-12-07 21:29:40 +03:00
consensus config: add a special Blockchain type to configure Blockchain 2022-12-07 17:35:53 +03:00
core native: simplify code somewhat, get Metadata() only once 2022-12-16 23:48:04 +03:00
crypto *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
encoding bigint: don't reallocate big.Int in ToBytes(), fix #2864 2023-01-10 22:51:45 +03:00
interop interop: add getContractByID and getContractHashes to management 2022-12-02 10:54:45 +03:00
io *: fix Neo and NeoGo misuses 2022-12-07 17:29:09 +03:00
neorpc result: drop Version (un)marshaler, we only need it for Protocol 2022-11-10 17:51:02 +03:00
neotest config: replace VerifyBlocks with SkipBlockVerification 2022-12-07 17:35:56 +03:00
network network: do not allow to request invalid block count 2022-12-28 13:04:56 +03:00
rpcclient rpcclient: fix filtered naive subscriptions receiver 2022-12-07 16:56:16 +03:00
services Merge pull request #2842 from nspcc-dev/stringer 2022-12-13 22:12:18 +07:00
smartcontract Merge pull request #2828 from nspcc-dev/rpcwrapper-structures 2022-12-06 21:40:16 +07:00
util slice: add Clean microfunction 2022-09-02 14:44:32 +03:00
vm vm: add fuzz test for ParseMultiSigContract 2022-12-28 11:50:15 +03:00
wallet Merge pull request #2725 from nspcc-dev/move-cli-tests 2022-10-06 13:43:39 +07:00