From 69720608b86500c6196c90d642502bf75f970e0f Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:07 +0300 Subject: [PATCH 1/8] docs: Mark transaction schemas as deprecated --- src/@types/transactionSchemas.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/@types/transactionSchemas.ts b/src/@types/transactionSchemas.ts index cbe71077..854456bd 100644 --- a/src/@types/transactionSchemas.ts +++ b/src/@types/transactionSchemas.ts @@ -151,6 +151,7 @@ export const schemaDistributeTX = { additionalProperties: false, } +// @deprecated Deprecated in version 2.5.0 - will be removed in a future version export const schemaEmailTX = { type: 'object', properties: { @@ -171,6 +172,7 @@ export const schemaEmailTX = { additionalProperties: false, } +// @deprecated Deprecated in version 2.5.0 - will be removed in a future version export const schemaFriendTX = { type: 'object', properties: { @@ -183,6 +185,7 @@ export const schemaFriendTX = { additionalProperties: false, } +// @deprecated Deprecated in version 2.5.0 - will be removed in a future version export const schemaGossipEmailHashTX = { type: 'object', properties: { @@ -428,6 +431,7 @@ export const schemaRegisterTX = { additionalProperties: false, } +// @deprecated Deprecated in version 2.5.0 - will be removed in a future version export const schemaRemoveFriendTX = { type: 'object', properties: { @@ -536,6 +540,7 @@ export const schemaTollTX = { additionalProperties: false, } +// @deprecated Deprecated in version 2.5.0 - will be removed in a future version export const schemaVerifyTX = { type: 'object', properties: { From c9817dbaa13e57f16371e135f2e41562d2193b50 Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:08 +0300 Subject: [PATCH 2/8] refactor(types): Add JSDoc @deprecated tags to transaction enums --- src/@types/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/@types/index.ts b/src/@types/index.ts index 7c8c2a82..4a205c4e 100644 --- a/src/@types/index.ts +++ b/src/@types/index.ts @@ -23,8 +23,11 @@ export enum AJVSchemaEnum { init_network = 'init_network', network_windows = 'network_windows', snapshot = 'snapshot', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ email = 'email', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ gossip_email_hash = 'gossip_email_hash', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ verify = 'verify', register = 'register', create = 'create', @@ -36,7 +39,9 @@ export enum AJVSchemaEnum { update_chat_toll = 'update_chat_toll', update_toll_required = 'update_toll_required', toll = 'toll', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ friend = 'friend', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ remove_friend = 'remove_friend', stake = 'stake', remove_stake = 'remove_stake', @@ -76,8 +81,11 @@ export enum TXTypes { init_network = 'init_network', network_windows = 'network_windows', snapshot = 'snapshot', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ email = 'email', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ gossip_email_hash = 'gossip_email_hash', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ verify = 'verify', register = 'register', create = 'create', @@ -89,7 +97,9 @@ export enum TXTypes { update_chat_toll = 'update_chat_toll', update_toll_required = 'update_toll_required', toll = 'toll', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ friend = 'friend', + /** @deprecated Deprecated in version 2.5.0 - will be removed in a future version */ remove_friend = 'remove_friend', stake = 'stake', remove_stake = 'remove_stake', From 983be3d83fe0260e3cb1b8b4aac910d4b0f4eeab Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:08 +0300 Subject: [PATCH 3/8] docs: Document API endpoint deprecations --- docs/API.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/API.md b/docs/API.md index 6168e5a5..12a8b69b 100644 --- a/docs/API.md +++ b/docs/API.md @@ -165,18 +165,26 @@ Returns address information for the given name. - `name`: Account name ### GET /account/:id/:friendId/toll +⚠️ **DEPRECATED** - Deprecated in version 2.5.0. This endpoint will be removed in a future version. + Returns toll information between two accounts. **Parameters:** - `id`: Account identifier - `friendId`: Friend's account identifier +**Note:** This endpoint is deprecated because the friend functionality has been removed. Use `/account/:id/toll` instead. + ### GET /account/:id/friends +⚠️ **DEPRECATED** - Deprecated in version 2.5.0. This endpoint will be removed in a future version. + Returns friends list for the given account ID. **Parameters:** - `id`: Account identifier +**Note:** This endpoint is deprecated because the friend functionality has been removed. + ### GET /account/:id/recentMessages Returns recent messages for the given account ID. From dbb8d5effcff1d7c87fb83a4ddb2afd7b1f1a951 Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:08 +0300 Subject: [PATCH 4/8] docs: Document transaction type deprecations --- docs/API.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/API.md b/docs/API.md index 12a8b69b..9cce4346 100644 --- a/docs/API.md +++ b/docs/API.md @@ -509,7 +509,9 @@ The transaction will: 2. Add amount to target account 3. Update timestamps for both accounts -#### `email` +#### `email` ⚠️ DEPRECATED +**Deprecated in version 2.5.0** - This transaction type is deprecated and will be removed in a future version. New transactions of this type will be rejected when network version >= 2.5.0. + Initiates the email verification process for an account. **Transaction Parameters:** @@ -541,7 +543,9 @@ The transaction will: 3. Store email hash and verification code hash 4. Trigger gossip_email_hash transaction -#### `gossip_email_hash` +#### `gossip_email_hash` ⚠️ DEPRECATED +**Deprecated in version 2.5.0** - This transaction type is deprecated and will be removed in a future version. New transactions of this type will be rejected when network version >= 2.5.0. + Internal transaction to propagate email verification data across nodes. **Transaction Parameters:** @@ -559,7 +563,9 @@ Internal transaction to propagate email verification data across nodes. This transaction is automatically triggered by the system after an email transaction and should not be manually created. -#### `verify` +#### `verify` ⚠️ DEPRECATED +**Deprecated in version 2.5.0** - This transaction type is deprecated and will be removed in a future version. New transactions of this type will be rejected when network version >= 2.5.0. + Completes the email verification process using the code received via email. **Transaction Parameters:** @@ -663,7 +669,9 @@ The transaction will: 4. Update chat references for both users 5. Update timestamps for all affected accounts -#### `friend` +#### `friend` ⚠️ DEPRECATED +**Deprecated in version 2.5.0** - This transaction type is deprecated and will be removed in a future version. New transactions of this type will be rejected when network version >= 2.5.0. + Adds another user as a friend to avoid toll payments for messaging. **Transaction Parameters:** @@ -722,7 +730,9 @@ The transaction will: Note: If a user has not set a toll amount, the system's default toll will be used for messages from non-friends. -#### `remove_friend` +#### `remove_friend` ⚠️ DEPRECATED +**Deprecated in version 2.5.0** - This transaction type is deprecated and will be removed in a future version. New transactions of this type will be rejected when network version >= 2.5.0. + Removes a friend from the user's friend list, requiring toll payments for future messages. **Transaction Parameters:** From 04f7dff6992491564d277e06c86ae451f437c93d Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:08 +0300 Subject: [PATCH 5/8] feat(api): Implement deprecation check for GET /account/:id/friends --- src/api/accounts/friends.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/api/accounts/friends.ts b/src/api/accounts/friends.ts index eda4fdb9..6a8c9dc5 100644 --- a/src/api/accounts/friends.ts +++ b/src/api/accounts/friends.ts @@ -1,5 +1,22 @@ +import * as AccountsStorage from '../../storage/accountStorage' +import * as utils from '../../utils' + export const friends = dapp => async (req, res): Promise => { try { + // Deprecation check - reject when network version >= 2.5.0 + // This check is disabled until network version is flipped to 2.5.0 or higher + if ( + AccountsStorage?.cachedNetworkAccount && + utils.isEqualOrNewerVersion('2.5.0', AccountsStorage.cachedNetworkAccount.current.activeVersion) + ) { + res.status(410).json({ + error: 'This endpoint is deprecated and no longer available', + deprecated: true, + deprecatedVersion: '2.5.0', + }) + return + } + const id = req.params['id'] const account = await dapp.getLocalOrRemoteAccount(id) if (account) { From eeb29953a3534c4c4efed37544a987b6ff0720cd Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Mon, 12 Jan 2026 21:31:09 +0300 Subject: [PATCH 6/8] feat(api): Implement deprecation check for GET /account/:id/:friendId/toll --- src/api/accounts/tollOfFriend.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/api/accounts/tollOfFriend.ts b/src/api/accounts/tollOfFriend.ts index 0bb1b8eb..84e9366f 100644 --- a/src/api/accounts/tollOfFriend.ts +++ b/src/api/accounts/tollOfFriend.ts @@ -4,6 +4,20 @@ import * as AccountsStorage from '../../storage/accountStorage' export const tollOfFriend = dapp => async (req, res): Promise => { try { + // Deprecation check - reject when network version >= 2.5.0 + // This check is disabled until network version is flipped to 2.5.0 or higher + if ( + AccountsStorage?.cachedNetworkAccount && + utils.isEqualOrNewerVersion('2.5.0', AccountsStorage.cachedNetworkAccount.current.activeVersion) + ) { + res.status(410).json({ + error: 'This endpoint is deprecated and no longer available', + deprecated: true, + deprecatedVersion: '2.5.0', + }) + return + } + const id = req.params['id'] const friendId = req.params['friendId'] if (!id) { From 963b2fee9c6e3537fca0a086682a160a1e374350 Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Tue, 13 Jan 2026 10:00:35 +0300 Subject: [PATCH 7/8] feat: deprecates old transaction types Implements a check for deprecated transaction types based on network version. This ensures that transactions of type email, gossip_email_hash, verify, friend, and remove_friend are no longer accepted if the network version is 2.5.0 or newer. This deprecation is intended to improve security and maintainability of the system. --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 21b02175..f0b761f5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -246,6 +246,15 @@ const shardusSetup = (): void => { return validationResult } + // 3.5. Check for deprecated transaction types (version-based deprecation >= 2.5.0) + if (AccountsStorage?.cachedNetworkAccount && utils.isEqualOrNewerVersion('2.5.0', AccountsStorage.cachedNetworkAccount.current.activeVersion)) { + const deprecatedTxTypes = [TXTypes.email, TXTypes.gossip_email_hash, TXTypes.verify, TXTypes.friend, TXTypes.remove_friend] + if (deprecatedTxTypes.includes(tx.type)) { + validationResult.reason = `Transaction type "${tx.type}" is deprecated from version 2.5.0 onwards and no longer accepted` + return validationResult + } + } + // 4. Validate the tx fields if (LiberdusFlags.enableAJVValidation) { const errors = verifyPayload(tx.type, tx) From 6399f051abcd4f3eb9027530f31efb8e9ed6c193 Mon Sep 17 00:00:00 2001 From: Abdul Azeem Date: Thu, 29 Jan 2026 11:27:28 +0300 Subject: [PATCH 8/8] feat: injects network id into the transaction for client.js testing Adds the network id to the transaction object being sent to the server, ensuring transactions are properly routed based on their intended network. Modifies the message query to include a starting index of 0. This ensures that the retrieval always begins from the start of the message history. --- client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index 4b34727a..d02e3a36 100644 --- a/client.js +++ b/client.js @@ -533,7 +533,7 @@ function calculateChatId(to, from) { async function queryMessages(to, from) { try { - const res = await axios.get(`${PROTOCOL}://${HOST}/messages/${calculateChatId(USER.address, to)}`) + const res = await axios.get(`${PROTOCOL}://${HOST}/messages/${calculateChatId(USER.address, to)}/0`) const { messages } = res.data return messages } catch (error) { @@ -807,6 +807,7 @@ vorpal.command('email', 'registers your email address to the network').action(as signedTx, email: answer.email, timestamp: Date.now(), + networkId, } injectTx(tx).then((res) => { this.log(res)