-
Notifications
You must be signed in to change notification settings - Fork 264
refactor(consensus/storage): merge consensus db into main one #3070
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
base: main
Are you sure you want to change the base?
Conversation
| ); | ||
|
|
||
| let fake_proposals_storage = fake_proposals_storage.clone(); | ||
| let fake_proposals_storage = storage.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to work, but @CHr15F0x has been complaining that making proposals from the main DB is problematic (AFAIK because the state diffs have to be stored only after the proposal is accepted by consensus, and computing them before that, i.e. here, interferes with that). Has that been solved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, i don't remember exactly but unless we have a decently working real proposal creation algo I'd keep this PR/issue parked. Currently using the prod db as a scratchpad for fake proposal creation seems fishy.
| @@ -0,0 +1,19 @@ | |||
| use anyhow::Context; | |||
|
|
|||
| pub(crate) fn migrate(tx: &rusqlite::Transaction<'_>) -> anyhow::Result<()> { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This certainly works, but @kkovaacs was concerned about tying the P2P-specific tables to the main DB, and consequently to releases (major version for each DB change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I think our consensus implementation is still too much in flux to have that in our 'main' DB. If we use the 'main' DB for consensus then pretty much every release we do will have to be a 'breaking' release and each and every change in consensus will require a migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| tracing::info!("Creating consensus proposals table"); | ||
|
|
||
| tx.execute( | ||
| r"CREATE TABLE IF NOT EXISTS consensus_proposals ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose IF NOT EXISTS is unnecessary here - but that's just a detail...
Closes #3047.