Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f19bb03

Browse files
committedFeb 26, 2025
feat: non inclusive start block
1 parent 18fbeaa commit f19bb03

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed
 

‎crates/aggchain-proof-builder/src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ pub struct AggchainProofBuilderRequest {
3939
/// Aggregated full execution proof for the number of aggregated block
4040
/// spans.
4141
pub agg_span_proof: SP1ProofWithPublicValues,
42-
/// First block in the aggregated span.
42+
// Start block of the aggregated span proof. This block must match the end_block of the last
43+
// proof. Even if it's needed in the input to match the previous one this block it's
44+
// already proven. Therefore proving goes from start_block+1 to end_block both inclusive.
45+
// Proof (start_block, end_block]
4346
pub start_block: u64,
4447
/// Last block in the aggregated span (inclusive).
4548
pub end_block: u64,
@@ -61,7 +64,7 @@ pub struct AggchainProofBuilderRequest {
6164
pub struct AggchainProofBuilderResponse {
6265
/// Generated aggchain proof for the block range.
6366
pub proof: SP1Proof,
64-
/// First block included in the aggchain proof.
67+
/// Start block of the aggregated span proof.
6568
pub start_block: u64,
6669
/// Last block included in the aggchain proof.
6770
pub end_block: u64,

‎crates/aggchain-proof-service/src/service.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::error::Error;
2222
#[derive(Default, Clone, Debug)]
2323
#[allow(unused)]
2424
pub struct AggchainProofServiceRequest {
25-
/// Aggchain proof starting block
25+
/// Start block of the aggregated span proof.
2626
pub start_block: u64,
2727
/// Max number of blocks that the aggchain proof is allowed to contain
2828
pub max_block: u64,
@@ -44,7 +44,7 @@ pub struct AggchainProofServiceResponse {
4444
/// Aggchain proof generated by the `aggchain-proof-builder` service
4545
/// per `agg-sender` request.
4646
pub proof: SP1Proof,
47-
/// First block in the aggchain proof.
47+
/// Start block of the aggregated span proof.
4848
pub start_block: u64,
4949
/// Last block in the aggchain proof (inclusive).
5050
pub end_block: u64,
Binary file not shown.

‎crates/aggkit-prover-types/src/generated/aggkit.prover.v1.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
/// The request message for generating aggchain proof.
33
#[derive(Clone, PartialEq, ::prost::Message)]
44
pub struct GenerateAggchainProofRequest {
5-
/// The start block for which the aggchain proof is requested.
5+
/// Start block of the aggchain proof. This block must match the end_block of the last proof.
6+
/// Even if it's needed in the input to match the previous one this block it's already proven.
7+
/// Therefore proving goes from start_block+1 to end_block both inclusive.
8+
/// Proof (start_block, end_block]
69
#[prost(uint64, tag = "1")]
710
pub start_block: u64,
811
/// The max end block for which the aggchain proof is requested.
@@ -35,7 +38,7 @@ pub struct GenerateAggchainProofResponse {
3538
/// Aggchain proof.
3639
#[prost(bytes = "vec", tag = "1")]
3740
pub aggchain_proof: ::prost::alloc::vec::Vec<u8>,
38-
/// The start block of the aggchain proof.
41+
/// Start block of the aggregated span proof.
3942
#[prost(uint64, tag = "2")]
4043
pub start_block: u64,
4144
/// The end block of the aggchain proof.

‎crates/aggkit-prover/src/rpc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl AggchainProofGrpcService for GrpcService {
3737
request: Request<GenerateAggchainProofRequest>,
3838
) -> Result<Response<GenerateAggchainProofResponse>, Status> {
3939
let request = request.into_inner();
40-
if request.max_end_block < request.start_block {
40+
if request.max_end_block <= request.start_block {
4141
let mut error = ErrorDetails::new();
4242
error.add_bad_request_violation(
4343
"max_end_block",

‎proto/aggkit/prover/v1/aggchain_proof_generation.proto

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ service AggchainProofService {
1010

1111
// The request message for generating aggchain proof.
1212
message GenerateAggchainProofRequest {
13-
// The start block for which the aggchain proof is requested.
13+
// Start block of the aggchain proof. This block must match the end_block of the last proof.
14+
// Even if it's needed in the input to match the previous one this block it's already proven.
15+
// Therefore proving goes from start_block+1 to end_block both inclusive.
16+
// Proof (start_block, end_block]
1417
uint64 start_block = 1;
1518
// The max end block for which the aggchain proof is requested.
1619
uint64 max_end_block = 2;
@@ -30,7 +33,7 @@ message GenerateAggchainProofRequest {
3033
message GenerateAggchainProofResponse {
3134
// Aggchain proof.
3235
bytes aggchain_proof = 1;
33-
// The start block of the aggchain proof.
36+
// Start block of the aggregated span proof.
3437
uint64 start_block = 2;
3538
// The end block of the aggchain proof.
3639
uint64 end_block = 3;

0 commit comments

Comments
 (0)