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

Fix self repair error #462

Merged
merged 3 commits into from
Jul 21, 2022

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Jul 19, 2022

Description

This PR fixes 2 errors :

  • During replication, when retrieving the previous chain, Embedded_impl.write_transaction_chain is called, but this function do not retrieve the genesis chain if it exist to append the new transactions to the same file. And so mutuiple file was created for the same chain.
  • If an authorized node disconnect and is globally unavailable, of it reconnect at the end of a cycle, it will send the en of node sync flag, but it will stay unavailable because it has not enough connection time in the cycle to be globally available. And so the synced flag stay to false.

Correction:

  • Retrieve the previous address to get the genesis addres if the chain
  • Send the end of node sync flag until the node is available

Fixes #460

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Run 2 nodes and shut down one after it gets authorized and let the other run for a while. Then reconnect the other node and the first node shared secrets transaction should retrieve the while chain and write it in the same file and not in a new file each 10 transactions
  • Run 2 nodes and shut down one after it gets authorized. Wait the node goes globally unavailable and reconnect it just before a summary time, the end of node sync should be sent on the next self repair

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

@Neylix Neylix requested a review from imnik11 July 19, 2022 15:42
Copy link
Contributor

@imnik11 imnik11 left a comment

Choose a reason for hiding this comment

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

I checked with graphql
With 5 nodes
In earlier codebase
Screenshot 2022-07-21 134218
Due to quorum read it takes the other nodes

Screenshot 2022-07-21 140544

after this PR

Screenshot 2022-07-21 141145

@Neylix Neylix merged commit 9243f19 into archethic-foundation:develop Jul 21, 2022
@Neylix Neylix deleted the Fix-self-repair-error branch July 21, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants