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

[Bug]: Cosmovisor prematurely upgrades after systemctl restart cosmovisor.service #22167

Open
1 task done
lucas2brh opened this issue Oct 8, 2024 · 3 comments
Open
1 task done
Assignees
Labels
C:Cosmovisor Issues and PR related to Cosmovisor T:Bug

Comments

@lucas2brh
Copy link

lucas2brh commented Oct 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I encountered an issue where Cosmovisor upgraded to the next binary version even before reaching the specified block height.

Expected Behavior:
Cosmovisor should only apply the upgrade at the specified block height (1325860). However, after manually restarting the service, it prematurely upgraded to the new binary.

Cosmovisor Version

v1.6.0

How to reproduce?

Steps to Reproduce:

  1. Added a new upgrade with the following configuration:
    • Upgrade version: v0.12.0
    • Trigger height: 1325860
    • Confirmed by checking the upgrade-info.json file:
{"name":"v0.12.0","time":"0001-01-01T00:00:00Z","height":1325860}
  1. After adding the upgrade, I manually restarted the Cosmovisor service using:
sudo systemctl restart cosmovisor.service
  1. Checked the Cosmovisor version:
cosmovisor version

The output showed the upgrade was applied, even though the block height had not yet been reached:

cosmovisor version: v1.6.0  
running app args=["version"] path=/home/ec2-user/xxxx/cosmovisor/upgrades/v0.12.0/bin/client  
DEBU flushing metadata finished               height=22489
@lucas2brh lucas2brh added the T:Bug label Oct 8, 2024
@julienrbrt julienrbrt added the C:Cosmovisor Issues and PR related to Cosmovisor label Oct 8, 2024
@julienrbrt
Copy link
Member

Can you show your systemd service?

@julienrbrt julienrbrt self-assigned this Oct 8, 2024
@julienrbrt
Copy link
Member

julienrbrt commented Oct 9, 2024

So the flow to reproduce is:

  • setup manual upgrade with add-upgrade
  • stop cosmovisor
  • kill/restart cosmovisor, and the upgrade is immediately applied?

I think we can remove systemd out of the picture, given your service.

@lucas2brh
Copy link
Author

So the flow to reproduce is:

  • setup manual upgrade with add-upgrade
  • stop cosmovisor
  • kill/restart cosmovisor, and the upgrade is immediately applied?

I think we can remove systemd out of the picture, given your service.

@julienrbrt
The flow:

  1. setup manual upgrade using add-upgrade with --upgrade-height.
    •   cosmovisor add-upgrade {{ version }} {{ binary }} --force --upgrade-height {{ upgrade_height }}
  2. restart cosmovisor.
  3. observe that the upgrade is applied immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Cosmovisor Issues and PR related to Cosmovisor T:Bug
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants