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 bugs #794

Merged
merged 7 commits into from
Jan 6, 2023
Merged

Fix bugs #794

merged 7 commits into from
Jan 6, 2023

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Dec 30, 2022

Description

Fix some bugs

  • Uncatched error in Replication while fetching previous transaction causing replication crash
  • When writing a transaction chain in DB, remove ALL transaction of this chain from KOLedger
  • To calculate node availabilty we use a wheighted average to increase recent slot weight, but the slot list was not sorted so the wheight was not applied to the expected slot
  • Ecto crash when having error somewhere (i.e content oversized) and the transaction contains ownerships
  • Since the GetTransactionChain message can return in asc or desc order, the conflict resolver was not accurate :

let's asume a chain TX1 -> TX2 -> TX3 -> TX4 -> TX5 -> TX6 -> TX7 and the nb of tx returned is 5 by request in desc order
if a node didn't replicate the last transaction we could have a result like
node1 :

%{
  transactions: [TX6, TX5, TX4, TX3, TX2],
  more?: true,
  paging_state: TX2
}

node2 :

%{
  transactions: [TX7, TX6, TX5, TX4, TX3],
  more?: true,
  paging_state: TX3
}

node3: same as node2

The good return is node2 and node3 result, but as node1 and other have more? at true and length of transactions list is the same, so the previous conflict resolver take the first element of the returns list which can be node1 with the wrong result.
So to fix this I added a sort on the timestamp of the first transaction of the list (regarding the order requested)

Type of change

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

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 added the bug Something isn't working label Dec 30, 2022
and transaction contains ownerships
@samuelmanzanera samuelmanzanera merged commit 5dc532c into archethic-foundation:develop Jan 6, 2023
@Neylix Neylix deleted the fix-bugs branch January 9, 2023 14:18
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.

None yet

3 participants