diff --git a/Cargo.lock b/Cargo.lock index 0985b319db..fecc9441c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1104,6 +1104,7 @@ dependencies = [ "bytes", "console_error_panic_hook", "const-hex", + "crdts", "evmlib", "eyre", "futures", @@ -8735,6 +8736,7 @@ dependencies = [ "libp2p 0.54.1", "prometheus-client", "prost 0.9.0", + "pyo3", "rand 0.8.5", "rayon", "reqwest 0.12.7", diff --git a/autonomi/Cargo.toml b/autonomi/Cargo.toml index 3ac4f23e66..3c67020d14 100644 --- a/autonomi/Cargo.toml +++ b/autonomi/Cargo.toml @@ -29,6 +29,7 @@ extension-module = ["pyo3/extension-module"] bip39 = "2.0.0" bls = { package = "blsttc", version = "8.0.1" } bytes = { version = "1.0.1", features = ["serde"] } +crdts = { version = "7.3", default-features = false, features = ["merkle"] } curv = { version = "0.10.1", package = "sn_curv", default-features = false, features = [ "num-bigint", ] } diff --git a/autonomi/src/client/registers.rs b/autonomi/src/client/registers.rs index 40f79ead0b..4b1ef0e007 100644 --- a/autonomi/src/client/registers.rs +++ b/autonomi/src/client/registers.rs @@ -8,6 +8,7 @@ /// Register Secret Key pub use bls::SecretKey as RegisterSecretKey; +use crdts::merkle_reg::MerkleReg; use sn_evm::Amount; use sn_evm::AttoTokens; use sn_evm::EvmWalletError; @@ -78,6 +79,22 @@ impl Register { .collect() } + /// Get the low-level CRDT of the register + pub fn inner_merkle_reg(&self) -> &MerkleReg> { + // Unstable method according to documentation. + self.crdt_reg.merkle_reg() + } + + // Owner's PublicKey is used to verify API calls which are signed using the owner's secret key. + pub fn owner(&self) -> bls::PublicKey { + self.signed_reg.base_register().address().owner() + } + + // Permissions determine who can mutate the register. + pub fn permissions(&self) -> &RegisterPermissions { + self.signed_reg.base_register().permissions() + } + fn new( initial_value: Option, name: XorName, diff --git a/autonomi/src/lib.rs b/autonomi/src/lib.rs index 38459bf4c3..94f1f0181e 100644 --- a/autonomi/src/lib.rs +++ b/autonomi/src/lib.rs @@ -53,6 +53,8 @@ pub use utils::receipt_from_quotes_and_payments; #[doc(no_inline)] // Place this under 'Re-exports' in the docs. pub use bytes::Bytes; #[doc(no_inline)] // Place this under 'Re-exports' in the docs. +pub use crdts::merkle_reg::MerkleReg; +#[doc(no_inline)] // Place this under 'Re-exports' in the docs. pub use libp2p::Multiaddr; pub use client::Client; diff --git a/rustc-ice-2024-11-18T08_14_06-8708.txt b/rustc-ice-2024-11-18T08_14_06-8708.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_14_06-8708.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file diff --git a/rustc-ice-2024-11-18T08_18_24-12064.txt b/rustc-ice-2024-11-18T08_18_24-12064.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_18_24-12064.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file diff --git a/rustc-ice-2024-11-18T08_18_30-12286.txt b/rustc-ice-2024-11-18T08_18_30-12286.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_18_30-12286.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file diff --git a/rustc-ice-2024-11-18T08_18_40-12526.txt b/rustc-ice-2024-11-18T08_18_40-12526.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_18_40-12526.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file diff --git a/rustc-ice-2024-11-18T08_19_29-12764.txt b/rustc-ice-2024-11-18T08_19_29-12764.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_19_29-12764.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file diff --git a/rustc-ice-2024-11-18T08_20_01-12924.txt b/rustc-ice-2024-11-18T08_20_01-12924.txt new file mode 100644 index 0000000000..5de2b449ca --- /dev/null +++ b/rustc-ice-2024-11-18T08_20_01-12924.txt @@ -0,0 +1,25 @@ +thread 'rustc' panicked at compiler/rustc_serialize/src/opaque.rs:295:9: +MemDecoder exhausted +stack backtrace: + 0: 0x7ffff6948225 - std::backtrace::Backtrace::create::h830740811c52a9b2 + 1: 0x7ffff4e45315 - std::backtrace::Backtrace::force_capture::h39f383d6f7f66dd9 + 2: 0x7ffff3edaadd - std[9380d5930221374f]::panicking::update_hook::>::{closure#0} + 3: 0x7ffff4e5ca38 - std::panicking::rust_panic_with_hook::h0d54adfe474bcf89 + 4: 0x7ffff4e5c7d6 - std::panicking::begin_panic_handler::{{closure}}::h2299ba4f19c41831 + 5: 0x7ffff4e5a479 - std::sys::backtrace::__rust_end_short_backtrace::h0b6f5a727883f447 + 6: 0x7ffff4e5c4cc - rust_begin_unwind + 7: 0x7ffff18caa10 - core::panicking::panic_fmt::hde3e02c671c994c5 + 8: 0x7ffff37ff827 - ::decoder_exhausted + 9: 0x7ffff67c651a - rustc_incremental[aa659fb456e0d29d]::persist::load::setup_dep_graph + 10: 0x7ffff67cf094 - ::global_ctxt + 11: 0x7ffff64907b7 - rustc_interface[be8961cf52de7aeb]::interface::run_compiler::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1} + 12: 0x7ffff6501bd0 - std[9380d5930221374f]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>> + 13: 0x7ffff6501feb - <::spawn_unchecked_, rustc_driver_impl[8e7401167f7f949d]::run_compiler::{closure#0}>::{closure#1}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2cc023bed8c61b97]::result::Result<(), rustc_span[ae741f722bd54871]::ErrorGuaranteed>>::{closure#1} as core[2cc023bed8c61b97]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} + 14: 0x7ffff6502ab9 - std::sys::pal::unix::thread::Thread::new::thread_start::hfcef7f5cf2ae2c29 + 15: 0x7ffff0699a42 - start_thread + 16: 0x7ffff071905c - clone3 + 17: 0x0 - + + +rustc version: 1.84.0-nightly (bc5cf994d 2024-11-05) +platform: x86_64-unknown-linux-gnu \ No newline at end of file