Refactor: use of i64 and db swap#35
Merged
Merged
Conversation
- Replace sqlx-postgres with sqlx-mysql; use BIGINT UNSIGNED for native u64 storage - Eliminate separate migration container by calling Migrator::up at startup
- Mock Strata fullnode (Python HTTP server) serving deterministic checkpoints and blocks over JSON-RPC - Full stack isolation: mock fullnode + ephemeral MariaDB container + backend binary per test run Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
@alexhui01 JFYI, after this pr goes in, checkpoint explorer helm template will need a refactor. Major changes for deployment being:
Please refer to the the updated docker-compose as a reference. NOTE: I do not see our Testnet I (we can keep using images from |
krsnapaudel
requested changes
Mar 30, 2026
krsnapaudel
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for cleaning of the u64, i64 mess.
Other than the comment about why mariadb, you have pycache in the commit and some other issues.
- replace dummy l1_reference fields with ExplorerL1Ref containing only txid; set to None when txid is absent. simplify frontend type to match - add MariaDB healthcheck and condition: service_healthy to both docker-compose files so backend waits for DB to be ready - write backend subprocess output to service.log instead of DEVNULL, matching alpen functional-test pattern - remove invalid working-directory input from setup-uv ci step - fix typo in checkpoint_service doc comment - restore comment on confirmation_status parse
krsnapaudel
reviewed
Mar 31, 2026
Collaborator
Author
@krsnapaudel it will be a good refactor. I am going with our |
krsnapaudel
requested changes
Apr 1, 2026
Replace String fields with typed equivalents in the checkpoint DB model: - status: String → RpcCheckpointConfStatus via DeriveActiveEnum - checkpoint_txid: String with "-" sentinel → Option<Txid> Eliminates all string-based status comparisons in queries and removes the "-" sentinel pattern from the From/Into impls.
krsnapaudel
reviewed
Apr 2, 2026
krsnapaudel
left a comment
Collaborator
There was a problem hiding this comment.
Otherwise looks good.
krsnapaudel
approved these changes
Apr 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In this pr I have attempted to fix an ugly semantic flaw we had in our codebase due to a limitation of Postgres. Pg does not support U64, so we translated u64 (block height, checkpoint idx, etc) to i64 and vice versa which added unnecessary application level complication throughout the code.
So the major changes are:
alpenrepo, this test sets up a mock strata fullnode and ckpt-exp backend and mostly tests if it is serving through our major routes (/search,/checkpoint?p=<x>and/). This was mostly written by Claude so I do not want it to be critically reviewed. Yet its good to have an eye.I have tested locally by running
docker compose up --build -dand also by runningcd functional-tests && ./run-tests.shPS: We have done some additional works which were not planned but felt worthwhile after a few rounds of reviews.
justrecipes.