lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
439 stars 106 forks source link

tapdb: implement basic migration downgrade protection #973

Closed Roasbeef closed 5 days ago

Roasbeef commented 5 days ago

In this commit, we implement basic migration downgrade protection. This ensures that tapd will refuse to downgrade versions if a migration happened in the latest software version.

We achieved this by hard coding the latest version as a constant. Then when we go to migrate, we check this version against the latest version stored in the database. If the hard coded version is less than the latest version, then we conclude this is a downgrade attempt.

guggero commented 5 days ago

Added a commit to check the hard coded version in the Golang code with a CI step.