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

Feature/verifytrie admin rpc #7962

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Dec 23, 2024

  • As requested. admin_verifyTrie RPC.
  • Also, move blocking mechanism to TrieStore instead of processing queue.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • Tested manually.
  • Tested to cancel on shutdown.
  • Tested to not run multiple verifytrie.

@asdacap asdacap requested a review from kamilchodola December 23, 2024 02:20
Comment on lines 147 to 151
public ResultWrapper<string> admin_verifyTrie()
{
if (_blockTree.Head is null)
{
return ResultWrapper<string>.Fail("Head is null. Unable to know state root to verify.");
Copy link
Member

Choose a reason for hiding this comment

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

Potentially can we pass the BlockParameter where we want to verify tries?
Also potentially should we add admin_availableStateRoots, where it would look-up where state root is available in some block range?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, why not.

_logger.Error($"Error in verify trie", e);
}

}, TaskCreationOptions.LongRunning);
Copy link
Member

Choose a reason for hiding this comment

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

I remember we were removing LongRunning because of some reason, @benaadams ?

{
if (_blockTree.Head is null)
SearchResult<BlockHeader> headerSearchResult = _blockTree.SearchForHeader(block);
if (headerSearchResult.Object is null)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need a check if state root is available?

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

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

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.

2 participants