Skip to content

feat: add remote prover tests run on monitor#1236

Merged
bobbinth merged 11 commits intonextfrom
santiagopittella-remote-prover-tests
Sep 25, 2025
Merged

feat: add remote prover tests run on monitor#1236
bobbinth merged 11 commits intonextfrom
santiagopittella-remote-prover-tests

Conversation

@SantiagoPittella
Copy link
Copy Markdown
Collaborator

Send periodical prove requests to the remote provers.

I ended up refactoring a bit the code for the sake of simplicity and type safety.

@SantiagoPittella SantiagoPittella force-pushed the santiagopittella-remote-prover-tests branch from 8b62ee3 to e5924b7 Compare September 19, 2025 21:59
Base automatically changed from santiagopittella-one-task-per-component to next September 19, 2025 22:01
@SantiagoPittella SantiagoPittella force-pushed the santiagopittella-remote-prover-tests branch from e5924b7 to 90aff20 Compare September 19, 2025 22:05
.without_metadata_genesis()
.connect_lazy::<RemoteProverClient>();

let mut interval = tokio::time::interval(Duration::from_secs(30)); // Test every 30 seconds
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.

Just wondering if we should make this relatively large - say 1 or 2 minutes? Particularly if we expect testnet/mainnet provers to be under significant load (I'm not sure how much load this request itself involves).

And it would be good to make this configurable but not required for this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, agree that the best is making this configurable. The configuration options is growing and I'm thinking that switching to clap might be a good idea, wdyt?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In the meantime, I changed it to 2 mins.

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.

Yea clap sounds good. Main thing is to have everything configurable via env vars as always.

@bobbinth
Copy link
Copy Markdown
Contributor

Not a review yet (I haven't looked at the code) - but curious how does the frontend look now? Specifically, what kind of info do we show for each proof "probe".

Also, how are we building the proof request? For this we need to have a transaction, right? Are we using a transaction against the faucet, or something else?

@SantiagoPittella
Copy link
Copy Markdown
Collaborator Author

SantiagoPittella commented Sep 23, 2025

This is the current frontend. For the failed request we are displaying the full error. Should I change that? The cards resize them based on the content of the largest one in the row. If we reduce the error messages, cards can be much smaller.

In the image an errors is shown. This is because of how we build the transaction, in this case, but could happen the same with blocks and batches. To build the test payload we have the following scenarios:

  • for transaction provers: we use the MockChain to create a P2ID note to be then used in a tx.
  • for block provers: we use the MockChain to create a ProposedBlock with no batches.
  • for batch provers: we use the MockChain and the same tx that we used for the tx prover, then we prove it with a local prover and use that ProvenTransaction to generate a ProposedBatch.

This approach has the benefit of being simple, but lacks compatibility across different versions. This is why using the deployed remote transaction prover is failing with the deserialization errors. I do think that supporting different versions might not be really useful and could be a bit tricky to maintain. An option that I thought of (which I'm not a fan) to fix this could be to add an endpoint to the provers that returns a valid transaction/batch/block to be proved, enabling us to support any remote prover version..

Screenshot 2025-09-23 at 11 58 39 Screenshot 2025-09-23 at 11 58 45

@bobbinth
Copy link
Copy Markdown
Contributor

Looks really good!

For the failed request we are displaying the full error. Should I change that? The cards resize them based on the content of the largest one in the row. If we reduce the error messages, cards can be much smaller.

If not too difficult, I'd show a part of the error message and then an option to copy the rest of the message to clipboard. So, for example, we could show just "InvalidArgument" and then case a "copy" button next to it.

  • for transaction provers: we use the MockChain to create a P2ID note to be then used in a tx.
  • for block provers: we use the MockChain to create a ProposedBlock with no batches.
  • for batch provers: we use the MockChain and the same tx that we used for the tx prover, then we prove it with a local prover and use that ProvenTransaction to generate a ProposedBatch.

For now, let's just to transaction proofs - we can add other proof types later.

Regarding proof generation - I think using MockChain is fine for now, but I do wonder if in the longer term we'd want to build "real" proofs somehow. This could be done by deploying some "test wallet" and executing a real transaction against it. I'd leave this for the future though.

This approach has the benefit of being simple, but lacks compatibility across different versions. This is why using the deployed remote transaction prover is failing with the deserialization errors. I do think that supporting different versions might not be really useful and could be a bit tricky to maintain. An option that I thought of (which I'm not a fan) to fix this could be to add an endpoint to the provers that returns a valid transaction/batch/block to be proved, enabling us to support any remote prover version..

I think this is fine for now and I think it may be useful to see anyway that the status monitor is out of sync with the underlying network. So, I'd keep things as is.

@SantiagoPittella
Copy link
Copy Markdown
Collaborator Author

Done! I updated it to display just what's in the "status" field of a tonic error. The button copies the whole error with JSON format.

Regarding proof generation - I think using MockChain is fine for now, but I do wonder if in the longer term we'd want to build "real" proofs somehow. This could be done by deploying some "test wallet" and executing a real transaction against it. I'd leave this for the future though.

In the main issue of the network monitor, another feature is mentioned and is to send a real transaction to the network. Does that cover what you are mentioning? Because in that case we will be using a "real" transaction.

For now, let's just to transaction proofs - we can add other proof types later.

No problem, for the future: do we want to generate the proposed batch/block in any particular fashion?

Screenshot 2025-09-23 at 15 24 00

@SantiagoPittella
Copy link
Copy Markdown
Collaborator Author

This is how it looks after removing the tests from non-transaction provers.
Screenshot 2025-09-23 at 15 34 55

@bobbinth
Copy link
Copy Markdown
Contributor

Done! I updated it to display just what's in the "status" field of a tonic error. The button copies the whole error with JSON format.

Nice! Another UI question: in the RPC card, is there not enough space to show the full genesis block hash? (it feels like it should almost fit there).

In the main issue of the network monitor, another feature is mentioned and is to send a real transaction to the network. Does that cover what you are mentioning? Because in that case we will be using a "real" transaction.

I think these are separate because this would test the full flow (not just the remote prover). But we could probably use the transaction we generate there to submit to the remote prover as well. This way, we'll test both things.

No problem, for the future: do we want to generate the proposed batch/block in any particular fashion?

Not sure yet. Maybe we use the "real" transaction discussed above to build a single-transaction batch, and then build a single-batch block. But also, this is fairly far away - so, things could change.

@SantiagoPittella
Copy link
Copy Markdown
Collaborator Author

SantiagoPittella commented Sep 24, 2025

Nice! Another UI question: in the RPC card, is there not enough space to show the full genesis block hash? (it feels like it should almost fit there).

I'm pasting an image of how it looks with this change (without fixing the card width), the part of the commitment that is being displayed is ~2/3 of the whole commitment. I think that it is too large, we can fit it but making the card that wide will make us to have a lot of free space. Having the short version + the copy button looks better IMO and functionality-wise is the same information.

Screenshot 2025-09-24 at 15 02 09

@bobbinth
Copy link
Copy Markdown
Contributor

I'm pasting an image of how it looks with this change (without fixing the card width), the part of the commitment that is being displayed is ~2/3 of the whole commitment. I think that it is too large, we can fit it but making the card that wide will make us to have a lot of free space. Having the short version + the copy button looks better IMO and functionality-wise is the same information.

Yes, agreed - let's keep the truncated version. One small suggestion: I'd probably prefix it with 0x.

Separately - what's outstanding on this PR? Or are we just waiting for more reviews on it?

Comment thread bin/network-monitor/src/remote_prover.rs Outdated
@SantiagoPittella
Copy link
Copy Markdown
Collaborator Author

Separately - what's outstanding on this PR? Or are we just waiting for more reviews on it?

With this last thing addressed, this PR is ready.

Copy link
Copy Markdown
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.

A very shallow review from me - but looks good! Thank you!

@bobbinth bobbinth merged commit 881576e into next Sep 25, 2025
6 checks passed
@bobbinth bobbinth deleted the santiagopittella-remote-prover-tests branch September 25, 2025 20: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.

4 participants