Skip to content

Conversation

@sistemd
Copy link
Contributor

@sistemd sistemd commented Oct 24, 2025

Closes #3047.

@sistemd sistemd requested a review from a team as a code owner October 24, 2025 16:24
);

let fake_proposals_storage = fake_proposals_storage.clone();
let fake_proposals_storage = storage.clone();
Copy link
Contributor

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?

Copy link
Member

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<()> {
Copy link
Contributor

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).

Copy link
Contributor

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.

Copy link
Member

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 (
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consensus DB has a hard-coded name

5 participants