Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Dec 31, 2024
1 parent 666290a commit 9b35540
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
7 changes: 3 additions & 4 deletions proposer/op/proposer/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,14 @@ func (l *L2OutputSubmitter) GetProofStatus(proofId string) (ProofStatusResponse,
Error string `json:"error"`
}
if err := json.Unmarshal(body, &errResp); err == nil {
l.Log.Error("Get proof status request failed",
l.Log.Error("Failed to get proof status",
"status", resp.StatusCode,
"error", errResp.Error)
} else {
l.Log.Error("Get proof status request failed",
l.Log.Error("Failed to get unmarshal proof status error message",
"status", resp.StatusCode,
"body", string(body))
"body", body)
}
l.Metr.RecordWitnessGenFailure("Failed")
return ProofStatusResponse{}, fmt.Errorf("received non-200 status code: %d", resp.StatusCode)
}

Expand Down
2 changes: 1 addition & 1 deletion proposer/op/proposer/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (l *L2OutputSubmitter) GetL1HeadForL2Block(ctx context.Context, rollupClien
return 0, fmt.Errorf("could not find an L1 block with an L2 safe head greater than the L2 end block")
}

func (l *L2OutputSubmitter) isSafeDBActivated(ctx context.Context, rollupClient *sources.RollupClient) (bool, error) {
func (l *L2OutputSubmitter) IsSafeDBActivated(ctx context.Context, rollupClient *sources.RollupClient) (bool, error) {
// Get the sync status of the rollup node.
status, err := rollupClient.SyncStatus(ctx)
if err != nil {
Expand Down
18 changes: 15 additions & 3 deletions proposer/succinct/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ pub const AGG_ELF: &[u8] = include_bytes!("../../../elf/aggregation-elf");

#[tokio::main]
async fn main() -> Result<()> {
// Set up the SP1 SDK logger.
utils::setup_logger();

// Enable logging.
env::set_var("RUST_LOG", "info");

dotenv::dotenv().ok();

let prover = ProverClient::new();
Expand Down Expand Up @@ -264,19 +268,27 @@ async fn request_agg_proof(
Ok(bytes) => bytes,
Err(e) => {
error!("Failed to decode L1 head hex string: {}", e);
return Err(AppError(anyhow::anyhow!("Failed to decode L1 head hex string: {}", e)));
return Err(AppError(anyhow::anyhow!(
"Failed to decode L1 head hex string: {}",
e
)));
}
},
None => {
error!("Invalid L1 head format: missing 0x prefix");
return Err(AppError(anyhow::anyhow!("Invalid L1 head format: missing 0x prefix")));
return Err(AppError(anyhow::anyhow!(
"Invalid L1 head format: missing 0x prefix"
)));
}
};

let l1_head: [u8; 32] = match l1_head_bytes.try_into() {
Ok(array) => array,
Err(_) => {
error!("Invalid L1 head length: expected 32 bytes, got {}", l1_head_bytes.len());
error!(
"Invalid L1 head length: expected 32 bytes, got {}",
l1_head_bytes.len()
);
return Err(AppError(anyhow::anyhow!(
"Invalid L1 head length: expected 32 bytes, got {}",
l1_head_bytes.len()
Expand Down

0 comments on commit 9b35540

Please sign in to comment.