Skip to content

GO-5411 rpc encoding with snappy #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b21ce99
Add vt protobufs
fat-fellow Mar 5, 2025
260525b
Add vt protobufs
fat-fellow Mar 14, 2025
f912294
Add vt protobufs
fat-fellow Mar 14, 2025
4053e77
rpc snappy encoding
cheggaaa Apr 4, 2025
37872da
resolve conflicts
cheggaaa Apr 4, 2025
6e58148
fix marshalAppend
cheggaaa Apr 7, 2025
5d2217a
fix ns/payments proto conflict + regenerate mocks
cheggaaa Apr 8, 2025
914642f
rename protobuf.ProtoBuf -> protobuf.Message
cheggaaa Apr 8, 2025
bb760b9
Merge branch 'go-481-research-gogoprotobuf-alternatives' into GO-5411…
cheggaaa Apr 9, 2025
56b25a1
avoid drpc closed/blocked connections in pools
requilence May 7, 2025
c25fe5b
fix possible leak via subConnRelease
requilence May 7, 2025
b9192f1
add ctx as arg to ReleaseDrpcConn
requilence May 7, 2025
943e151
fix select order
requilence May 7, 2025
f7c3a85
drpc vt proto encoding
cheggaaa May 9, 2025
5152a47
proto handshake: encodings
cheggaaa May 12, 2025
d7e22d0
switch streampool encoding
cheggaaa May 13, 2025
c61950b
merge main
cheggaaa May 13, 2025
1cb183f
merge
cheggaaa Jul 4, 2025
615a5df
merge
cheggaaa Jul 4, 2025
7fd565e
return deps to Makefile
cheggaaa Jul 6, 2025
e258955
return deps to Makefile
cheggaaa Jul 6, 2025
3824b1c
regenerate protos
cheggaaa Jul 6, 2025
d4aaa96
Merge branch 'GO-5411-rpc-snappy-encoding' into GO-5411-rpc-snappy-en…
cheggaaa Jul 6, 2025
b54bf09
wip: fix test
cheggaaa Jul 6, 2025
f6d242d
fix snappy enc / snappy config
cheggaaa Jul 7, 2025
0ff6133
fix handshake encoding reset
cheggaaa Jul 9, 2025
8fd2e9f
fix tests
cheggaaa Jul 9, 2025
fa8a4a1
Merge branch 'main' of github.com:anyproto/any-sync into GO-5411-rpc-…
cheggaaa Jul 9, 2025
9afa0c7
add timeout for drpc unblocked
cheggaaa Jul 9, 2025
cfea217
fix testpeer
cheggaaa Jul 9, 2025
62c1c56
peer: decrese drpc unblocked timeout
cheggaaa Jul 14, 2025
56300cc
comment debug stat
cheggaaa Jul 14, 2025
3aed9cf
remove nix
cheggaaa Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 50 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,68 @@ all:
@set -e;
@git config core.hooksPath .githooks;

proto: proto-execute replace-gogo-strings
PROTOC=protoc
PROTOC_GEN_GO=deps/protoc-gen-go
PROTOC_GEN_DRPC=deps/protoc-gen-go-drpc
PROTOC_GEN_VTPROTO=deps/protoc-gen-go-vtproto

