Evgeniy Stratonikov
4dd3a0d503
network: request headers in parallel, fix #2158
...
Do this similarly to how blocks are requested.
See also 4aa1a37
.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-10-06 15:25:54 +03:00
Anna Shaleva
b3ea7504cb
subscriptions: add container hash to notification event
...
External users make use of it. Close #2190 .
2021-09-24 17:42:02 +03:00
Anna Shaleva
6357af0bb0
network: fix race in TestHandleGetMPTData
...
Init server config before server start. Fixes the following data race:
```
WARNING: DATA RACE
Write at 0x00c00032ef20 by goroutine 26:
github.com/nspcc-dev/neo-go/pkg/network.TestHandleGetMPTData.func2()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:755 +0x10a
testing.tRunner()
/usr/local/go/src/testing/testing.go:1193 +0x202
Previous read at 0x00c00032ef20 by goroutine 24:
github.com/nspcc-dev/neo-go/internal/fakechain.(*FakeChain).GetConfig()
/go/src/github.com/nspcc-dev/neo-go/internal/fakechain/fakechain.go:167 +0x6f
github.com/nspcc-dev/neo-go/pkg/network.(*Server).initStaleMemPools()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server.go:1433 +0x89
github.com/nspcc-dev/neo-go/pkg/network.(*Server).Start()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server.go:284 +0x288
github.com/nspcc-dev/neo-go/pkg/network.startWithChannel.func1()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:91 +0x44
Goroutine 26 (running) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:1238 +0x5d7
github.com/nspcc-dev/neo-go/pkg/network.TestHandleGetMPTData()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:752 +0x8c
testing.tRunner()
/usr/local/go/src/testing/testing.go:1193 +0x202
Goroutine 24 (running) created at:
github.com/nspcc-dev/neo-go/pkg/network.startWithChannel()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:90 +0x78
github.com/nspcc-dev/neo-go/pkg/network.startTestServer()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:384 +0xbd
github.com/nspcc-dev/neo-go/pkg/network.TestHandleGetMPTData.func2()
/go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:753 +0x55
testing.tRunner()
/usr/local/go/src/testing/testing.go:1193 +0x202
```
2021-09-13 11:45:48 +03:00
Anna Shaleva
0fa48691f7
network: do not duplicate MPT nodes in GetMPTNodes response
...
Also tests are added.
2021-09-08 14:25:54 +03:00
Anna Shaleva
0e0b55350a
core: convert (*Blockchain).JumpToState to a callback
...
We don't need this method to be exposed, the only its user is the
StateSync module. At the same time StateSync module manages its state by
itself which guarantees that (*Blockchain).jumpToState will be called
with proper StateSync stage.
2021-09-07 19:43:27 +03:00
Anna Shaleva
3b7807e897
network: request unknown MPT nodes
...
In this commit:
1. Request unknown MPT nodes from peers. Note, that StateSync module itself
shouldn't be responsible for nodes requests, that's a server duty.
2. Do not request the same node twice, check if it is in storage
already. If so, then the only thing remaining is to update refcounter.
2021-09-07 19:43:27 +03:00
Anna Shaleva
d67ff30704
core: implement statesync module
...
And support GetMPTData and MPTData P2P commands.
2021-09-07 19:43:27 +03:00
Anna Shaleva
e8bed184d5
core: implement dynamic NEP17 balances tracking
...
Request NEP17 balances from a set of NEP17 contracts instead of getting
them from storage. LastUpdatedBlock tracking remains untouched, because
there's no way to retrieve it dynamically.
2021-07-29 10:23:01 +03:00
Anna Shaleva
e46d76d7aa
core: rename state.NEP17Balances to state.NEP17TransferInfo
...
Balances are to be removed from state.NEP17TransferInfo, so the remnant
fields are NextTransferBatch, NewBatch and a map of LastUpdatedBlocks.
These fields are more staff-related.
Also rename dao.[Get, Put, put]NEP17Balances and STNEP17Balances
preffix.
Also rename NEP17TransferInfo.Trackers to LastUpdatedBlockTrackers
because NEP17TransferInfo.Balances are to be removed.
2021-07-28 13:22:53 +03:00
Roman Khimov
aab18c3083
stackitem: introduce Convertible interface
...
We have a lot of native contract types that are converted to stack items
before serialization, then deserialized as stack items and converted back to
regular structures. stackitem.Convertible allows to remove a lot of repetitive
io.Serializable code.
This also introduces to/from converter in testserdes which unfortunately
required to change util tests to avoid circular references.
2021-07-19 15:42:42 +03:00
Evgeniy Stratonikov
4467e2cbfd
cli,compiler: allow to specify manifest permissions
2021-06-04 11:16:22 +03:00
Roman Khimov
c4e084b0d8
*: fix whitespace errors
...
leading/trailing newlines
2021-05-12 22:51:41 +03:00
Anna Shaleva
366e79b9b8
core: rename Neo.Crypto.CheckSig interop
2021-05-11 18:37:55 +03:00
Anna Shaleva
ae36523a61
rpc, internal: fix CodeQL int conversions warnings
...
```
Incorrect conversion of an integer with architecture-dependent bit
size from to a lower bit size type int32 without an upper bound
check.
```
2021-04-19 11:30:28 +03:00
Roman Khimov
95c279325a
block: drop Network from the Header
...
It's not network-tied any more, network is only needed to
sign/verify. Unfortunately we still have to keep network in consensus data
structures because of dbft library interface.
2021-03-26 13:45:18 +03:00
Roman Khimov
d314f82db3
transaction: drop Network from Transaction
...
We only need it when signing/verifying.
2021-03-26 13:45:18 +03:00
Roman Khimov
df12adaa9e
crypto: remove crypto.Verifiable interface
...
We can now verify any hash.Hashable thing.
2021-03-26 13:45:18 +03:00
Anna Shaleva
0a5072a1da
core: allow to compile test contracts with yaml config
...
And refactored Rubl test contract (it should support NEP-17 and
onNEP17Payment).
2021-03-22 15:32:26 +03:00
Anna Shaleva
1261dd5306
core: refactor initVerificationVM
...
It needs only VM and function to get contract state. Also exposed this
method and extended Blockchainer. These changes are needed for the
next commit.
2021-03-12 18:55:27 +03:00
Anna Shaleva
cdaca7be3e
core: use Neo.Crypto.CheckSig for standard signature verification
2021-03-10 21:45:58 +03:00
Evgeniy Stratonikov
f83b376181
block: replace Base
with Header
2021-03-10 13:38:44 +03:00
Evgeniy Stratonikov
2f490a3403
block: remove ConsensusData
field
2021-03-10 13:38:44 +03:00
Evgeniy Stratonikov
ac227a80fe
stateroot: use RoleStateValidator for verification
2021-03-09 13:51:10 +03:00
Evgeniy Stratonikov
bf20db09e0
stateroot: move state-root related logic to core/stateroot
2021-03-09 13:48:29 +03:00
Evgeniy Stratonikov
55698d0426
dao: use raw state.StorageItem
instead of pointer
...
It is now a slice, there is no need for additional indirection.
2021-03-09 12:11:25 +03:00
Evgeniy Stratonikov
ffd85dd51d
native/policy: remove MaxBlockSize and MaxBlockSystemFee
2021-03-04 16:59:19 +03:00
Evgeniy Stratonikov
f0d8652bcd
rpc: implement getnativecontracts
RPC
2021-02-11 12:27:43 +03:00
Anna Shaleva
260bcd373c
core: store initial native values into DAO
2021-02-05 10:43:17 +03:00
Anna Shaleva
4ad9c7929b
internals: move testchain from network to internals
...
It'll be useful for tests outside of the network pkg.
2021-02-02 22:01:32 +03:00
Roman Khimov
054ca27e9c
state: use checksums and names to calculate contract hashes
...
It allows to deploy the same NEF using one sender and get different contract
hashes. See neo-project/neo#2240 .
2021-01-22 12:22:48 +03:00
Evgeniy Stratonikov
24d9a31476
testchain: support signing tx by committee
2021-01-21 14:51:15 +03:00
Evgenii Stratonikov
1c0c331e25
core: update System.Contract.Call
syscall
...
1. Remove `System.Contract.CallEx`.
2. Extend number of parameters.
3. Add return value count to `VM.Context`.
2021-01-14 18:23:36 +03:00
Roman Khimov
459ad521ab
*: fix misspellings spotted by goreportcard
2020-12-28 17:27:04 +03:00
Evgenii Stratonikov
1840c1c80d
core: redefine opcode prices
...
Prices are defined in as a coefficients to `BaseExecFee` which
is defined by Policy contract (TBD later).
Native method prices are defined without need to multiply.
2020-12-16 13:55:39 +03:00
Evgenii Stratonikov
5310c7f3ce
native: fix NEP17.Transfer
cost
...
It was increased with the introducion of `postTransfer`.
2020-12-15 12:04:10 +03:00
Roman Khimov
ab12eee346
native: move contract deployment to management contract
...
See neo-project/neo#2119 .
2020-12-14 15:23:46 +03:00
Evgenii Stratonikov
9fd8577dd9
compiler: use Options
in ConvertToManifest()
2020-12-10 17:43:25 +03:00
Roman Khimov
470e1592d9
request: make CreateDeploymentScript work with NEFs
...
And use it in testing code.
2020-11-27 21:53:39 +03:00
Roman Khimov
1cf1fe5d74
*: introduce stable contract hashes
...
Follow neo-project/neo#2044 .
2020-11-27 21:47:08 +03:00
Evgenii Stratonikov
67f26859a8
scripts: implement script for creating dumps
...
This is useful for creating dumps providing various load
to benchmark restore or check compatibility with C# nodes.
Related #1472 .
2020-11-24 16:47:33 +03:00
Evgenii Stratonikov
7d91a3a89e
pkg: move internal/ package to the root directory
...
This way we can use it in scripts and cli.
2020-11-24 16:39:56 +03:00