Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge: A refund transaction present in both pending transactions and executed transactions which shouldn't happen. #891

Open
sameh-farouk opened this issue Nov 12, 2023 · 0 comments
Labels
type_bug Something isn't working
Milestone

Comments

@sameh-farouk
Copy link
Member

sameh-farouk commented Nov 12, 2023

On devnet, I noticed that a RefundTransaction is present in both RefundTransactions and ExecutedRefundTransactions. This is unexpected because we remove the transaction from the RefundTransactions storage map before inserting it into the ExecutedRefundTransactions storage map.

let tx = RefundTransactions::<T>::get(&tx_id);
RefundTransactions::<T>::remove(&tx_id);
ExecutedRefundTransactions::<T>::insert(tx_id.clone(), &tx);

This could be a sign of a race condition since we have multiple running instances of the bridge daemons.
One daemon adds this transaction to the pending list after another daemon removed it from the pending list and set it as executed.

This results in tfchain emitting ExpiredRefundTransaction events for this transaction continuously because it exists in the pending transactions map. However, bridge validators keep skipping this event since the transaction exists in the executed transactions.

Perhaps we should investigate how this can happen and how the flow can be further improved to prevent such occurrences.

Screenshot from 2023-11-10 02-38-45
Screenshot from 2023-11-10 02-39-50

@sameh-farouk sameh-farouk added the type_bug Something isn't working label Nov 12, 2023
@sameh-farouk sameh-farouk added this to the later milestone Nov 12, 2023
@sameh-farouk sameh-farouk changed the title Bridge: A RefundTransaction present in both RefundTransactions and ExecutedRefundTransactions which shouldn't happen. Bridge: A refund transaction present in both pending transactions and executed transactions which shouldn't happen. Nov 12, 2023
@renauter renauter modified the milestones: later, 2.8.0 Mar 21, 2024
@sameh-farouk sameh-farouk modified the milestones: 2.8.0, later Jun 2, 2024
@sameh-farouk sameh-farouk removed this from 3.14.x Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants