Skip to content

Commit 4f9cad6

Browse files
committed
Fix THORChain protobuf bloat using minimal common.proto
1 parent 1ca3399 commit 4f9cad6

File tree

4 files changed

+433
-2663
lines changed

4 files changed

+433
-2663
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
syntax = "proto3";
2+
package common;
3+
4+
option go_package = "gitlab.com/thorchain/thornode/v3/common";
5+
6+
// Minimal common.proto with only types needed by MsgDeposit
7+
message Asset {
8+
string chain = 1;
9+
string symbol = 2;
10+
string ticker = 3;
11+
bool synth = 4;
12+
bool trade = 5;
13+
bool secured = 6;
14+
}
15+
16+
message Coin {
17+
Asset asset = 1;
18+
string amount = 2;
19+
int64 decimals = 3;
20+
}

packages/xchain-thorchain/genMsgs.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ echo "Checking proto files"
4444
tput sgr0
4545
MISSING_FILES=0
4646
for proto_file in \
47-
"$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \
4847
"$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \
4948
"$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do
5049
if [ ! -f "$proto_file" ]; then
@@ -60,6 +59,17 @@ if [ $MISSING_FILES -eq 1 ]; then
6059
exit 1
6160
fi
6261

62+
# Copy minimal common.proto to temp directory
63+
tput setaf 2
64+
echo "Using minimal common.proto to avoid bloat"
65+
tput sgr0
66+
mkdir -p "$TMP_DIR/thornode/proto/thorchain/v1/common"
67+
if ! cp common_minimal.proto "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto"; then
68+
echo "Error: Failed to copy minimal common.proto"
69+
exit 1
70+
fi
71+
echo "✓ Using minimal common.proto"
72+
6373
# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists
6474
COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto"
6575
if [ ! -f "$COSMOS_COIN_PROTO" ]; then

0 commit comments

Comments
 (0)