Skip to content

feat: Validator component#1293

Merged
sergerad merged 36 commits intonextfrom
sergerad-validator-component
Oct 30, 2025
Merged

feat: Validator component#1293
sergerad merged 36 commits intonextfrom
sergerad-validator-component

Conversation

@sergerad
Copy link
Collaborator

@sergerad sergerad commented Oct 15, 2025

Context

As part of the network guardrails initiative, we require a component of miden-node which will re-execute proven transactions, store transaction metadata for private account retrieval, and perform block attestation of blocks coming out of the block-producer.

This PR adds the initial scaffolding of the validator component with placeholder protobuf and SQL schema definitions.

Relates to #613.

Changes

  • Add validator crate with placeholder protobuf and SQL schemas and server scaffolding.
  • Add validator sub-command to binary crate.
  • Add pub and pub use to various types and functions from store crate to be used in validator.

@sergerad sergerad force-pushed the sergerad-validator-component branch 2 times, most recently from 76bc9e7 to 6de7399 Compare October 16, 2025 01:43
@sergerad
Copy link
Collaborator Author

Once this is merged I will be able to add the validator client logic to RPC server inside the logic added in #1278 when TransactionInputs is supplied to the SubmitProvenTransaction endpoint.

@sergerad sergerad force-pushed the sergerad-validator-component branch from 7a16720 to 9285d24 Compare October 19, 2025 20:57
.expect("Duality is maintained by the developer");

Ok(())
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is duplicated because EmbeddedMigrations is not clone and has ownership transferred to pending_migrations(). We can work around this if we would probably be fighting the design of the relevant module so we might prefer to duplicate in the way we have here.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine as long as we pick the right migrations if we end up with two different databases, and not accidentally apply the wrong migration to the wrong database.

size_in_bytes,
}
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is duplicated from store crate. Just placeholder for now. I'm unsure what the actual schema will be just yet.

output_notes -> Binary,
size_in_bytes -> BigInt,
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be generated for us. Maybe I'm missing something from build.rs or maybe we need to add something to the Makefile

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea is to either create this manually or do it as previously described in #928 (comment)

"Successfully inserted proven transaction into database"
);

Ok(rows_affected)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is all placeholder until we know the actual schema

@sergerad sergerad force-pushed the sergerad-validator-component branch 2 times, most recently from 5d3d2dd to 31e24d3 Compare October 20, 2025 00:44
@sergerad sergerad marked this pull request as ready for review October 20, 2025 03:52
@sergerad sergerad requested a review from drahnr October 20, 2025 17:19
pub address: SocketAddr,
/// Server-side timeout for an individual gRPC request.
///
/// If the handler takes longer than this duration, the server cancels the call.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: what's the default value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All the serveres rely on const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10); and have this same comment

@sergerad sergerad requested review from bobbinth and drahnr October 21, 2025 23:20
@sergerad sergerad force-pushed the sergerad-validator-component branch from d118068 to 9eb59da Compare October 22, 2025 02:03
@sergerad sergerad force-pushed the sergerad-validator-component branch from 9eb59da to 05bcfec Compare October 22, 2025 02:04
@sergerad sergerad marked this pull request as draft October 22, 2025 04:46
@sergerad sergerad force-pushed the sergerad-validator-component branch from 8fd6334 to 00fd163 Compare October 29, 2025 22:17
@sergerad sergerad marked this pull request as ready for review October 29, 2025 22:45
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! This is not an in-depth review, but I left some comments inline. The main ones are about reducing the scope of this PR a bit by making the validator "stateless". We can add the database etc. in subsequent PRs.

Comment on lines +14 to +16
## Architecture

The validator operates as a gRPC server and integrates with other Miden node components according to the following flow:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for this PR, but in the future, we should probably move this diagram into the relevant section of the node docs (in the docs directory). In the same future PR, we should probably add a section about the validator component there as well.

@sergerad sergerad force-pushed the sergerad-validator-component branch from 0904b6e to 5ab7d97 Compare October 30, 2025 00:11
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@sergerad sergerad merged commit 4dfad9b into next Oct 30, 2025
6 checks passed
@sergerad sergerad deleted the sergerad-validator-component branch October 30, 2025 01:52
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.

3 participants