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

remove state commit on disconnect #3385

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions vms/platformvm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,6 @@ func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error {
if err := vm.uptimeManager.Disconnect(nodeID); err != nil {
return err
}
if err := vm.state.Commit(); err != nil {
return err
}
Comment on lines -475 to -477
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we want to we can move this to SetPreference (or some periodic go routine like mempool pruning etc). I'd imagine block acceptance should be sufficient enough though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another thing you can do is to check when was the last time you committed the disconnected nodes. If it's less than, say, 1 second ago, then not commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea good idea we could do that instead. but I slightly think that state should be commited with respect to chain progress.

return vm.Network.Disconnected(ctx, nodeID)
}

Expand Down
Loading