Update monero-oxide to the branch with the new RPC

See https://github.com/monero-oxide/monero-oxide/pull/66.

Allows us to remove the shim `simple-request 0.1` we had to define as we now
have `simple-request 0.2` in tree.
This commit is contained in:
Luke Parker
2025-09-18 19:00:10 -04:00
parent 3955f92cc2
commit d74b00b9e4
9 changed files with 105 additions and 89 deletions

138
Cargo.lock generated
View File

@@ -1379,7 +1379,7 @@ dependencies = [
"serde",
"serde_json",
"simple-request",
"std-shims",
"std-shims 0.1.5",
"subtle",
"thiserror 2.0.16",
"tokio",
@@ -1795,7 +1795,7 @@ dependencies = [
"ff-group-tests",
"group",
"hex",
"std-shims",
"std-shims 0.1.5",
"subtle",
"zeroize",
]
@@ -1806,7 +1806,7 @@ version = "0.4.99"
dependencies = [
"ciphersuite 0.4.2",
"dalek-ff-group",
"std-shims",
"std-shims 0.1.5",
"zeroize",
]
@@ -2676,7 +2676,7 @@ version = "0.6.1"
dependencies = [
"borsh",
"ciphersuite 0.4.2",
"std-shims",
"std-shims 0.1.5",
"thiserror 2.0.16",
"zeroize",
]
@@ -2688,7 +2688,7 @@ dependencies = [
"ciphersuite 0.4.2",
"dkg",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.5",
"zeroize",
]
@@ -2714,7 +2714,7 @@ dependencies = [
"rand_chacha 0.3.1",
"rand_core 0.6.4",
"secq256k1",
"std-shims",
"std-shims 0.1.5",
"thiserror 2.0.16",
"zeroize",
]
@@ -2729,7 +2729,7 @@ dependencies = [
"dkg-recovery",
"multiexp",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.5",
"thiserror 2.0.16",
"zeroize",
]
@@ -2800,7 +2800,7 @@ dependencies = [
"ff",
"group",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.99",
"subtle",
"zeroize",
]
@@ -2913,7 +2913,7 @@ dependencies = [
"prime-field",
"rand_core 0.6.4",
"short-weierstrass",
"std-shims",
"std-shims 0.1.5",
"typenum",
"zeroize",
]
@@ -3371,7 +3371,7 @@ dependencies = [
"rand_core 0.6.4",
"schnorr-signatures",
"schnorrkel",
"std-shims",
"std-shims 0.1.5",
"zeroize",
]
@@ -3547,7 +3547,7 @@ dependencies = [
"flexible-transcript",
"multiexp",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.99",
"zeroize",
]
@@ -3558,7 +3558,7 @@ source = "git+https://github.com/monero-oxide/monero-oxide?rev=dc1b3dbe436aae61e
dependencies = [
"ciphersuite 0.4.99",
"generalized-bulletproofs",
"std-shims",
"std-shims 0.1.99",
"zeroize",
]
@@ -3570,7 +3570,7 @@ dependencies = [
"ciphersuite 0.4.99",
"generalized-bulletproofs-circuit-abstraction",
"generic-array 1.2.0",
"std-shims",
"std-shims 0.1.99",
]
[[package]]
@@ -4051,6 +4051,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
"webpki-roots 1.0.2",
]
[[package]]
@@ -4271,7 +4272,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
"equivalent",
"hashbrown 0.15.5",
"hashbrown 0.16.0",
"serde",
"serde_core",
]
@@ -5431,7 +5432,7 @@ dependencies = [
"schnorr-signatures",
"serde_json",
"sha2 0.10.9",
"std-shims",
"std-shims 0.1.5",
"subtle",
"thiserror 2.0.16",
"zeroize",
@@ -5459,7 +5460,7 @@ dependencies = [
[[package]]
name = "monero-address"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"monero-base58",
@@ -5471,36 +5472,36 @@ dependencies = [
[[package]]
name = "monero-base58"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"monero-primitives",
"std-shims",
"std-shims 0.1.99",
]
[[package]]
name = "monero-borromean"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"monero-generators",
"monero-io",
"monero-primitives",
"std-shims",
"std-shims 0.1.99",
"zeroize",
]
[[package]]
name = "monero-bulletproofs"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"monero-generators",
"monero-io",
"monero-primitives",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.99",
"thiserror 2.0.16",
"zeroize",
]
@@ -5508,7 +5509,7 @@ dependencies = [
[[package]]
name = "monero-clsag"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"dalek-ff-group",
@@ -5520,16 +5521,31 @@ dependencies = [
"monero-primitives",
"rand_chacha 0.3.1",
"rand_core 0.6.4",
"std-shims",
"std-shims 0.1.99",
"subtle",
"thiserror 2.0.16",
"zeroize",
]
[[package]]
name = "monero-daemon-rpc"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"hex",
"monero-address",
"monero-interface",
"monero-oxide",
"serde",
"serde_json",
"std-shims 0.1.99",
]
[[package]]
name = "monero-generators"
version = "0.4.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"crypto-bigint 0.5.5",
"curve25519-dalek",
@@ -5537,30 +5553,43 @@ dependencies = [
"group",
"monero-io",
"sha3 0.10.8",
"std-shims",
"std-shims 0.1.99",
"subtle",
]
[[package]]
name = "monero-interface"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"hex",
"monero-oxide",
"std-shims 0.1.99",
"thiserror 2.0.16",
"zeroize",
]
[[package]]
name = "monero-io"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"std-shims",
"std-shims 0.1.99",
"zeroize",
]
[[package]]
name = "monero-mlsag"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"monero-generators",
"monero-io",
"monero-primitives",
"std-shims",
"std-shims 0.1.99",
"thiserror 2.0.16",
"zeroize",
]
@@ -5568,7 +5597,7 @@ dependencies = [
[[package]]
name = "monero-oxide"
version = "0.1.4-alpha"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"hex-literal",
@@ -5579,47 +5608,31 @@ dependencies = [
"monero-io",
"monero-mlsag",
"monero-primitives",
"std-shims",
"std-shims 0.1.99",
"zeroize",
]
[[package]]
name = "monero-primitives"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"monero-generators",
"monero-io",
"sha3 0.10.8",
"std-shims",
"zeroize",
]
[[package]]
name = "monero-rpc"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
dependencies = [
"curve25519-dalek",
"hex",
"monero-address",
"monero-oxide",
"serde",
"serde_json",
"std-shims",
"thiserror 2.0.16",
"std-shims 0.1.99",
"zeroize",
]
[[package]]
name = "monero-simple-request-rpc"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"digest_auth",
"hex",
"monero-rpc",
"monero-daemon-rpc",
"simple-request",
"tokio",
"zeroize",
@@ -5628,7 +5641,7 @@ dependencies = [
[[package]]
name = "monero-wallet"
version = "0.1.0"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=2c847f71079a105456376f9957cee86c4b6a9eb8#2c847f71079a105456376f9957cee86c4b6a9eb8"
source = "git+https://github.com/monero-oxide/monero-oxide?rev=f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c#f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c"
dependencies = [
"curve25519-dalek",
"flexible-transcript",
@@ -5636,13 +5649,13 @@ dependencies = [
"modular-frost",
"monero-address",
"monero-clsag",
"monero-interface",
"monero-oxide",
"monero-rpc",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rand_core 0.6.4",
"rand_distr",
"std-shims",
"std-shims 0.1.99",
"thiserror 2.0.16",
"zeroize",
]
@@ -8620,7 +8633,7 @@ dependencies = [
"multiexp",
"rand_core 0.6.4",
"sha2 0.10.9",
"std-shims",
"std-shims 0.1.5",
"zeroize",
]
@@ -8743,7 +8756,7 @@ dependencies = [
"rand_core 0.6.4",
"sha2 0.11.0-rc.2",
"short-weierstrass",
"std-shims",
"std-shims 0.1.5",
]
[[package]]
@@ -9297,7 +9310,7 @@ dependencies = [
"schnorr-signatures",
"secq256k1",
"short-weierstrass",
"std-shims",
"std-shims 0.1.5",
]
[[package]]
@@ -10000,7 +10013,7 @@ dependencies = [
[[package]]
name = "simple-request"
version = "0.1.1"
version = "0.2.0"
dependencies = [
"base64ct",
"futures-util",
@@ -10719,6 +10732,13 @@ dependencies = [
"spin",
]
[[package]]
name = "std-shims"
version = "0.1.99"
dependencies = [
"std-shims 0.1.5",
]
[[package]]
name = "strsim"
version = "0.11.1"

View File

@@ -165,7 +165,7 @@ overflow-checks = true
[patch.crates-io]
# Dependencies from monero-oxide which originate from within our own tree
std-shims = { path = "patches/std-shims" }
simple-request = { path = "patches/simple-request" }
simple-request = { path = "common/request" }
multiexp = { path = "crypto/multiexp" }
flexible-transcript = { path = "crypto/transcript" }
ciphersuite = { path = "patches/ciphersuite" }

View File

@@ -28,8 +28,8 @@ dalek-ff-group = { path = "../../crypto/dalek-ff-group", default-features = fals
dkg = { package = "dkg-evrf", path = "../../crypto/dkg/evrf", default-features = false, features = ["std", "ed25519"] }
frost = { package = "modular-frost", path = "../../crypto/frost", default-features = false }
monero-wallet = { git = "https://github.com/monero-oxide/monero-oxide", rev = "2c847f71079a105456376f9957cee86c4b6a9eb8", default-features = false, features = ["std", "multisig"] }
monero-simple-request-rpc = { git = "https://github.com/monero-oxide/monero-oxide", rev = "2c847f71079a105456376f9957cee86c4b6a9eb8", default-features = false }
monero-wallet = { git = "https://github.com/monero-oxide/monero-oxide", rev = "f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c", default-features = false, features = ["std", "multisig"] }
monero-simple-request-rpc = { git = "https://github.com/monero-oxide/monero-oxide", rev = "f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c", default-features = false }
serai-client = { path = "../../substrate/client", default-features = false, features = ["monero"] }

View File

@@ -6,7 +6,7 @@
static ALLOCATOR: zalloc::ZeroizingAlloc<std::alloc::System> =
zalloc::ZeroizingAlloc(std::alloc::System);
use monero_simple_request_rpc::SimpleRequestRpc;
use monero_simple_request_rpc::SimpleRequestTransport;
mod primitives;
pub(crate) use crate::primitives::*;
@@ -23,7 +23,7 @@ async fn main() {
let db = bin::init();
let feed = Rpc {
rpc: loop {
match SimpleRequestRpc::new(bin::url()).await {
match SimpleRequestTransport::new(bin::url()).await {
Ok(rpc) => break rpc,
Err(e) => {
log::error!("couldn't connect to the Monero node: {e:?}");

View File

@@ -4,7 +4,8 @@ use ciphersuite::*;
use dalek_ff_group::Ed25519;
use monero_wallet::{
block::Block as MBlock, rpc::ScannableBlock as MScannableBlock, ScanError, GuaranteedScanner,
block::Block as MBlock, interface::ScannableBlock as MScannableBlock, ScanError,
GuaranteedScanner,
};
use serai_client::networks::monero::Address;

View File

@@ -1,7 +1,6 @@
use core::future::Future;
use monero_wallet::rpc::{RpcError, Rpc as RpcTrait};
use monero_simple_request_rpc::SimpleRequestRpc;
use monero_simple_request_rpc::{prelude::*, SimpleRequestTransport};
use serai_client::primitives::{network_id::ExternalNetworkId, coin::ExternalCoin, balance::Amount};
@@ -15,7 +14,7 @@ use crate::{
#[derive(Clone)]
pub(crate) struct Rpc {
pub(crate) rpc: SimpleRequestRpc,
pub(crate) rpc: MoneroDaemon<SimpleRequestTransport>,
}
impl ScannerFeed for Rpc {
@@ -31,21 +30,16 @@ impl ScannerFeed for Rpc {
type Block = Block;
type EphemeralError = RpcError;
type EphemeralError = InterfaceError;
fn latest_finalized_block_number(
&self,
) -> impl Send + Future<Output = Result<u64, Self::EphemeralError>> {
async move {
Ok(
self
.rpc
.get_height()
.await?
.checked_sub(1)
.expect("connected to an invalid Monero RPC")
.try_into()
.unwrap(),
u64::try_from(self.rpc.latest_block_number().await?)
.unwrap()
.saturating_sub(Self::CONFIRMATIONS - 1),
)
}
}
@@ -64,11 +58,11 @@ impl ScannerFeed for Rpc {
}
// Fetch all the timestamps within the window
let block_for_time_of = self.rpc.get_block_by_number(number.try_into().unwrap()).await?;
let block_for_time_of = self.rpc.block_by_number(number.try_into().unwrap()).await?;
let mut timestamps = vec![block_for_time_of.header.timestamp];
let mut parent = block_for_time_of.header.previous;
for _ in 1 .. BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW {
let parent_block = self.rpc.get_block(parent).await?;
let parent_block = self.rpc.block(parent).await?;
timestamps.push(parent_block.header.timestamp);
parent = parent_block.header.previous;
}
@@ -94,7 +88,7 @@ impl ScannerFeed for Rpc {
) -> impl Send
+ Future<Output = Result<<Self::Block as primitives::Block>::Header, Self::EphemeralError>>
{
async move { Ok(BlockHeader(self.rpc.get_block_by_number(number.try_into().unwrap()).await?)) }
async move { Ok(BlockHeader(self.rpc.block_by_number(number.try_into().unwrap()).await?)) }
}
#[rustfmt::skip] // It wants to improperly format the `async move` to a single line
@@ -103,7 +97,7 @@ impl ScannerFeed for Rpc {
number: u64,
) -> impl Send + Future<Output = Result<Self::Block, Self::EphemeralError>> {
async move {
Ok(Block(self.rpc.get_scannable_block_by_number(number.try_into().unwrap()).await?))
Ok(Block(self.rpc.scannable_block_by_number(number.try_into().unwrap()).await?))
}
}
@@ -128,7 +122,7 @@ impl ScannerFeed for Rpc {
}
impl TransactionPublisher<Transaction> for Rpc {
type EphemeralError = RpcError;
type EphemeralError = PublishTransactionError;
fn publish(
&self,

View File

@@ -7,7 +7,7 @@ use rand_chacha::ChaCha20Rng;
use ciphersuite::*;
use dalek_ff_group::Ed25519;
use monero_wallet::rpc::{FeeRate, RpcError};
use monero_wallet::interface::prelude::*;
use serai_client::{
primitives::{coin::ExternalCoin, balance::Amount},
@@ -55,7 +55,7 @@ async fn signable_transaction(
inputs: Vec<OutputFor<Rpc>>,
payments: Vec<Payment<AddressFor<Rpc>>>,
change: Option<KeyFor<Rpc>>,
) -> Result<Result<(SignableTransaction, MSignableTransaction), SendError>, RpcError> {
) -> Result<Result<(SignableTransaction, MSignableTransaction), SendError>, TransactionsError> {
assert!(inputs.len() < <Planner as TransactionPlanner<Rpc, ()>>::MAX_INPUTS);
assert!(
(payments.len() + usize::from(u8::from(change.is_some()))) <
@@ -148,7 +148,7 @@ async fn signable_transaction(
#[derive(Clone)]
pub(crate) struct Planner(pub(crate) Rpc);
impl TransactionPlanner<Rpc, ()> for Planner {
type EphemeralError = RpcError;
type EphemeralError = TransactionsError;
type SignableTransaction = SignableTransaction;
@@ -221,8 +221,9 @@ impl TransactionPlanner<Rpc, ()> for Planner {
payments: Vec<Payment<AddressFor<Rpc>>>,
change: Option<KeyFor<Rpc>>,
) -> impl Send
+ Future<Output = Result<PlannedTransaction<Rpc, Self::SignableTransaction, ()>, RpcError>>
{
+ Future<
Output = Result<PlannedTransaction<Rpc, Self::SignableTransaction, ()>, TransactionsError>,
> {
let singular_spent_output = (inputs.len() == 1).then(|| inputs[0].id());
async move {

View File

@@ -43,7 +43,7 @@ bitcoin = { version = "0.32", optional = true }
ciphersuite = { path = "../../crypto/ciphersuite", optional = true }
dalek-ff-group = { path = "../../crypto/dalek-ff-group", optional = true }
monero-address = { git = "https://github.com/monero-oxide/monero-oxide", rev = "2c847f71079a105456376f9957cee86c4b6a9eb8", version = "0.1.0", default-features = false, features = ["std"], optional = true }
monero-address = { git = "https://github.com/monero-oxide/monero-oxide", rev = "f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c", version = "0.1.0", default-features = false, features = ["std"], optional = true }
[dev-dependencies]
rand_core = "0.6"

View File

@@ -78,7 +78,7 @@ serai-env = { path = "../../common/env" }
curve25519-dalek = { version = "4", default-features = false, features = ["alloc", "zeroize"] }
bitcoin-serai = { path = "../../networks/bitcoin", default-features = false, features = ["std", "hazmat"] }
monero-address = { git = "https://github.com/monero-oxide/monero-oxide", rev = "2c847f71079a105456376f9957cee86c4b6a9eb8", default-features = false, features = ["std"] }
monero-address = { git = "https://github.com/monero-oxide/monero-oxide", rev = "f6f4dd7dc5b7c6e057b2eac2ec4980bb7a1c707c", default-features = false, features = ["std"] }
[features]
default = []