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

FCU should move GlobalWorldState Root #8154

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

LukaszRozmej
Copy link
Member

Changes

  • Change global world state state root on FCU

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Please run nodes.

Documentation

Remarks

  • Why didn't we implement it earlier? Probably omission.
  • It doesn't matter much with current state management, it matters a lot with Paprika.

@@ -259,6 +232,7 @@ protected virtual bool IsOnMainChainBehindHead(Block newHeadBlock, ForkchoiceSta
if (shouldUpdateHead)
{
_blockTree.UpdateMainChain(blocks!, true, true);
processingQueue.RunOnEmpty(() => globalWorldState.StateRoot = newHeadBlock.StateRoot!);
Copy link
Member Author

Choose a reason for hiding this comment

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

Main change here

Copy link
Contributor

@Scooletz Scooletz left a comment

Choose a reason for hiding this comment

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

As pointed in the other PR, I'd prefer to keep one owner of the global state and leave it up to the BlockProcessor to move the root as it wants to. FCU should just notify the processor about the checkpoint being changed.

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