Odysseia - Pending Transactions

Odysseia - Pending Transactions
Photo by rupixen.com / Unsplash

Odysseia ships with the ability to remove or replace any pending transactions. The initial implementation worked similarly to how Ethereum handles it with a combination of fees and nonces.

We eventually settled on mix of that and a message transmission approach because it offers more flexibility with how actions for pending transactions can be requested without having to rely just on the transaction data itself. This makes it easier for plugin developers to add their own messages and rules without having to extend the internals like the transaction pool to achieve what they want to achieve.

Removing pending transactions

Lets start with removing transactions. Removing a transaction might be something you need to do if you made a mistake with the amount, recipient or the list of public keys you used for a multi-signature registration.

By signing a message with the content OP_REMOVE_TRANSACTION:{HASH} you can request that the transaction for the given hash will be removed from the transaction pool. If the public key and signature match the signatory of the transaction for the given hash it'll be removed and all nodes on the network will be informed to also remove the transaction.

Replacing pending transactions

Next up is replacing a pending transaction. This could have the same reason as removing a transaction but instead you want to propose a replacement.

By signing a message with the content OP_REPLACE_TRANSACTION:{CURRENT_HASH}{NEW_HEX} you can request that the transaction for the given hash will be replaced in the transaction pool. If the public key and signature match the signatory of the transaction for the given hash it'll be removed and the new transaction will be added and all nodes on the network will be informed to also execute the same process to ensure a consistent transaction pool across the network.

Keep in mind that these features were designed with network congestion and high traffic as considerations. During normal network activity blocks are produced so fast that you won't have a chance to remove or replace any of your pending transactions. This of course depends on the block times of the respective network but with the default 8 second block creation time there is a very small time window for taking action and having it propagated to all validators.