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

pass storageMarker as argument when SyncAccounts() is called #5188

Merged

Conversation

BeniaminDrasovean
Copy link
Contributor

Reasoning behind the pull request

  • When a missing trie node is found, the subtrie starting from that hash will be synced. This is triggered on SyncBlock(). However, the storage should not be marked as synced and active - not the whole trie was synced, but just a missing subtrie.

Proposed changes

  • Pass storageMarker to SyncAccounts() func. This way, a disabled storage marker can be given in case the db should not be marked as synced.

Testing procedure

  • Normal testing procedure with missing trie nodes.

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@BeniaminDrasovean BeniaminDrasovean added the ignore-for-release-notes Do not include item in release notes label Apr 24, 2023
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

❗ No coverage uploaded for pull request base (feat/sync-missing-trie-nodes@da1e15e). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head ee04a62 differs from pull request most recent head e4cd99a. Consider uploading reports for the commit e4cd99a to get more accurate results

Additional details and impacted files
@@                       Coverage Diff                       @@
##             feat/sync-missing-trie-nodes    #5188   +/-   ##
===============================================================
  Coverage                                ?   70.65%           
===============================================================
  Files                                   ?      677           
  Lines                                   ?    88061           
  Branches                                ?        0           
===============================================================
  Hits                                    ?    62218           
  Misses                                  ?    21152           
  Partials                                ?     4691           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@iulianpascalau iulianpascalau self-requested a review April 24, 2023 15:33
@@ -104,7 +102,7 @@ func NewUserAccountsSyncer(args ArgsNewUserAccountsSyncer) (*userAccountsSyncer,
}

// SyncAccounts will launch the syncing method to gather all the data needed for userAccounts - it is a blocking method
func (u *userAccountsSyncer) SyncAccounts(rootHash []byte) error {
func (u *userAccountsSyncer) SyncAccounts(rootHash []byte, storageMarker common.StorageMarker) error {
u.mutex.Lock()
Copy link
Contributor

@iulianpascalau iulianpascalau Apr 24, 2023

Choose a reason for hiding this comment

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

Please add here a test for nil storageMarker argument. The code can panic on L135. You need to add CheckIfNil on the StorageMarker interface. Valid for validatorAccountsSyncer.go L82.
+ unit tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ssd04 ssd04 self-requested a review April 25, 2023 06:37
@BeniaminDrasovean BeniaminDrasovean merged commit 4c49b06 into feat/sync-missing-trie-nodes May 4, 2023
@BeniaminDrasovean BeniaminDrasovean deleted the accounts-db-syncer-refactor branch May 4, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes Do not include item in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants