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

infinite_looping_in_forward_transaction_#931 #937

Conversation

apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Mar 15, 2023

Description

Fixes

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch from 0947d41 to 440b8ed Compare March 17, 2023 10:21
@samuelmanzanera samuelmanzanera linked an issue Mar 21, 2023 that may be closed by this pull request
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch from 440b8ed to 44e8d37 Compare March 21, 2023 22:40
@apoorv-2204 apoorv-2204 self-assigned this Mar 21, 2023
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch from 44e8d37 to 0a032dc Compare March 21, 2023 22:42
@apoorv-2204 apoorv-2204 marked this pull request as ready for review March 21, 2023 22:42
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch 2 times, most recently from cf66c73 to 317602d Compare March 23, 2023 05:05
lib/archethic.ex Outdated Show resolved Hide resolved
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch 3 times, most recently from 527d370 to cc2ffbd Compare March 27, 2023 13:34
lib/archethic/p2p/message/new_transaction.ex Show resolved Hide resolved
lib/archethic.ex Show resolved Hide resolved
lib/archethic.ex Outdated Show resolved Hide resolved
Copy link
Member

@Neylix Neylix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, can your rebase to solve conflict and not override new changes ?

lib/archethic.ex Show resolved Hide resolved
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch 3 times, most recently from 6b3285f to 2be71ef Compare April 3, 2023 11:13
lib/archethic.ex Show resolved Hide resolved
test/archethic_test.exs Show resolved Hide resolved
test/archethic_test.exs Show resolved Hide resolved
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch 3 times, most recently from 5c47598 to 47d2597 Compare April 4, 2023 09:39
test/archethic_test.exs Show resolved Hide resolved
test/archethic_test.exs Show resolved Hide resolved
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch from 47d2597 to 7baa028 Compare April 5, 2023 11:38
lib/archethic.ex Outdated Show resolved Hide resolved
lib/archethic.ex Outdated Show resolved Hide resolved
@apoorv-2204 apoorv-2204 force-pushed the infinite_looping_in_forward_transaction_#931 branch from 7baa028 to 08082c6 Compare April 6, 2023 10:31
Copy link
Member

@bchamagne bchamagne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the test work I had to hardcode a network patch, because there is a randomness in local development that breaks this feature.

I tested this scenario:

✔️ 3 nodes, I modified the code of 2 nodes to mark them as invalid for processing (to force the forward). I then sent a transaction to A that forward it to B that forward it to C.

  • When you remove the task.async, we now have A that wait until timeout, and when the timeout occur, A will try to send to C (in the same scenario as above), which I believe is not good.

ps: please keep commit history

@apoorv-2204
Copy link
Contributor Author

To make the test work I had to hardcode a network patch, because there is a randomness in local development that breaks this feature.

I tested this scenario:

✔️ 3 nodes, I modified the code of 2 nodes to mark them as invalid for processing (to force the forward). I then sent a transaction to A that forward it to B that forward it to C.

  • When you remove the task.async, we now have A that wait until timeout, and when the timeout occur, A will try to send to C (in the same scenario as above), which I believe is not good.

ps: please keep commit history

Hi, we are relying on timeout to notifiy user. I updated geo patch for null patch for localhost

@apoorv-2204 apoorv-2204 requested a review from Neylix April 6, 2023 12:49
@samuelmanzanera
Copy link
Member

samuelmanzanera commented Apr 6, 2023

To make the test work I had to hardcode a network patch, because there is a randomness in local development that breaks this feature.
I tested this scenario:
✔️ 3 nodes, I modified the code of 2 nodes to mark them as invalid for processing (to force the forward). I then sent a transaction to A that forward it to B that forward it to C.

  • When you remove the task.async, we now have A that wait until timeout, and when the timeout occur, A will try to send to C (in the same scenario as above), which I believe is not good.

ps: please keep commit history

Hi, we are relying on timeout to notifiy user. I updated geo patch for null patch for localhost

Indeed, I wasn't against to spawn a process it's just the Task.async expected to await something, maybe a start_child would be sufficient. (But QUID of the error network_issue then ?)
Otherwise we will have cascading timeout.

@bchamagne
Copy link
Member

Maybe I got it wrong, but I believe my last comment is still relevant. We talked about an ACK msg no?

@apoorv-2204
Copy link
Contributor Author

Maybe I got it wrong, but I believe my last comment is still relevant. We talked about an ACK msg no?

Replay back a message?

@Neylix
Copy link
Member

Neylix commented Apr 11, 2023

Maybe I got it wrong, but I believe my last comment is still relevant. We talked about an ACK msg no?

The ack message is returned in the process function of the message NewTransaction

@samuelmanzanera samuelmanzanera merged commit f687e89 into archethic-foundation:develop Apr 17, 2023
@samuelmanzanera samuelmanzanera added the bug Something isn't working label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite looping in forward transaction
4 participants