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

Invalid state root after restart #1530

Open
herr-seppia opened this issue Jun 6, 2023 · 2 comments
Open

Invalid state root after restart #1530

herr-seppia opened this issue Jun 6, 2023 · 2 comments
Labels
type:bug Something isn't working

Comments

@herr-seppia
Copy link
Member

Describe the bug
On devnet cluster, 3 nodes are stucked in "invalid state root" phase

To Reproduce
Just launch a cluster and try to restart a single node

@herr-seppia herr-seppia added the type:bug Something isn't working label Jun 6, 2023
@herr-seppia
Copy link
Member Author

herr-seppia commented Jun 8, 2023

Currently on devnet we have this error

{
  "level": "error",
  "msg": "invalid state detected",
  "node": "01333bdfd9d008e1eefc7080e596faf7de2555904fe26ba478ca5f861acf6e07",
  "process": "chain",
  "rusk": "1707b604702b2c47d543302f71320f2ffb384c641d8b382cf18ba3516ef6e49b",
  "time": "2023-06-08T12:38:42Z"
}

Dusk-blockchain was restart at block 1159 and the state_root for that block is indeed 1707b604702b2c47d543302f71320f2ffb384c641d8b382cf18ba3516ef6e49b

Curiously, the block 1100 has indeed the state_root 01333bdfd9d008e1eefc7080e596faf7de2555904fe26ba478ca5f861acf6e07 and the current configuration toml has

[state]
persistEvery = 100

So the problem is in how dusk-blockchain recover the tip of the network, because it seems that relies on the "Last Persisted Block"

// LoadTip of the chain. Returns blockchain tip and persisted hash.
LoadTip() (*block.Block, []byte, error)

The culprit is the change we made on rusk, where the state now is really persisted at every "accept/finalize" and persist() method does nothing

Even if the culprit is on rusk, we should adapt dusk_blockchain in order to not rely on this mechanism

@herr-seppia
Copy link
Member Author

Changing persistEvery to 1 as workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant