Skip to content
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

client pkg import optimizations & refactoring #7

Open
bryanchriswhite opened this issue Dec 14, 2024 · 0 comments
Open

client pkg import optimizations & refactoring #7

bryanchriswhite opened this issue Dec 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bryanchriswhite
Copy link
Owner

bryanchriswhite commented Dec 14, 2024

The libpoktroll_clients shared library is too large. I assume this is due to the shape of the cgo module's dependency tree. Fixing this may require restructuring in the poktroll repo as well.

Consider eliminating as many poktroll imports as possible:

# grep -r ./ -e github.com/pokt-network/poktroll

./block_client.go:      "github.com/pokt-network/poktroll/pkg/client/block"
./block_query_client.go:        "github.com/pokt-network/poktroll/pkg/client"
./events_query_client.go:       "github.com/pokt-network/poktroll/pkg/client/events"
./events_query_client.go:       "github.com/pokt-network/poktroll/pkg/client"
./tx_context.go:        "github.com/pokt-network/poktroll/app"
./tx_context.go:        "github.com/pokt-network/poktroll/cmd/poktrolld/cmd"
./tx_context.go:        "github.com/pokt-network/poktroll/pkg/client/tx"
./tx_context.go:        txtypes "github.com/pokt-network/poktroll/pkg/client/tx/types"
./main.go:      appmodule "github.com/pokt-network/poktroll/x/application/module"
./main.go:      gatewaymodule "github.com/pokt-network/poktroll/x/gateway/module"
./main.go:      proofmodule "github.com/pokt-network/poktroll/x/proof/module"
./main.go:      servicemodule "github.com/pokt-network/poktroll/x/service/module"
./main.go:      sessionmodule "github.com/pokt-network/poktroll/x/session/module"
./main.go:      sharedmodule "github.com/pokt-network/poktroll/x/shared/module"
./main.go:      suppliermodule "github.com/pokt-network/poktroll/x/supplier/module"
./main.go:      tokenomicsmodule "github.com/pokt-network/poktroll/x/tokenomics/module"
./tx_client.go: "github.com/pokt-network/poktroll/pkg/client"
./tx_client.go: "github.com/pokt-network/poktroll/pkg/client/tx"
./query_client.go:      "github.com/pokt-network/poktroll/pkg/client"
./query_client.go:      "github.com/pokt-network/poktroll/pkg/client/query"
./query_client.go:      apptypes "github.com/pokt-network/poktroll/x/application/types"
./query_client.go:      prooftypes "github.com/pokt-network/poktroll/x/proof/types"
./query_client.go:      servicetypes "github.com/pokt-network/poktroll/x/service/types"
./query_client.go:      sessiontypes "github.com/pokt-network/poktroll/x/session/types"
./query_client.go:      sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
  1. --home and --chain-id flag defaults SHOULD be defined locally (i.e. not imported from poktroll).
  2. Interface dependencies SHOULD be defined locally (i.e. not imported from poktroll).
  3. Protobuf types SHOULD be generated and registered locally (i.e. buf.build integration; not imported from poktroll)

Beyond these steps, the next biggest import optimization may come from extracting the poktroll client go package to its own go module. This will significantly minimize the dependency tree, thus reducing the size of the resulting shared object.

@bryanchriswhite bryanchriswhite added bug Something isn't working enhancement New feature or request labels Dec 14, 2024
@bryanchriswhite bryanchriswhite self-assigned this Dec 14, 2024
@bryanchriswhite bryanchriswhite moved this to Backlog in poktroll-clients Dec 14, 2024
@bryanchriswhite bryanchriswhite changed the title Import optimizations... Cgo import optimizations... Dec 14, 2024
@bryanchriswhite bryanchriswhite changed the title Cgo import optimizations... client pkg import optimizations & refactoring Dec 14, 2024
@bryanchriswhite bryanchriswhite moved this from Backlog to Ready in poktroll-clients Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

1 participant