proto-execute:
@echo 'Generating protobuf packages (Go)...'
define generate_proto
@echo "Generating Protobuf for directory: $(1)"
$(PROTOC) \
--go_out=. --plugin protoc-gen-go="$(PROTOC_GEN_GO)" \
--go-vtproto_out=. --plugin protoc-gen-go-vtproto="$(PROTOC_GEN_VTPROTO)" \
--go-vtproto_opt=features=marshal+unmarshal+size \
--proto_path=$(1) $(wildcard $(1)/*.proto)
endef

define generate_drpc
@echo "Generating Protobuf for directory: $(1) $(which protoc-gen-go)"
$(PROTOC) \
--go_out=. --plugin protoc-gen-go=$$(which protoc-gen-go) \
--plugin protoc-gen-go-drpc=$(PROTOC_GEN_DRPC) \
--go_opt=$(1) \
--go-vtproto_out=:. --plugin protoc-gen-go-vtproto=$(PROTOC_GEN_VTPROTO) \
--go-vtproto_opt=features=marshal+unmarshal+size \
--go-drpc_out=protolib=github.com/planetscale/vtprotobuf/codec/drpc:. $(wildcard $(2)/*.proto)
endef

proto:
@echo 'Generating protobuf packages (Go)...'
@$(eval P_ACL_RECORDS_PATH_PB := commonspace/object/acl/aclrecordproto)
@$(eval P_ACL_RECORDS_PATH_PB := commonspace/object/acl/aclrecordproto)
@$(eval P_TREE_CHANGES_PATH_PB := commonspace/object/tree/treechangeproto)
@$(eval P_CRYPTO_PATH_PB := util/crypto/cryptoproto)
@$(eval P_ACL_RECORDS := M$(P_ACL_RECORDS_PATH_PB)/protos/aclrecord.proto=github.com/anyproto/any-sync/$(P_ACL_RECORDS_PATH_PB))
@$(eval P_TREE_CHANGES := M$(P_TREE_CHANGES_PATH_PB)/protos/treechange.proto=github.com/anyproto/any-sync/$(P_TREE_CHANGES_PATH_PB))

protoc --gogofaster_out=:. $(P_ACL_RECORDS_PATH_PB)/protos/*.proto
protoc --gogofaster_out=:. $(P_TREE_CHANGES_PATH_PB)/protos/*.proto
protoc --gogofaster_out=:. $(P_CRYPTO_PATH_PB)/protos/*.proto
$(eval PKGMAP := $$(P_TREE_CHANGES),$$(P_ACL_RECORDS))
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonspace/spacesyncproto/protos/*.proto
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonfile/fileproto/protos/*.proto
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. net/streampool/testservice/protos/*.proto
protoc --gogofaster_out=:. net/secureservice/handshake/handshakeproto/protos/*.proto
protoc --gogofaster_out=:. net/rpc/limiter/limiterproto/protos/*.proto
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. coordinator/coordinatorproto/protos/*.proto
protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. consensus/consensusproto/protos/*.proto
protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. identityrepo/identityrepoproto/protos/*.proto
protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. nameservice/nameserviceproto/protos/*.proto
protoc --gogofaster_out=:. --go-drpc_out=protolib=github.com/gogo/protobuf:. paymentservice/paymentserviceproto/protos/*.proto
$(call generate_proto,$(P_ACL_RECORDS_PATH_PB)/protos)
$(call generate_proto,$(P_TREE_CHANGES_PATH_PB)/protos)
$(call generate_proto,$(P_CRYPTO_PATH_PB)/protos)
$(eval PKGMAP := $$(P_TREE_CHANGES)$(comma)$$(P_ACL_RECORDS))
$(call generate_drpc,$(PKGMAP),commonspace/spacesyncproto/protos)
$(call generate_drpc,$(PKGMAP),commonfile/fileproto/protos)
$(call generate_drpc,$(PKGMAP),net/streampool/testservice/protos)
$(call generate_drpc,$(PKGMAP),net/endtoendtest/testpeer/testproto/protos)


$(call generate_drpc,,net/secureservice/handshake/handshakeproto/protos)
$(call generate_drpc,,net/rpc/limiter/limiterproto/protos)
$(call generate_drpc,$(PKGMAP),coordinator/coordinatorproto/protos)
$(call generate_drpc,,consensus/consensusproto/protos)
$(call generate_drpc,,identityrepo/identityrepoproto/protos)
$(call generate_drpc,,nameservice/nameserviceproto/protos)
$(call generate_drpc,,paymentservice/paymentserviceproto/protos)

mocks:
echo 'Generating mocks...'
go build -o deps go.uber.org/mock/mockgen
PATH=$(CURDIR)/deps:$(PATH) go generate ./...

deps:
go mod download
go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc
go build -o deps github.com/anyproto/protobuf/protoc-gen-gogofaster
go build -o deps google.golang.org/protobuf/cmd/protoc-gen-go
go build -o deps github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto

test:
go test ./... --cover
mocks:
echo 'Generating mocks...'
go generate ./...

replace-gogo-strings:
@echo "Replacing 'github.com/gogo/protobuf' with 'github.com/anyproto/protobuf' in all files recursively..."
LC_CTYPE=C LANG=C find . -type f -name "*.go" | xargs sed -i '' "s|github.com/gogo/protobuf|github.com/anyproto/protobuf|g"
test:
go test ./... --cover
10 changes: 6 additions & 4 deletions accountservice/mock_accountservice/mock_accountservice.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 38 additions & 36 deletions acl/mock_acl/mock_acl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading