Skip to content

Commit 1d890fc

Browse files
committed
updated proto files and ts clients, fixed MsgClaimMorseSupplier handler and added missing values to the following enums ApplicationUnbondingReason, SupplierUnbondingReason
1 parent e74f0b5 commit 1d890fc

File tree

190 files changed

+89475
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+89475
-385
lines changed

buf.gen.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This file is auto-generated from Ignite. You can edit
2+
# the file content but do not change the file name or path.
3+
#
4+
# buf.gen.ts.yaml
5+
#
6+
version: v2
7+
clean: true
8+
managed:
9+
enabled: true
10+
inputs:
11+
- module: buf.build/gogo/protobuf
12+
- module: buf.build/cosmos/cosmos-proto
13+
- module: buf.build/cosmos/cosmos-sdk
14+
- git_repo: https://github.com/pokt-network/poktroll.git
15+
branch: main
16+
subdir: proto
17+
plugins:
18+
- remote: buf.build/community/stephenh-ts-proto
19+
out: ./src/client
20+
opt:
21+
- logtostderr=true
22+
- allow_merge=true
23+
- json_names_for_fields=false
24+
- ts_proto_opt=snakeToCamel=true
25+
- ts_proto_opt=esModuleInterop=true
26+
- ts_proto_out=.

docker/postgres/load-extensions.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<EOF
44
CREATE EXTENSION IF NOT EXISTS btree_gist;
55
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
6-
CREATE EXTENSION IF NOT EXISTS system_stats;
76
EOF

docker/postgres/pg.dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ RUN apk add --no-cache --virtual .build-deps \
1414
curl
1515

1616
# Clone, build, and install system_stats extension
17-
RUN git clone https://github.com/EnterpriseDB/system_stats.git /tmp/system_stats && \
18-
cd /tmp/system_stats && \
19-
PATH="/usr/local/pgsql/bin:$PATH" make USE_PGXS=1 && \
20-
PATH="/usr/local/pgsql/bin:$PATH" make install USE_PGXS=1 && \
21-
cd .. && rm -rf /tmp/system_stats
17+
#RUN git clone https://github.com/EnterpriseDB/system_stats.git /tmp/system_stats && \
18+
# cd /tmp/system_stats && \
19+
# PATH="/usr/local/pgsql/bin:$PATH" make USE_PGXS=1 && \
20+
# PATH="/usr/local/pgsql/bin:$PATH" make install USE_PGXS=1 && \
21+
# cd .. && rm -rf /tmp/system_stats
2222

2323
# Copy in the load-extensions script
2424
COPY docker/postgres/load-extensions.sh /docker-entrypoint-initdb.d/

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"poktroll:proxy:start": "./scripts/proxy-tunnel.sh start",
2626
"poktroll:proxy:stop": "./scripts/proxy-tunnel.sh stop",
2727
"poktroll:update-proto-files": "scripts/copy-poktroll-files.sh",
28+
"poktroll:generate-ts-from-proto": "buf generate",
2829
"docker:check-env:production": "env sh ./scripts/dotenv-check.sh production",
2930
"docker:build:production": "yarn run docker:compose production build",
3031
"docker:build:no-cache:production": "yarn run docker:compose production build --no-cache",

proto/pocket/application/event.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import "pocket/application/types.proto";
1414
enum ApplicationUnbondingReason {
1515
APPLICATION_UNBONDING_REASON_ELECTIVE = 0;
1616
APPLICATION_UNBONDING_REASON_BELOW_MIN_STAKE = 1;
17+
APPLICATION_UNBONDING_REASON_MIGRATION = 2;
1718
}
1819

1920
// EventApplicationStaked is emitted when an application is staked or up-staked.

proto/pocket/application/types.proto

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// TODO_AUTOMATE: Add a CI workflow which detects .proto files with incompatible names (i.e. same as the package).
2-
// NB: This file CANNOT be named "application.proto" due to an as of yet unidentified
3-
// issue in how cosmos-proto generates the pulsar plugin output go source code.
1+
// TODO_AUTOMATE: Add a CI workflow that automatically detects .proto files with names incompatible with the package name (e.g., files named exactly as the package, like "application.proto").
2+
// NB: This file CANNOT be named "application.proto" due to an unresolved issue in how cosmos-proto generates the pulsar plugin output Go source code.
3+
// See: https://github.com/pokt-network/poktroll/issues/XXX for tracking and future resolution.
44

55
syntax = "proto3";
66
package pocket.application;
@@ -23,23 +23,24 @@ message Application {
2323
cosmos.base.v1beta1.Coin stake = 2;
2424

2525
// CRITICAL: Must contain EXACTLY ONE service config
26-
// This prevents applications from over-servicing.
27-
// Kept as repeated field for legacy and future compatibility
28-
// Refs:
26+
// - Enforces a single service configuration per application to prevent over-servicing.
27+
// - Field is repeated for legacy reasons and potential future compatibility.
28+
// - References for rationale:
2929
// - https://github.com/pokt-network/poktroll/pull/750#discussion_r1735025033
3030
// - https://www.notion.so/buildwithgrove/Off-chain-Application-Stake-Tracking-6a8bebb107db4f7f9dc62cbe7ba555f7
3131
repeated pocket.shared.ApplicationServiceConfig service_configs = 3;
3232

33-
// TODO_MAINNET_MIGRATION(@bryanchriswhite): Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`.
34-
// Ensure to rename all relevant configs, comments, variables, function names, etc as well.
35-
// Non-nullable list of Bech32 encoded delegatee Gateway addresses
33+
// TODO_MAINNET_MIGRATION(@bryanchriswhite): Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to` for better clarity and consistency.
34+
// - Update all related configs, comments, variables, and function names throughout the codebase to reflect this change.
35+
// - This field is a non-nullable list of Bech32-encoded delegatee Gateway addresses.
3636
repeated string delegatee_gateway_addresses = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.nullable) = false];
3737

3838
// Mapping of session end heights to gateways being undelegated from
39-
// - Key: Height of the last block of the session when undelegation tx was committed
40-
// - Value: List of gateways being undelegated from
41-
// TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment
42-
// so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906.
39+
// - Key: Height of the last block of the session when the undelegation transaction was committed
40+
// - Value: List of gateways being undelegated from at that session end height
41+
// TODO_DOCUMENT(@red-0ne): Document the complete flow and rationale behind this mapping.
42+
// - Ensure the documentation explains why tracking pending undelegations by session end height is necessary.
43+
// - See: https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906 for context and examples.
4344
map<uint64, UndelegatingGatewayList> pending_undelegations = 5 [(gogoproto.nullable) = false];
4445

4546
// Session end height when application initiated unstaking (0 if not unstaking)
@@ -61,3 +62,16 @@ message PendingApplicationTransfer {
6162
string destination_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
6263
uint64 session_end_height = 2;
6364
}
65+
66+
// Undelegation represents a connection between an application and a gateway that
67+
// is in the process of being removed.
68+
//
69+
// This record is stored in the undelegation index
70+
// and used to track and process pending undelegations after the unbonding period has elapsed.
71+
message PendingUndelegation {
72+
// Address of the application that is undelegating from the gateway.
73+
string application_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
74+
75+
// Address of the gateway that the application is undelegating from.
76+
string gateway_address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
77+
}

proto/pocket/gateway/event.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ message EventGatewayUnbondingCanceled {
4747
pocket.gateway.Gateway gateway = 1 [(gogoproto.jsontag) = "gateway"];
4848
// The end height of the session in which the unbonding was canceled.
4949
int64 session_end_height = 2 [(gogoproto.jsontag) = "session_end_height"];
50-
}
50+
}

proto/pocket/migration/event.proto

Lines changed: 79 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,121 @@ import "pocket/migration/morse_onchain.proto";
1313
import "pocket/application/types.proto";
1414
import "pocket/shared/supplier.proto";
1515

16-
// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain.
16+
// EventImportMorseClaimableAccounts
17+
// - Emitted when MorseClaimableAccounts are created on-chain
18+
// - Represents import event for Morse claimable accounts
1719
message EventImportMorseClaimableAccounts {
18-
// The height (on Shannon) at which the MorseAccountState was created on-chain.
20+
// Shannon height at which MorseAccountState was created on-chain
1921
int64 created_at_height = 1 [(gogoproto.jsontag) = "created_at_height"];
2022

21-
// The onchain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported.
23+
// On-chain computed sha256 hash of the MorseAccountState
24+
// - Contains all imported MorseClaimableAccounts
2225
bytes morse_account_state_hash = 2 [(gogoproto.jsontag) = "morse_account_state_hash"];
2326

24-
// Number of claimable accounts (EOAs) collected from Morse state export
25-
// NOTE: Account balances include consolidated application and supplier actor stakes
27+
// Number of claimable accounts (EOAs) imported from Morse state export
28+
// - Account balances include consolidated application and supplier actor stakes
2629
uint64 num_accounts = 3 [(gogoproto.jsontag) = "num_accounts"];
2730
}
2831

29-
// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain.
32+
// EventMorseAccountClaimed
33+
// - Emitted when a MorseAccount is claimed on-chain
3034
message EventMorseAccountClaimed {
31-
// The session end height (on Shannon) in which the claim was committed (i.e. claimed).
35+
// Shannon session end height in which the claim was committed
3236
int64 session_end_height = 1 [(gogoproto.jsontag) = "session_end_height"];
3337

34-
// The unstaked balance which was claimed.
38+
// Unstaked balance claimed from Morse
3539
cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false];
3640

37-
// The bech32-encoded address of the Shannon account to which the claimed balance will be minted.
41+
// bech32-encoded Shannon address to mint claimed balance
3842
string shannon_dest_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"];
3943

40-
// The hex-encoded address of the Morse account whose balance will be claimed.
44+
// Hex-encoded Morse account address whose balance was claimed
4145
string morse_src_address = 4 [(gogoproto.jsontag) = "morse_src_address"];
4246
}
4347

44-
// EventMorseApplicationClaimed is emitted when a MorseAccount is claimed on-chain as a staked application.
48+
// EventMorseApplicationClaimed
49+
// - Emitted when a MorseAccount is claimed on-chain as a staked application
4550
message EventMorseApplicationClaimed {
46-
// The session end height (on Shannon) in which the claim was committed (i.e. claimed).
51+
// Shannon session end height in which the claim was committed
4752
int64 session_end_height = 1 [(gogoproto.jsontag) = "session_end_height"];
4853

49-
// The unstaked balance which was claimed.
54+
// Unstaked balance claimed from Morse
5055
cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false];
5156

52-
// The hex-encoded address of the Morse account whose balance will be claimed.
57+
// Hex-encoded Morse account address whose balance was claimed
5358
string morse_src_address = 3 [(gogoproto.jsontag) = "morse_src_address"];
5459

55-
// The stake of the application which was staked as a result of the claim.
60+
// Application stake claimed as a result of the claim
61+
// - Equivalent to Morse application staked amount
5662
cosmos.base.v1beta1.Coin claimed_application_stake = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "claimed_application_stake"];
5763

58-
// The application which was staked as a result of the claim.
59-
// This is equivalent to the amount it had staked on Morse.
64+
// Application staked as a result of the claim
65+
// - Mirrors Morse application stake
6066
application.Application application = 5 [(gogoproto.jsontag) = "application"];
6167
}
6268

63-
// EventMorseSupplierClaimed is emitted when a MorseAccount is claimed on-chain as a staked Supplier.
69+
// EventMorseSupplierClaimed
70+
// - Emitted when a MorseAccount is claimed on-chain as a staked Supplier
6471
message EventMorseSupplierClaimed {
65-
// The session end height (on Shannon) in which the claim was committed (i.e. claimed).
72+
// Next free index: 9
73+
reserved 3;
74+
75+
// Shannon session end height in which the claim was committed
6676
int64 session_end_height = 1 [(gogoproto.jsontag) = "session_end_height"];
6777

68-
// The unstaked balance which was claimed.
78+
// Unstaked balance claimed from Morse
6979
cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false];
7080

71-
// The hex-encoded address of the Morse account whose balance will be claimed.
72-
string morse_src_address = 3 [(gogoproto.jsontag) = "morse_src_address"];
73-
74-
// The stake of the Supplier which was staked as a result of the claim.
75-
// This will be equivalent to the amount it had staked on Morse.
81+
// The hex-encoded address of the Morse non-custodial (i.e. operator) account.
82+
// - Unstaked balance was migrated 1:1
83+
// - Stake was migrated 1:1 from morse_node_address to shannon_operator_address
84+
// - Morse non-custodial (i.e. operator) address.
85+
// If morse_output_address was not set, this is the custodial address.
86+
// - See 'pocket nodes --help' for more information. Note that this refers to the Morse CLI.
87+
// E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e
88+
string morse_node_address = 8 [(gogoproto.jsontag) = "morse_node_address"];
89+
90+
// ONLY applicable to Morse node/supplier accounts.
91+
// Hex-encoded address of the Morse output account/wallet associated with the Morse node/supplier.
92+
// - E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e
93+
// - Morse custodial (i.e. owner) address, which owned the staked tokens of the operator.
94+
// See 'pocket nodes --help' for more information. Note that this refers to the Morse CLI.
95+
string morse_output_address = 6 [(gogoproto.jsontag) = "morse_output_address"];
96+
97+
// The type of supplier claim signer, indicating which actor executed the claim
98+
// and whether it was a custodial or non-custodial claim.
99+
// - MORSE_SUPPLIER_CLAIM_SIGNER_TYPE_NON_CUSTODIAL_SIGNED_BY_ADDR
100+
// - MORSE_SUPPLIER_CLAIM_SIGNER_TYPE_CUSTODIAL_SIGNED_BY_OPERATOR
101+
// - MORSE_SUPPLIER_CLAIM_SIGNER_TYPE_CUSTODIAL_SIGNED_BY_OWNER
102+
MorseSupplierClaimSignerType claim_signer_type = 7 [(gogoproto.jsontag) = "claim_signer_type"];
103+
104+
// Supplier stake claimed as a result of the claim
105+
// - Equivalent to Morse supplier staked amount
76106
cosmos.base.v1beta1.Coin claimed_supplier_stake = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "claimed_supplier_stake"];
77107

78-
// The Supplier which was staked as a result of the claim.
108+
// Supplier staked as a result of the claim
109+
// - Mirrors Morse supplier stake
79110
shared.Supplier supplier = 5 [(gogoproto.jsontag) = "supplier"];
80111
}
112+
113+
// EventMorseAccountRecovered
114+
// - Emitted when a Morse account is recovered on-chain
115+
message EventMorseAccountRecovered {
116+
// The session end height (on Shannon) in which the recovery was committed (i.e. claimed).
117+
int64 session_end_height = 1 [(gogoproto.jsontag) = "session_end_height"];
118+
119+
// The total balance which was recovered:
120+
// - Includes both unstaked and staked balances (consolidated)
121+
// - Auto-liquidates both unstaked and staked balances at once
122+
cosmos.base.v1beta1.Coin recovered_balance = 2 [(gogoproto.jsontag) = "recovered_balance", (gogoproto.nullable) = false];
123+
124+
// The bech32-encoded address of the Shannon account to which the recovered balance was minted.
125+
string shannon_dest_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"];
126+
127+
// The hex-encoded address of the Morse account whose balance and stakes have been recovered.
128+
// This address MUST be in the recovery allow list and could be of types such as:
129+
// - Unreachable/Locked EOA, Supplier or Application address
130+
// - Module account
131+
// - Invalid address (too short, too long, or non-hexadecimal format)
132+
string morse_src_address = 4 [(gogoproto.jsontag) = "morse_src_address"];
133+
}

proto/pocket/migration/genesis.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ option (gogoproto.stable_marshaler_all) = true;
1212

1313
// GenesisState defines the migration module's genesis state.
1414
message GenesisState {
15-
15+
1616
// params defines all the parameters of the module.
1717
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
1818
repeated MorseClaimableAccount morseClaimableAccountList = 2 [(gogoproto.nullable) = false] ;

0 commit comments

Comments
 (0)