Skip to content

Comments

feat: improve node startup time#1700

Open
drahnr wants to merge 2 commits intonextfrom
bernhard-improve-node-startup-time-1697
Open

feat: improve node startup time#1700
drahnr wants to merge 2 commits intonextfrom
bernhard-improve-node-startup-time-1697

Conversation

@drahnr
Copy link
Contributor

@drahnr drahnr commented Feb 23, 2026

Ref #1697

Motivation

The node startup is still rather long, partially because we load more data than actually required.

Changes

  1. avoid loading the full BlockHeader and instead adds a column commitment ( crates/store/src/db/models/queries/block_headers.rs and crates/store/src/db/schema.rs )
  2. adds BlockHeaderCommitment wrapper type, it's a start for avoiding more Word-type(les)s

Caveat

Folds all migrations into the initial one, since it cannot work with the current migration pattern and the changes 'd be too large for this PR, see #1704 for further discussions on that.

@drahnr drahnr added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Feb 23, 2026
@@ -0,0 +1 @@
DROP TABLE IF EXISTS migrations;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should find a better name for the table used for tracking code migrations, open to suggestions

@Mirko-von-Leipzig Mirko-von-Leipzig self-requested a review February 24, 2026 13:08
Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the setup here correctly, can we not massively simplify matters by assigning every migration an ordered integer index (which they already have implictly), and then force every migration to also have what you call a data migration? Then we don't have to play funny macro / DNS-like resolution of diesel migration to function look up games.

You end up with something like https://github.com/eqlabs/pathfinder/blob/cb5c42b005562fca59c2ef044e83aa1464d4f58f/crates/storage/src/schema.rs#L43-L94

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, the main motivation was to not spend too much time on the migration, but get to a functional minimal impl.

I am tempted to just carve it out and squash all migrations and punt on the migrations impl/feat/refactor, to get #1697 done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're happy to do that; maybe let's start with that -- migrations will need to be solid; so I expect a lot of bikeshedding even in just the design portion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A brief brain-dump of my current thinking #1704 it's similar to https://github.com/eqlabs/pathfinder/blob/cb5c42b005562fca59c2ef044e83aa1464d4f58f/crates/storage/src/schema.rs#L43-L94 with a bit more automation and keeping the date-as-version approach.

@drahnr drahnr force-pushed the bernhard-improve-node-startup-time-1697 branch from 5d06459 to 3b1319f Compare February 24, 2026 15:03
@drahnr drahnr force-pushed the bernhard-improve-node-startup-time-1697 branch from 3b1319f to 831d2af Compare February 24, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants