This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Merged
Conversation
Instead of generic KeyValueDB implement specific storage with type safe interface. This databse is used by block store and SafetyModule, on disk it's the rootchain.db Provide basic framework for upgrading the database in the future.
| The list is sorted in descending order of round number. | ||
| */ | ||
| func (db BoltDB) LoadBlocks() (blocks []*ExecutedBlock, err error) { | ||
| return blocks, db.db.View(func(tx *bbolt.Tx) error { |
Contributor
There was a problem hiding this comment.
Just a note, this db.db.* is bad for the eyes.
| if err != nil { | ||
| return err | ||
| } | ||
| /* should we return error when attempting to set earlier round? ie |
Contributor
There was a problem hiding this comment.
Mark as todo and add ticket number or remove.
Contributor
Author
There was a problem hiding this comment.
Not sure it makes sense to create ticket (yet)... left this comment in as a reminder to think about this. As far as I can tell the original code just ignored the attempt "to go back" and always stored the max, could it break something if we return err or would it help to find bugs? 🤷
RaimoMeltsas
approved these changes
May 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This database is used by block store and SafetyModule, on disk it's the rootchain.db
Instead of generic KeyValueDB implement specific storage with type safe interface.
Provide basic framework for upgrading the database in the future.