You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have got an error INVALID_NODE_ACCOUNT when the user create a transaction with one client instance and then submit a transaction with another client instance.
Steps to reproduce
Here is the code that can reproduce the problem
const myAccountId = process.env.MY_ACCOUNT_ID;
const myPrivateKey = PrivateKey.fromString(process.env.MY_PRIVATE_KEY);
let client = Client.forTestnet();
client.setOperator(myAccountId, myPrivateKey);
let newAccount = await new AccountCreateTransaction()
.setKey(myPrivateKey)
.setInitialBalance(Hbar.from(10))
.setTransactionValidDuration(30)
.freezeWith(client);
newAccount = await newAccount.sign(myPrivateKey);
console.log("- Wait 20 seconds", new Date().toISOString());
await new Promise((r) => setTimeout(r, 20000));
console.log("- Go", new Date().toISOString());
const newAccountBytes = newAccount.toBytes();
const newAccountObj = Transaction.fromBytes(newAccountBytes);
client = Client.forTestnet();
client.setOperator(myAccountId, myPrivateKey);
const tx = await newAccountObj.execute(client);
// Get the new account ID
const getReceipt = await tx.getReceipt(client);
const newAccountId = getReceipt.accountId;
console.log("The new account ID is: " + newAccountId);
Additional context
No response
Hedera network
mainnet, testnet, previewnet
Version
v2.29.0
Operating system
None
The text was updated successfully, but these errors were encountered:
@pathornteng
Greetings, first of all, you are using the same client instance for the entire code example. Also the issue comes from setting .setTransactionValidDuration(30). If you remove it or increase it a bit more, it is executing successfully!
Hi @petreze, thank you for taking a look. Sorry I have updated the code. I intentionally set low transaction valid duration to save the time and make it easy to reproduce for you or you can remove .setTransactionValidDuration(30) but you have to wait a bit longer to reproduce the problem. I believe that the SDK should never submit the signed transaction to a wrong node account.
Hi @pathornteng
There will be a potential fix with the newest release where we improve the node selection.
Note: I did not experience the issue you mentioned even with the previous versions. I will close this one and if you experience it with the v2.33.0 you can reopen. (I can also release a beta version for you to test if you say so?)
Description
We have got an error
INVALID_NODE_ACCOUNT
when the user create a transaction with one client instance and then submit a transaction with another client instance.Steps to reproduce
Here is the code that can reproduce the problem
Additional context
No response
Hedera network
mainnet, testnet, previewnet
Version
v2.29.0
Operating system
None
The text was updated successfully, but these errors were encountered: