hashgraph / hedera-sdk-js

Hedera™ Hashgraph SDK for JavaScript/TypeScript
https://docs.hedera.com/guides/docs/sdks
Apache License 2.0
253 stars 131 forks source link

Handle platform_not_active error gracefully #2353

Open SimiHunjan opened 2 weeks ago

SimiHunjan commented 2 weeks ago

Problem

The SDK offers a convenience feature where when a transaction is signed by the user it will pre-sign transactions for 1/3 of the nodes in the network. This is to provide redundancy in cases where a transaction could fail and can pick up the next signed transaction to a different node. A transaction cannot be sent to all nodes as the signed transaction requires you to specify a single node before user the signs the transaction. If there was not such a feature you would imagine that the user would have to be pinged to resign another transaction each time it tries to send the transaction to a different node.

In some cases, this feature could provide an unwanted outcome in that the first transaction it tries that node could return an error to the user while it is trying to submit the following transaction to a different node. The user would then observe that their transaction failed (true for the first transaction), but was actually successful (when it got submitted to the next node).

This issue is to investigate the above scenario and see if there are ways to improve this experience so that the user does not get mislead. Also to give guidance to developers on how their apps should account for this scenario.

This example provided that kicked off this discussion is the following:

Receiving a PLATFORM_NOT_ACTIVE error node a node. At the time this was received we believe this from a node that was marked as degraded. The the following the transaction was successful on the explorer

https://hashscan.io/mainnet/transaction/1718307329.984046337

image (17)

Solution

Research potential ways to improve and provide guidance to developers for how to manage these cases.

Alternatives

No response

SimiHunjan commented 1 week ago

@teacoat the team looked into this issue and is planning to implement an enhancement where the platform not active error will handled in a way that the error won't be thrown to the user in the future