Skip to content

refactor(validator): wrap database handles in reader/writer structs - #2403

Merged
SantiagoPittella merged 2 commits into
nextfrom
add-validator-db-wrapper
Aug 7, 2026
Merged

refactor(validator): wrap database handles in reader/writer structs#2403
SantiagoPittella merged 2 commits into
nextfrom
add-validator-db-wrapper

Conversation

@SantiagoPittella

@SantiagoPittella SantiagoPittella commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

closes #2368

Summary

Copies the ntx-builder's database wrapper (#2353) into the validator: ValidatorDbReader/ValidatorDbWriter expose one method per query, so raw DbReader/DbWriter handles no longer escape src/db/. Queries move to one directory per query, matching the ntx-builder layout.

Also fixes two things: find_unvalidated_transactions now uses a single rarray query instead of one EXISTS per id, and parameters bind through the blob codec / SqlTypeConvert instead of to_bytes().

Changelog

changelog = "none"
reason    = "Internal change only."

@SantiagoPittella
SantiagoPittella force-pushed the add-validator-db-wrapper branch from c8be314 to 38a90c0 Compare July 29, 2026 16:08
@sergerad
sergerad self-requested a review August 3, 2026 07:07

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread bin/validator/src/db/mod.rs
Base automatically changed from migrate-ntx-builder-off-diesel to next August 6, 2026 07:51
@SantiagoPittella
SantiagoPittella force-pushed the add-validator-db-wrapper branch 4 times, most recently from f855850 to 6b72d61 Compare August 7, 2026 14:52
@SantiagoPittella
SantiagoPittella force-pushed the add-validator-db-wrapper branch from 6b72d61 to 4bdbac5 Compare August 7, 2026 14:56
@SantiagoPittella
SantiagoPittella merged commit 27102f1 into next Aug 7, 2026
55 of 56 checks passed
@SantiagoPittella
SantiagoPittella deleted the add-validator-db-wrapper branch August 7, 2026 18:06
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.

Add Database wrapper in validator

3 participants