diff --git a/atoma-proxy-service/src/handlers/nodes.rs b/atoma-proxy-service/src/handlers/nodes.rs index 8907ff20..4baff6b2 100644 --- a/atoma-proxy-service/src/handlers/nodes.rs +++ b/atoma-proxy-service/src/handlers/nodes.rs @@ -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 { diff --git a/atoma-state/src/migrations/20250728113130_rename-column.sql b/atoma-state/src/migrations/20250728113130_rename-column.sql new file mode 100644 index 00000000..ad2ddf53 --- /dev/null +++ b/atoma-state/src/migrations/20250728113130_rename-column.sql @@ -0,0 +1,2 @@ +ALTER TABLE node_attestations +RENAME COLUMN attestation TO compressed_evidence; diff --git a/atoma-state/src/state_manager.rs b/atoma-state/src/state_manager.rs index 6e937509..cb707910 100644 --- a/atoma-state/src/state_manager.rs +++ b/atoma-state/src/state_manager.rs @@ -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(()) diff --git a/atoma-state/src/types.rs b/atoma-state/src/types.rs index c01002d1..a5f9d25e 100644 --- a/atoma-state/src/types.rs +++ b/atoma-state/src/types.rs @@ -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, + pub compressed_evidence: Vec, } pub enum AtomaAtomaStateManagerEvent {