Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Include gui and version columns in MM2.db #2047

Closed
smk762 opened this issue Jan 12, 2024 · 4 comments
Closed

[FR] Include gui and version columns in MM2.db #2047

smk762 opened this issue Jan 12, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@smk762
Copy link

smk762 commented Jan 12, 2024

The stats_swaps table currently contains only the columns listed at https://developers.komodoplatform.com/basic-docs/atomicdex/atomicdex-tutorials/query-the-mm2-database.html#stats-swaps

To derive the app gui and api version, we have to refer to the swap json files for each uuid on seed node servers. It would be nice to add columns for

  • taker_gui
  • maker_gui
  • taker_version
  • maker_version
@shamardy shamardy added the enhancement New feature or request label Feb 5, 2024
@mariocynicys
Copy link
Collaborator

Should each side of the swap store its own gui and version only and have the seed node assemble them together?

Or should we poll the other party's gui and version and store/retrieve it from [M|T]akerSavedSwap? cc/ @shamardy

@shamardy
Copy link
Collaborator

shamardy commented Feb 7, 2024

Should each side of the swap store its own gui and version only and have the seed node assemble them together?

Yes, considering we currently don't have a way to fetch the other side's gui and version without altering the swap messages or adding new ones, it's fine for each side to keep their own gui and version. The seed nodes can then put the two together as you noted.

@shamardy
Copy link
Collaborator

shamardy commented Feb 7, 2024

Yes, considering we currently don't have a way to fetch the other side's gui and version without altering the swap messages or adding new ones, it's fine for each side to keep their own gui and version. The seed nodes can then put the two together as you noted.

Please note that for non-wasm light nodes (clients), they process swap status messages same as seed nodes but receive only the messages related to their swaps

#[cfg(not(target_arch = "wasm32"))]
return match json::from_slice::<SwapStatus>(msg) {
Ok(mut status) => {
status.data.fetch_and_set_usd_prices().await;
if let Err(e) = save_stats_swap(&ctx, &status.data).await {
error!("Error saving the swap {} status: {}", status.data.uuid(), e);
}
Ok(())
},
Err(swap_status_err) => {
let error = format!(
"Couldn't deserialize swap msg to either 'SwapMsg': {} or to 'SwapStatus': {}",
swap_msg_err, swap_status_err
);
MmError::err(P2PRequestError::DecodeError(error))
},
};
#[cfg(target_arch = "wasm32")]
return MmError::err(P2PRequestError::DecodeError(format!(
"Couldn't deserialize 'SwapMsg': {}",
swap_msg_err
)));
},

For simplicity we should keep it the same way. Hope this is clear :)

@smk762
Copy link
Author

smk762 commented Feb 18, 2024

closing as complete

@smk762 smk762 closed this as completed Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants