orchestration bundles: remove unused protobuf encoders/decoders in CosmosOrchestrationAccount
#9578
Labels
enhancement
New feature or request
What is the Problem Being Solved?
An analysis of a generated bundle for CosmosOrchestrationAccount reveals that deep imports of protobuf message encoders/decoders from
@agoric/cosmic-proto
do not result in any tree shaking or dead code elimination.This issue was uncovered with guidance from @kriskowal:
bundle analysis
Notably, at least
authz
,feegrant
,gov
,mint
, andupgrade
modules are not used. For modules likestaking
anddistribution
, we wouldn't expect to see files likegenesis.js
in the export. We also wouldn't expect to see unused messages such asMsgEditValidator
instaking/v1beta1/tx.js
.Note: The current approach of protobuf serialization in JS (as opposed to Go + a bridge) is necessitated by
@agoric/orchestration
's requirement to support arbitrary messages. While this design choice is outside the scope of this issue, a separate discussion on this topic is welcome.Description of the Design
This is primarily a Spike to explore potential solutions. Areas to investigate include:
Scaling Considerations
The primary goal of this ticket is to prevent publishing unused code to the chain.
A secondary consideration is the development workflow for external developers. If they need to support a new chain or use case with their own protos, they shouldn't have to upstream changes to
@agoric/cosmic-proto
to get swingset-compatible encoder/decoder support. This might suggest a more localized approach, where codegen happens on a ~per-contract basis in@agoric/orchestration
.Test Plan
TBD
Upgrade Considerations
N/A
The text was updated successfully, but these errors were encountered: