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

feat(Chain): move check_refcount_map into Store Validator + caching Tx Refcounts while GCing #2937

Merged
merged 5 commits into from
Jul 6, 2020

Conversation

Kouprin
Copy link
Member

@Kouprin Kouprin commented Jul 2, 2020

  • move check_refcount_map into Store Validator
  • caching Tx Refcounts while GCing
  • fixes sanity/epoch_switches.py
  • validation of State Headers and State Parts
  • refactoring

TEST PLAN

CI + custom Nightly

@gitpod-io
Copy link

gitpod-io bot commented Jul 2, 2020

@Kouprin Kouprin force-pushed the refcount_map branch 5 times, most recently from b0d8921 to 6b8cd8e Compare July 3, 2020 14:33
@Kouprin Kouprin changed the title feat(Store Validator): move check_refcount_map into Store Validator feat(Chain): move check_refcount_map into Store Validator + caching Tx Refcounts while GCing Jul 3, 2020
@Kouprin Kouprin force-pushed the refcount_map branch 2 times, most recently from 12a8789 to 478da5c Compare July 4, 2020 05:41
@Kouprin Kouprin marked this pull request as ready for review July 4, 2020 05:44
@Kouprin Kouprin marked this pull request as draft July 4, 2020 06:13
@Kouprin Kouprin marked this pull request as ready for review July 4, 2020 07:36
chain/chain/src/store.rs Show resolved Hide resolved
chain/client/tests/process_blocks.rs Show resolved Hide resolved
chain/jsonrpc/src/lib.rs Show resolved Hide resolved
Comment on lines +2405 to +2407
let mut refcount = self.chain_store.get_tx_refcount(&tx.get_hash())?;
refcount += 1;
store_update.set_ser(ColTransactionRefCount, tx.get_hash().as_ref(), &refcount)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we ensure that this does not lead us to a race condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

We cannot increase and decrease Tx Refcount in one store update operation. While increasing, we cannot add same Tx twice. There is also a comment in finalize() method explaining this.

@Kouprin Kouprin merged commit 23b810a into master Jul 6, 2020
@Kouprin Kouprin deleted the refcount_map branch July 6, 2020 11:09
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.

3 participants