Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

[Backport 1.1] Parent not found when trying to delete & update simultaneously #2292

Closed
wants to merge 13 commits into from

Conversation

arsulegai
Copy link
Contributor

@arsulegai arsulegai commented Feb 21, 2020

Transaction is submitted to handle simultaneous read and write
to multiple addresses in merkle tree.

"merkle_db_update" is called with both update items and delete
items. If update items have common parent with delete items,
and delete items remove common parent required by update items a
node is left to be added without a correct parent chain.
Processing delete items leaves behind the broken parent chain.

Solution: Remove parent node of item to be deleted only if its
path is not in parent chain of update items.

This is a backport from #2000

There are also additional lint fix commits, some of which are cherry-pick from #2257

@arsulegai
Copy link
Contributor Author

@agunde406 @rberg2 I cherry-picked the lint fixes from #2257 to this backport PR.

@rberg2 1237dcc looks suspicious to me. Please confirm if no issues were reported after this change.

agunde406 and others added 13 commits April 14, 2020 00:14
Unnecessary use of a comprehension

Signed-off-by: Andrea Gunderson <agunde@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Unnecessary "else" after "continue" or "break"

Signed-off-by: Andrea Gunderson <agunde@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Unnecessary use of a comprehension

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Unnecessary use of a comprehension

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Positional arguments appear to be out of order (arguments-out-of-order)

Signed-off-by: Richard Berg <rberg@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Using subprocess.run without explicitly set `check` is not recommended.
(subprocess-run-check)

Signed-off-by: Richard Berg <rberg@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Consider using sys.exit() (consider-using-sys-exit)

Signed-off-by: Richard Berg <rberg@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Before when the args were in the wrong order this
pylint issues did not get raised. After that was fixed,
useless-super-delegation issues was rasied.

This is ignored because the parrent is an abstract class.

Signed-off-by: Andrea Gunderson <agunde@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Signed-off-by: Andrea Gunderson <agunde@bitwise.io>
Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Unnecessary use of a comprehension

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Using subprocess.run without explicitly set `check` is not recommended.
(subprocess-run-check)

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Unnecessary use of a comprehension

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
Transaction is submitted to handle simultaneous read and write
to multiple addresses in merkle tree.

"merkle_db_update" is called with both update items and delete
items. If update items have common parent with delete items,
and delete items remove common parent required by update items a
node is left to be added without a correct parent chain.
Processing delete items leaves behind the broken parent chain.

Solution: Remove parent node of item to be deleted only if its
path is not in parent chain of update items.

Signed-off-by: S m, Aruna <aruna.mohan@walmartlabs.com>
@arsulegai
Copy link
Contributor Author

This PR could be facing the issue discussed here pylint-dev/pylint#3312

@arsulegai
Copy link
Contributor Author

I see that when build passed pylint's version was 2.4.4 but now pylint is pegged to version 2.3.1. That is causing the issue.

@vaporos
Copy link
Contributor

vaporos commented May 26, 2021

Closing this backport PR as we are not anticipating any further 1.1.x releases. If this is an error (we need a future 1.1 release with this change), let's discuss.

@vaporos vaporos closed this May 26, 2021
@arsulegai arsulegai deleted the backport-branch branch May 26, 2021 20:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants