Commit graph

6403 commits

Author SHA1 Message Date
Roman Khimov
e72a8bbecd network: decode CMDGetData the same way as CMDInv
As they're the same wrt the payload.
2019-08-30 13:14:12 +03:00
Roman Khimov
db39149b3d _pkg.dev: drop mgetaddr "implementation"
It has no real payload, so all of this is just useless.
2019-08-30 11:46:39 +03:00
Roman Khimov
45d94ee8c6 _pkg.dev: drop mblock wrapper
No use for us.
2019-08-30 11:42:25 +03:00
Roman Khimov
17679c3b94 core: add block test from dev branch
And drop it from _pkg.dev. Adapted for master.
2019-08-30 11:41:10 +03:00
Roman Khimov
683424cce8 transaction: implement proper Size() everywhere
Will be needed for the block test from `dev`.
2019-08-30 11:41:10 +03:00
Roman Khimov
200cce9f02 transaction: fix Size() calculation for attribute
It wasn't accounting for attr.Data length properly.
2019-08-30 11:41:10 +03:00
Roman Khimov
8ececdc9a7 transaction: fix invocation decoding for different versions
Quick fix similar to abc5833853 + uncomment the
test case for it.

Closes #173.
2019-08-30 11:41:10 +03:00
Roman Khimov
2ef2c0b84c transaction: properly print number in attribute log msg 2019-08-30 11:41:10 +03:00
Roman Khimov
c093f070d3 core: add EncodeBinary() support for the block 2019-08-30 11:41:10 +03:00
Roman Khimov
0ff38e9645 _pkg.dev: drop blockbase from payload
Duplicated in core.
2019-08-30 11:41:10 +03:00
Roman Khimov
e03eac9dcc payload: move one test from dev for inventory
And drop it from the _pkg.dev.
2019-08-30 11:41:10 +03:00
Roman Khimov
6cf74e2d83 payload: fix wrong stringer impl for InventoryType 2019-08-30 11:41:10 +03:00
Roman Khimov
f636bb9b6e payload: extend headers test, add limit
... from _pkg.dev and drop headers parsing there.
2019-08-30 11:41:10 +03:00
Vsevolod
5979bcf4b6
Merge pull request #325 from nspcc-dev/origin/fix_config_cli
Fix config for neo go cli
2019-08-30 11:40:58 +03:00
Vsevolod Brekelov
b43b4497cc Fix config for RPC port and default configPath 2019-08-30 11:22:11 +03:00
Vsevolod Brekelov
223084925a Fix for node run in docker introduced in a3890910f2 2019-08-30 11:21:39 +03:00
Roman Khimov
01e2f32e47 _pkg.dev: drop mgetheaders from payload
Refs. #307.
2019-08-29 21:23:57 +03:00
Roman Khimov
2d94a1e337 network: add getblocks message parsing
It has identical structure to the `getheaders`.
2019-08-29 21:23:57 +03:00
Roman Khimov
b5813efb29 _pkg.dev: drop mgetblocks code 2019-08-29 21:23:57 +03:00
Roman Khimov
9d8024a9dd _pkg.dev: drop address payload implementation
Refs. #307.
2019-08-29 21:23:57 +03:00
Roman Khimov
01c96fbc50 payload: improve address test
Check that the structure has proper values stored.
2019-08-29 21:23:57 +03:00
Roman Khimov
26eee620ec _pkg.dev: drop version from payload
Nothing new for us here.
2019-08-29 21:23:57 +03:00
Roman Khimov
650a1d4bcc payload: expand version test with explicit data checks 2019-08-29 21:23:57 +03:00
Roman Khimov
2e3172f8a5 payload: fix tests to use asserts
Like in 483b875f4a.
2019-08-29 21:23:57 +03:00
Roman Khimov
c949d2ec53 payload: fix Size() calculation for version
UserAgent is variable-length-encoded. Fix associated test.
2019-08-29 21:23:57 +03:00
Roman Khimov
fac87c7b87
Merge pull request #320 from nspcc-dev/origin/fix_decodeTX_179
Fix Decode PublishTX bug, closes #179.
2019-08-29 19:18:19 +03:00
Vsevolod Brekelov
abc5833853 transaction: add version check for publish
-Version check done before reading NeedStorage flag
-Add testify according to review
2019-08-29 19:14:22 +03:00
Roman Khimov
0f4a6a7830
Merge pull request #327 from nspcc-dev/circleci-binary-artifact
circleci: add artifact store for the binary
2019-08-29 19:12:43 +03:00
Roman Khimov
1af46d6637 circleci: add artifact store for the binary 2019-08-29 18:51:27 +03:00
Roman Khimov
e93a2192b1
Merge pull request #324 from nspcc-dev/fix-circleci-workflow-version
Fix CircleCI workflows to work and Docker image to build in CircleCI.
2019-08-29 16:17:57 +03:00
Roman Khimov
ed6075e4ba Dockerfile: use gomod to fix build failures
---> Running in 0e7bb4ca4583
+ export 'GOGC=off'
+ export 'GO111MODULE=on'
+ export 'CGO_ENABLED=0'
+ export 'LDFLAGS=-X /config.Version=0.5.0-pre-40-gb8ad012'
+ go build -v '-mod=vendor' -ldflags '-X /config.Version=0.5.0-pre-40-gb8ad012' -o /go/bin/neo-go ./cli/main.go
build command-line-arguments: cannot load github.com/go-redis/redis: open /neo-go/vendor/github.com/go-redis/redis: no such file or directory
The command '/bin/sh -c set -x     && export GOGC=off     && export GO111MODULE=on     && export CGO_ENABLED=0     && export LDFLAGS="-X ${REPO}/config.Version=${VERSION}"     && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli/main.go' returned a non-zero code: 1
make: *** [Makefile:19: image] Error 1
Exited with code 2
2019-08-29 16:13:32 +03:00
Roman Khimov
b8ad0125b6 Dockerfile: add GO111MODULE export
Maybe fixes this one:
 ---> Running in 3b964b007f22
