Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Transactional updates in the state-db #1616

Merged
merged 1 commit into from
Jan 30, 2019
Merged

Transactional updates in the state-db #1616

merged 1 commit into from
Jan 30, 2019

Conversation

arkpar
Copy link
Member

@arkpar arkpar commented Jan 29, 2019

No description provided.

@arkpar arkpar added the A0-please_review Pull request needs code review. label Jan 29, 2019
@arkpar
Copy link
Member Author

arkpar commented Jan 30, 2019

Closes #1602
Closes #1618

@svyatonik
Copy link
Contributor

Are you sure it closes #1602 - I could see that finalization still comes before import.

@@ -886,10 +790,14 @@ impl<Block> client::backend::Backend<Block, Blake2Hasher> for Backend<Block> whe
drop(leaves);
}

for (hash, number, is_best, is_finalized) in meta_updates {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious - why do we need to replace one loop (inside if !operation.finalized_blocks.is_empty() {) with two (inside operation.pending_block.is_some() and operation.pending_block.is_none())? Does it fix something?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. In case case finalized_blocks are specified metadata for these should be set before the pending_block
  2. All metadata should be updated after the transaction is committed.

@arkpar
Copy link
Member Author

arkpar commented Jan 30, 2019

operation.finalized_blocks are extra preceding blocks to finalize. If an imported block needs to be finalized it should be specified in pending_block.leaf_state

@gavofyork gavofyork added the U1-asap No need to stop dead in your tracks, however issue should be addressed as soon as possible. label Jan 30, 2019
@rphmeier
Copy link
Contributor

Needs a resolve

@gavofyork gavofyork added F0-consensus U0-drop_everything Everyone should address the issue now. and removed U1-asap No need to stop dead in your tracks, however issue should be addressed as soon as possible. labels Jan 30, 2019
@rphmeier rphmeier added A8-looksgood and removed A0-please_review Pull request needs code review. labels Jan 30, 2019
@gavofyork gavofyork merged commit 6ff99ea into master Jan 30, 2019
@gavofyork gavofyork deleted the a-state-db branch January 30, 2019 15:58
arkpar added a commit that referenced this pull request Jan 30, 2019
rphmeier pushed a commit that referenced this pull request Jan 31, 2019
* Transactional updates in the state-db (#1616)

* set link-arg --export-table for wasm builds (#1598)
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
U0-drop_everything Everyone should address the issue now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants