Skip to content
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
2 changes: 1 addition & 1 deletion atoma-proxy-service/src/handlers/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub async fn update_node_attestation(
})?;
let mut hasher = blake2::Blake2b::new();
hasher.update(update_attestation.node_small_id.to_le_bytes());
hasher.update(&update_attestation.attestation);
hasher.update(&update_attestation.compressed_evidence);
let attestation_hash: [u8; 32] = hasher.finalize().into();

match signature_scheme {
Expand Down
2 changes: 2 additions & 0 deletions atoma-state/src/migrations/20250728113130_rename-column.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE node_attestations
RENAME COLUMN attestation TO compressed_evidence;
6 changes: 3 additions & 3 deletions atoma-state/src/state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,14 +1218,14 @@ impl AtomaState {
#[instrument(level = "trace", skip_all, fields(node_small_id = %attestation.node_small_id))]
pub async fn update_node_attestation(&self, attestation: NodeAttestation) -> Result<()> {
sqlx::query(
"INSERT INTO node_attestations (node_small_id, attestation)
"INSERT INTO node_attestations (node_small_id, compressed_evidence)
VALUES ($1, $2)
ON CONFLICT (node_small_id) DO UPDATE SET
attestation = EXCLUDED.attestation,
compressed_evidence = EXCLUDED.compressed_evidence,
updated_at = NOW()",
)
.bind(attestation.node_small_id)
.bind(attestation.attestation)
.bind(attestation.compressed_evidence)
.execute(&self.db)
.await?;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion atoma-state/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ pub struct NodePublicKey {
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromRow, ToSchema)]
pub struct NodeAttestation {
pub node_small_id: i64,
pub attestation: Vec<u8>,
pub compressed_evidence: Vec<u8>,
}

pub enum AtomaAtomaStateManagerEvent {
Expand Down