Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ mod test {
reward: 10000,
target_difficulty: 600000,
total_fees: 100,
algo: Some(grpc::PowAlgo { pow_algo: 0 }),
algo: Some(grpc::PowAlgo { pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into() }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test data should reflect the correct algorithm for merge mining, which is Randomxm. Using Randomxt here aligns with the incorrect change in the production code.

Suggested change
algo: Some(grpc::PowAlgo { pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into() }),
algo: Some(grpc::PowAlgo { pow_algo: grpc::pow_algo::PowAlgos::Randomxm.into() }),

};
let btdb = BlockTemplateDataBuilder::new()
.monero_seed(FixedByteArray::new())
Expand Down Expand Up @@ -294,7 +294,7 @@ mod test {
reward: 10000,
target_difficulty: 600000,
total_fees: 100,
algo: Some(grpc::PowAlgo { pow_algo: 0 }),
algo: Some(grpc::PowAlgo { pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into() }),
};
let btdb = BlockTemplateDataBuilder::new()
.monero_seed(FixedByteArray::new())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl BlockTemplateManager<'_> {
let block = match self.p2pool_client.as_mut() {
Some(client) => {
let pow_algo = PowAlgo {
pow_algo: PowAlgos::Randomxm.into(),
pow_algo: PowAlgos::Randomxt.into(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Switching the proof-of-work algorithm from Randomxm (RandomX-Monero) to Randomxt (RandomX-Tari) in the production code will likely break Monero merge mining. In the Tari protocol, Randomxm is specifically used for blocks that are merge-mined with Monero, as it instructs the base node to verify the Monero header and the embedded merge mining hash. Randomxt is intended for standalone RandomX mining and uses a different verification logic that does not account for Monero headers. Since this proxy still performs Monero-specific operations (like add_monero_data), it should continue to use Randomxm for actual merge mining.

Suggested change
pow_algo: PowAlgos::Randomxt.into(),
pow_algo: PowAlgos::Randomxm.into(),

};
let coinbase_extra = if self.config.coinbase_extra.trim().is_empty() {
String::new()
Expand Down Expand Up @@ -211,7 +211,7 @@ impl BlockTemplateManager<'_> {
.base_node_client
.get_new_block_template(grpc::NewBlockTemplateRequest {
algo: Some(grpc::PowAlgo {
pow_algo: grpc::pow_algo::PowAlgos::Randomxm.into(),
pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

As noted previously, changing the algorithm to Randomxt here will cause the base node to return a block template configured for standalone mining rather than Monero merge mining. This will result in PoW verification failures when the proxy submits the merged Monero/Tari block to the base node.

Suggested change
pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into(),
pow_algo: grpc::pow_algo::PowAlgos::Randomxm.into(),

}),
max_weight: 0,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub async fn start_merge_miner(cli: Cli) -> Result<(), anyhow::Error> {
async fn verify_base_node_responses(node_conn: &mut BaseNodeGrpcClient) -> Result<(), MmProxyError> {
if let Err(e) = verify_base_node_grpc_mining_responses(node_conn, grpc::NewBlockTemplateRequest {
algo: Some(grpc::PowAlgo {
pow_algo: grpc::pow_algo::PowAlgos::Randomxm.into(),
pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The verification of base node responses should remain consistent with the intended merge mining algorithm (Randomxm). Changing this to Randomxt might pass the initial gRPC check if the node supports both, but it misrepresents the proxy's operational mode.

Suggested change
pow_algo: grpc::pow_algo::PowAlgos::Randomxt.into(),
pow_algo: grpc::pow_algo::PowAlgos::Randomxm.into(),

}),
max_weight: 0,
})
Expand Down
11 changes: 0 additions & 11 deletions integration_tests/src/merge_mining_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ impl MergeMiningProxyProcess {
"merge_mining_proxy.base_node_grpc_address".to_string(),
format!("http://127.0.0.1:{base_node_grpc_port}"),
),
(
"merge_mining_proxy.monerod_url".to_string(),
[
"http://stagenet.xmr-tw.org:38081",
"http://node.monerodevs.org:38089",
"http://node3.monerodevs.org:38089",
"http://xmr-lux.boldsuck.org:38081",
"http://singapore.node.xmr.pm:38081",
]
.join(","),
),
("merge_mining_proxy.monerod_use_auth".to_string(), "false".to_string()),
("merge_mining_proxy.monerod_username".to_string(), "".to_string()),
("merge_mining_proxy.monerod_password".to_string(), "".to_string()),
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/tests/features/MergeMining.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@merge-mining @base-node
Feature: Merge Mining

@broken
@critical
Scenario: Merge Mining Functionality Test Without Submitting To Origin
Given I have a seed node NODE
When I have wallet WALLET connected to all seed nodes
Expand Down