-
Notifications
You must be signed in to change notification settings - Fork 335
Description
When constructing transactions locally using TronWeb, the block parameters (e.g., block number, block timestamp, etc.) are fetched via the wallet/getblock endpoint. These parameters remain constant within the same block. As a result, if multiple transactions are constructed with identical parameters within the same block (e.g., within the same second), the second transaction is considered a duplicate and cannot be broadcast.
Expected Behavior:
Multiple transactions constructed in quick succession should be assigned unique or sufficiently differentiated parameters to allow them to be submitted within the same block.
Actual Behavior:
Transactions constructed with the same block reference and identical input are treated as duplicates, preventing the second transaction from being accepted or broadcasted.
Steps to Reproduce:
Use TronWeb to construct a transaction using parameters from wallet/getblock.
Immediately construct a second transaction with the same inputs and parameters.
Attempt to broadcast both transactions.
Observe that the second transaction is rejected or ignored.
Suggestion:
Introduce a mechanism in TronWeb to:
Fetch fresh block references if needed.
Allow setting custom or updated transaction parameters.
Include a nonce-like mechanism or unique salt to differentiate transactions created within the same block.