+ export 'GOGC=off'
+ export 'CGO_ENABLED=0'
+ export 'LDFLAGS=-X /config.Version=0.5.0-pre-39-ga168f09'
+ go build -v '-mod=vendor' -ldflags '-X /config.Version=0.5.0-pre-39-ga168f09' -o /go/bin/neo-go ./cli/main.go
build command-line-arguments: cannot load github.com/go-redis/redis: open /neo-go/vendor/github.com/go-redis/redis: no such file or directory
The command '/bin/sh -c set -x     && export GOGC=off     && export CGO_ENABLED=0     && export LDFLAGS="-X ${REPO}/config.Version=${VERSION}"     && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli/main.go' returned a non-zero code: 1
make: *** [Makefile:19: image] Error 1
2019-08-29 16:10:28 +03:00
Roman Khimov
a168f09ac4 Makefile: drop deps from image dependencies
Docker builds shouldn't run go here to avoid CircleCI failures like this:

make: go: Command not found
make: *** [Makefile:32: deps] Error 127
Exited with code 2
2019-08-29 16:07:33 +03:00
Roman Khimov
a3890910f2 Dockerfile: use neo-go for binary name
Be consistent with Makefile (see 3dfb1189f2).
2019-08-29 16:07:33 +03:00
Roman Khimov
6964d86347 circleci: fix make target name for Docker image 2019-08-29 15:48:05 +03:00
Roman Khimov
1871040de6 circleci: fix workflow version
Only version 2 is supported at the moment as per
https://circleci.com/docs/2.0/configuration-reference/#version-1

Not to confuse with top-level version which really can be 2.1.
2019-08-29 15:44:39 +03:00
Roman Khimov
c6d7ef2de4
Merge pull request #322 from nspcc-dev/drop-redundant-dev-code-part-3
Drop redundant dev code part 3, refs. #307, #315 and #318.
2019-08-29 15:04:05 +03:00
Roman Khimov
4f23117d32 payload: fix wrong useragent parsing in version
C# code reads is as a proper variable-length string, so it's not limited to
252 bytes.
2019-08-29 13:42:16 +03:00
Roman Khimov
7b46f9bb86 util: add error check to Read/WriteVarUint
Fixes possibility of bogus reads/writes. Suggested by @im-kulikov.
2019-08-29 13:26:03 +03:00
Vsevolod
27558c89f7
Merge pull request #323 from nspcc-dev/make-config-fixes
Make & config fixes
2019-08-29 13:23:09 +03:00
Roman Khimov
6647317680 config: drop BuildTime support, make builds reproducible
Nobody cares, really. But we care about build being reproducible, one source
tree corresponds to one binary with one checksum.
2019-08-28 22:09:36 +03:00
Roman Khimov
3dfb1189f2 Makefile: fix binary name to be consistent
And return back to using `neo-go` as the binary name because it's not just a
node implementation, neo-go is capable of much more functionality.
2019-08-28 22:05:55 +03:00
Roman Khimov
15311f202b util: drop io, reuse its tests for binaryRW 2019-08-28 19:45:17 +03:00
Roman Khimov
eba83a0e31 smartcontract: use new binaryReader/Writer API from util 2019-08-28 19:45:17 +03:00
Roman Khimov
361724a33e pkg/core: use util.binaryReader/Writer
Simplify error handling.
2019-08-28 19:45:17 +03:00
Roman Khimov
459542a978 pkg/network: convert to using binaryReader/Writer 2019-08-28 19:45:17 +03:00
Roman Khimov
07096a551b util: move strange Read2000Uint256Hashes() into storage
It's the only user of it.
2019-08-28 14:38:57 +03:00
Roman Khimov
672668b9fb util: use more consistent and explicit naming for BR/BW 2019-08-28 13:24:06 +03:00
Roman Khimov
ad2cd15c6c _pkg.dev: drop the last wire/util code
SumSHA256() and ReaderToBuffer() are not used, CalculateHash() shouldn't be
used and BufferLength() is just to easy with only one user.
2019-08-28 13:09:03 +03:00
Roman Khimov
6409cc753c util: move binaryReader/Writer from _pkg.dev
These are useful and nice.
2019-08-28 12:44:23 +03:00