Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce prove RPC method #1335

Merged
merged 16 commits into from
Oct 16, 2024
Merged

Introduce prove RPC method #1335

merged 16 commits into from
Oct 16, 2024

Conversation

rakanalh
Copy link
Contributor

@rakanalh rakanalh commented Oct 14, 2024

Description

  • Add the RPC method
  • Write a test

Linked Issues

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 76.78883% with 133 lines in your changes missing coverage. Please review.

Project coverage is 78.1%. Comparing base (dcfda45) to head (0851ac5).
Report is 1 commits behind head on nightly.

Files with missing lines Patch % Lines
crates/prover/src/proving.rs 88.4% 39 Missing ⚠️
crates/prover/src/rpc.rs 57.3% 38 Missing ⚠️
crates/prover/src/da_block_handler.rs 50.8% 30 Missing ⚠️
crates/prover/src/errors.rs 0.0% 20 Missing ⚠️
crates/fullnode/src/da_block_handler.rs 73.3% 4 Missing ⚠️
crates/common/src/da.rs 95.6% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
crates/common/src/utils.rs 87.9% <ø> (-1.9%) ⬇️
crates/prover/src/lib.rs 50.0% <ø> (ø)
crates/prover/src/runner.rs 90.1% <100.0%> (+0.4%) ⬆️
...ule-system/sov-modules-rollup-blueprint/src/lib.rs 100.0% <ø> (ø)
...eign-sdk/rollup-interface/src/state_machine/stf.rs 26.3% <ø> (ø)
crates/common/src/da.rs 95.8% <95.6%> (-0.4%) ⬇️
crates/fullnode/src/da_block_handler.rs 72.7% <73.3%> (-1.3%) ⬇️
crates/prover/src/errors.rs 0.0% <0.0%> (ø)
crates/prover/src/da_block_handler.rs 75.4% <50.8%> (-6.3%) ⬇️
crates/prover/src/rpc.rs 50.7% <57.3%> (+43.3%) ⬆️
... and 1 more

Copy link
Member

@eyusufatik eyusufatik left a comment

Choose a reason for hiding this comment

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

everything else LGTM

crates/prover/src/rpc/utils.rs Outdated Show resolved Hide resolved
@rakanalh rakanalh requested a review from eyusufatik October 15, 2024 12:03
Copy link
Contributor

@yaziciahmet yaziciahmet left a comment

Choose a reason for hiding this comment

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

Why do we need this functionality? It seems pretty risky and not so useful to me tbh.

With the current rpc implementation, anyone can invoke a proving process. If someone is set out to bankrupt us, he can invoke proving the moment they see a sequencer commitment proof in DA, and force us to prove only 1 commitment, causing us a lot of money from both proving and paying fee to DA side.

Even if this problem was to be solved, I can't see the use of this functionality.

UPDATE:

I learned that the prover is not public to the internet. So a random person can not invoke this rpc. But I am still skeptical of this feature as this still relies on the human (us) intervention, and a small mistake can cause a lot. If we want to prove a certain commitment right away without waiting for sampling, it makes more sense to lower the sampling config number and restart the prover for one time.

crates/common/src/da.rs Outdated Show resolved Hide resolved
crates/prover/src/runner.rs Outdated Show resolved Hide resolved
crates/prover/src/da_block_handler.rs Outdated Show resolved Hide resolved
crates/prover/src/da_block_handler.rs Outdated Show resolved Hide resolved
crates/prover/src/proving.rs Outdated Show resolved Hide resolved
crates/prover/src/rpc.rs Outdated Show resolved Hide resolved
crates/prover/src/proving.rs Show resolved Hide resolved
@yaziciahmet
Copy link
Contributor

yaziciahmet commented Oct 16, 2024

Also a question, what happens if prover is busy proving a commitment at l1 block 100, but there are commitments at 150 and 200. Someone invoked the commitment at l1 block 200? Do we break the assumption of ordered proofs on DA? If so it might be problematic on the light client and bridge side.

@eyusufatik
Copy link
Member

Also a question, what happens if prover is busy proving a commitment at l1 block 100, but there are commitments at 150 and 200. Someone invoked the commitment at l1 block 200? Do we break the assumption of ordered proofs on DA, if so it might be problematic on the light client and bridge side.

prove rpc is useful when we do proof sampling and we find some interesting sequencer commitments that we want to prove.

So if there is no proof sampling we wont use the RPC

@yaziciahmet
Copy link
Contributor

prove rpc is useful when we do proof sampling and we find some interesting sequencer commitments that we want to prove.
So if there is no proof sampling we wont use the RPC

@eyusufatik

UPDATE:
I learned that the prover is not public to the internet. So a random person can not invoke this rpc. But I am still skeptical of this feature as this still relies on the human (us) intervention, and a small mistake can cause a lot. If we want to prove a certain commitment right away without waiting for sampling, it makes more sense to lower the sampling config number and restart the prover for one time.

Copy link
Member

@eyusufatik eyusufatik left a comment

Choose a reason for hiding this comment

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

great refactor in the latest commits.

bin/citrea/tests/e2e/proving.rs Show resolved Hide resolved
@eyusufatik
Copy link
Member

I learned that the prover is not public to the internet. So a random person can not invoke this rpc. But I am still skeptical of this feature as this still relies on the human (us) intervention, and a small mistake can cause a lot. If we want to prove a certain commitment right away without waiting for sampling, it makes more sense to lower the sampling config number and restart the prover for one time.

the thing is, that's also something we have to implement :) and it's not worth the time spent on shutting down the prover and restarting etc.

having this RPC is really helpful while we still have proof sampling.

crates/common/src/da.rs Outdated Show resolved Hide resolved
@rakanalh rakanalh merged commit 1831762 into nightly Oct 16, 2024
14 checks passed
@rakanalh rakanalh deleted the rakanalh/rpc-prove branch October 16, 2024 16:45
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.

RPC for manual proof production, in case we need to hand trigger stuff
5 participants