From b50a00326b763d50144ba4d6c8118db8de1a4e1a Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sat, 17 Feb 2024 17:32:20 +0000 Subject: [PATCH 1/2] chore!: remove `deprecated_serialize_commitment` from API --- ffi_interface/src/lib.rs | 3 +-- ffi_interface/src/serialization.rs | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ffi_interface/src/lib.rs b/ffi_interface/src/lib.rs index 286d692..49df438 100644 --- a/ffi_interface/src/lib.rs +++ b/ffi_interface/src/lib.rs @@ -2,9 +2,8 @@ mod serialization; // TODO: These are re-exported to not break the java code // TODO: we ideally don't want to export these. -// - deprecated_serialize_commitment will be deprecated // - deserialize_update_commitment_sparse should not be exported and is an abstraction leak -pub use serialization::{deprecated_serialize_commitment, deserialize_update_commitment_sparse}; +pub use serialization::deserialize_update_commitment_sparse; use banderwagon::Element; use banderwagon::Fr; diff --git a/ffi_interface/src/serialization.rs b/ffi_interface/src/serialization.rs index f8de852..667c1e0 100644 --- a/ffi_interface/src/serialization.rs +++ b/ffi_interface/src/serialization.rs @@ -63,12 +63,6 @@ pub fn deserialize_update_commitment_sparse( Ok((commitment_bytes, indexes, old_scalars, new_scalars)) } -/// This is kept so that commitRoot in the java implementation can be swapped out -/// Note: I believe we should not need to expose this method. -pub fn deprecated_serialize_commitment(commitment: CommitmentBytes) -> [u8; 32] { - Element::from_bytes_unchecked_uncompressed(commitment).to_bytes() -} - #[must_use] pub(crate) fn deserialize_proof_query(bytes: &[u8]) -> ProverQuery { // Commitment From dd4e9c637745e94d529964184d5a3162748abfcc Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sat, 17 Feb 2024 20:55:49 +0000 Subject: [PATCH 2/2] change expected output in interop test vector --- verkle-trie/tests/golang_interop.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verkle-trie/tests/golang_interop.rs b/verkle-trie/tests/golang_interop.rs index 02cf666..c8bac0d 100644 --- a/verkle-trie/tests/golang_interop.rs +++ b/verkle-trie/tests/golang_interop.rs @@ -60,9 +60,9 @@ fn golang_rust_interop() { trie.insert(key_vals); - let root = trie.root_commitment(); + let root = trie.root_hash(); - let expected = "10ed89d89047bb168baa4e69b8607e260049e928ddbcb2fdd23ea0f4182b1f8a"; + let expected = "4caf7631af042c1615845a0116e789de0beea3e07f4b947377101aa822964614"; use banderwagon::trait_defs::*; let mut root_bytes = [0u8; 32];