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
Monero protocol messages added #164
Conversation
/** | ||
* Structure representing Monero public address | ||
*/ | ||
message MoneroAccountPublicAddress { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the m_
prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep why not. I took the field naming from the original Monero code but I don't like it either so I am happy to change it.
protob/messages-monero.proto
Outdated
optional bytes out_key = 1; | ||
optional bytes tx_pub_key = 2; | ||
repeated bytes additional_tx_pub_keys = 3; | ||
optional uint64 m_internal_output_index = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the m_
prefix.
protob/messages-monero.proto
Outdated
* @next MoneroDiagResp | ||
* @next MoneroRespError | ||
*/ | ||
message MoneroDiag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this in production code? If not, I would rename these messages to contain Debug
prefix to make it obvious they don't belong to production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to discuss this. It is not needed for the production code.
So prefixing with Debug and leaving it in the messages-monero.proto
is OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is whether we still need these messages or if they were only useful for development and are no longer necessary once the code has been written. If they are still needed, let's use the Debug
prefix and keep them in messages-monero
proto file. If they are not needed, I would drop them completely.
884aa7d
to
ecc2c5d
Compare
What's the difference between |
|
Let's unify to I would also expand Also I don't understand the |
The Mlsag stands for The long message name version would thus be |
I think I will need some benchmarking w.r.t. abbreviations expansions. I am not sure whether to expand The question is whether aforementioned message should be named Some field names are taken directly from the Monero serialization schemes, e.g., The thing is I would like to preserve message field names for these serialization schemes as data could be serialized also in JSON and having different field names could ruin the deserialization and cause pain later. This is the case for RPC JSON and KV serialization used e.g., in the wallet files. These cases affect monero-glue code, not trezor-core.monero but the question is whether we want to have different field names for same messages here. E.g. I used field name However, considering only protobuf protocol messages - they can be quite isolated from Monero scheme messages. So we can do big changes without much pain. But the code in trezor-core is more tightly coupled to classical Monero scheme messages. |
I agree that we don't want to expand everything and it makes sense to leave the field names as is - to reflect their counterparts in Monero code. I propose the following changes: a) change To discuss: d) can we drop e) most of other coins follow the What do you think? |
Yep makes sense! I am on it. d) definitely, in production there should not be stack trace. I can remove this message completely. e) I can switch it to |
661287b
to
a6f108c
Compare
refactoring finished |
I merged the PR, thanks! I did some refactoring after the merge too (in a5e6dff ):
I don't think we need |
Thanks for the merge!
Regarding the wrapping messages - I find it more clear to have the whole
protocol encapsulated in the particular wrapping message. There is only one
message handler registered for the particular purpose (tx sign, ki sync)
and the protocol sub-message multiplexing is hidden in the protocol
handler. For tx sign I would need to register 7 different request handlers,
route it to the single tx sign handler and do the message multiplexing
again. I found this approach more messy.
The protocols for tx sign and ki sync are stateful, so it also made sense
to tie the messages together in the wrapping request message and hide
undrelying multistep logic in ththe handler.
Moreover it is easy to extend the protocol with the common request fields
if needed in the future.
Regarding the embedded messages - I will check how the imports work in the
trezor-core code. If that works well after the changes. But I guess the
embedded messages are still OK to import.
ne 22. 7. 2018 v 20:07 odesílatel Pavol Rusnak <notifications@github.com>
napsal:
… I merged the PR, thanks!
I did some refactoring after the merge too (in a5e6dff
<a5e6dff>
):
1.
I used nested messages, we haven't use this before, but it really
unclutters the definition by hiding definitions used in exactly one place
into the message itself.
2.
I dropped the @Prev directive from the comments, it's superfluous.
I don't think we need MoneroTransactionSignRequest and
MoneroKeyImageSyncRequest. Why not use the messages they wrap directly?
If you I agree, I'll just drop them from the definition.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#164 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAQWaUBAKqiEBcl0WBw7PpgRxNFWaHpks5uJL92gaJpZM4VLDMl>
.
|
Maybe the wrapping messages will make more sense after I make PR to trezor-core so the benefit is visible from the code. |
We did the same trick for other messages and currently, there is no difference in trezor-core code whether the messages are nested or not.
OK. |
Initial Monero Protocol messages: