Closed Diegoescalonaro closed 4 months ago
@Diegoescalonaro the issue was reproduced by @RickyLB and a fix will be issued
@Diegoescalonaro The transaction should be frozen with the payerClient
, and not the userClient
. Once the transactionId
is set for TopicMessageSubmitTransaction
, the accountId
must match that in the set transactionId
. Hence, there cannot be 2 payers.
Hey @RickyLB, thanks for the comment 😃
I've tried what you mention by modifying the line below in the code snippet and it seems to work well. By freezing the transaction with the payerClient
, the first and second chunk transactions are successfully executed in the Network.
let frozenTx = try transaction.freezeWith(payerClient);
However, this model does not work for most of the use cases where the user firstly creates and signs the transaction in the client application (which requires the transaction to be frozen with the userClient
), and then payer account executes the signed transaction in the backend.
In my opinion, even if the transaction is frozen by the user or the payer, all transaction chunks should contain the same transactionId
that has been specified in the moment of creation, thus designating the payer account for the the first and the following transaction chunks. That is how other SDKs like the hedera-sdk-js works.
I also tested it by utilizing the Swift SDK for creating, freezing, signing and serializing the transaction in the client, and utilizing the JavaScript SDK only for unserializing and executing the transaction in the backend server, but it also throws the same error: INVALID_CHUNK_TRANSACTION_ID
. This makes me think that the problem should be related to the time of creation or freezing...
Description
When submitting a message to a topic using a custom transactionId and a message large enough to be split into several chunks/transactions, the operation fails with
INVALID_CHUNK_TRANSACTION_ID
and only the first chunk transaction is successfully registered to the topic.The problem seems to occur because the second and following chunks do not have the same
transactionId
as the first one. Only the first chunk transaction has thetransactionId
set in the transaction creation.This has been tested with the hedera-sdk-js and it works well as all chunk transactions are executed with the same
transactionId
. In the TopicMessageSubmitTransaction code there seems to be some logic to configured transactionId for all chunk transactions.Steps to reproduce
12
(2 bytes)1
(1 byte)Notes: The message has been set to "12" and the chunk size to 1 byte to cause the message to be split into 2 chunks. So the first chunk transaction would contain message "1" and the second chunk transaction would contain message "2".
Code snippet for testing:
Additional context
Results using hedera-sdk-swift:
SUCCESS
): 0.0.1079725@1703755456.148942099INVALID_CHUNK_TRANSACTION_ID
): 0.0.7123674@1703755457.278342353Results using hedera-sdk-js:
SUCCESS
): 0.0.1079725@1703756832.022655083SUCCESS
): 0.0.1079725@1703756832.022655084Hedera network
testnet
Version
v0.26.0
Operating system
macOS