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

feat(tee): use hex deserialization for RPC requests #209

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/verify-era-proof-attestation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jsonrpsee-types.workspace = true
reqwest.workspace = true
secp256k1.workspace = true
serde.workspace = true
serde_with = { workspace = true, features = ["hex"] }
teepot.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions bin/verify-era-proof-attestation/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use anyhow::{bail, Result};
use jsonrpsee_types::error::ErrorObject;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_with::{hex::Hex, serde_as};
use std::time::Duration;
use tokio::sync::watch;
use tracing::{error, warn};
Expand Down Expand Up @@ -146,14 +147,19 @@ pub struct GetProofsResponse {
pub error: Option<ErrorObject<'static>>,
}

#[serde_as]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Proof {
pub l1_batch_number: u32,
pub tee_type: String,
#[serde_as(as = "Hex")]
pub pubkey: Vec<u8>,
#[serde_as(as = "Hex")]
pub signature: Vec<u8>,
#[serde_as(as = "Hex")]
pub proof: Vec<u8>,
pub proved_at: String,
#[serde_as(as = "Hex")]
pub attestation: Vec<u8>,
}