-
Notifications
You must be signed in to change notification settings - Fork 94
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
validate p2p messages and topics #1755
Conversation
e4f1849
to
0f3196c
Compare
2a65949
to
b259d56
Compare
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.
Thanks for this fix!
Just a note for the first view and question: Why did you choose 25 topics limit?
b259d56
to
e520117
Compare
25 topics can't hurt, and it's quite flexible value for any case I think. |
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.
Great work! got a question
mm2src/mm2_main/src/lp_ordermatch.rs
Outdated
@@ -90,7 +90,8 @@ pub use lp_bot::{start_simple_market_maker_bot, stop_simple_market_maker_bot, St | |||
|
|||
#[path = "lp_ordermatch/my_orders_storage.rs"] | |||
mod my_orders_storage; | |||
#[path = "lp_ordermatch/new_protocol.rs"] mod new_protocol; | |||
#[path = "lp_ordermatch/new_protocol.rs"] | |||
pub(crate) mod new_protocol; |
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.
It would be more clear it did not stick up, explained before
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.
Can you clarify this, didn't understand it
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.
Now it can be rolled back because stick up logic has been hidden
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.
Done
1c62cc7
to
911bc31
Compare
Signed-off-by: ozkanonur <work@onurozkan.dev>
911bc31
to
fe38f18
Compare
@@ -92,7 +92,7 @@ const ABCI_REQUEST_PROVE: bool = false; | |||
/// 0.25 is good average gas price on atom and iris | |||
const DEFAULT_GAS_PRICE: f64 = 0.25; | |||
pub(super) const TIMEOUT_HEIGHT_DELTA: u64 = 100; | |||
pub const GAS_LIMIT_DEFAULT: u64 = 100_000; | |||
pub const GAS_LIMIT_DEFAULT: u64 = 125_000; |
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.
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.
Could you document(either here in the PR comments or in the changelog) why you are changing this value?
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.
Because HTLCs requiring more gas than our limit lately. Since gas prices can be updated from the coins configuration, this should never be problem even if we make it 200_000
.
Signed-off-by: ozkanonur <work@onurozkan.dev>
42f1bf4
to
0da7d9e
Compare
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.
Thanks a lot for the fix! Only one comment for now.
Signed-off-by: ozkanonur <work@onurozkan.dev>
4d2cacc
to
292614f
Compare
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.
Just some minor comments :)
@ozkanonur please merge with latest dev that fixes the failing |
Signed-off-by: ozkanonur <work@onurozkan.dev>
…ss_maker_order_updated
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.
🔥
@rozhkovdmitrii can you please check if your comments have been fixed or not? |
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.
LGTM! Thanks!
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.
Great work and well done 🙌🏼 🔥
240506f
.find_order_by_uuid_and_pubkey(&uuid, &from_pubkey) | ||
.ok_or_else(|| MmError::new(OrderbookP2PHandlerError::OrderNotFound(uuid)))?; | ||
order.apply_updated(&updated_msg); | ||
drop_mutability!(order); |
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.
Does it require to drop mutability explicitly?
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.
drop_mutability!
is done to ensure that the order cannot be accidentally modified later in this part of the code.
* optimize p2p network layer Signed-off-by: ozkanonur <work@onurozkan.dev> * update default gas limit for tendermint Signed-off-by: ozkanonur <work@onurozkan.dev> * rollback topic limit Signed-off-by: ozkanonur <work@onurozkan.dev> * remove unused arg from `lp_ordermatch::process_msg` Signed-off-by: ozkanonur <work@onurozkan.dev> * use OrderbookP2PHandlerResult for process_orders_keep_alive and process_maker_order_updated * return one error for failed SwapMsg, SwapStatus deserialization * fix process_swap_msg in wasm to return error if SwapMsg can't be deserialized * remove additional space in SwapMsg, SwapStatus decode error message * roll back crate visibility for new_protocol mod --------- Signed-off-by: ozkanonur <work@onurozkan.dev> Co-authored-by: shamardy <shamardy@yahoo.com>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Applies the following checks:
Avoid decoding messages that have more than 25 topicsSWAP_PREFIX
,WATCHER_PREFIX
,TX_HELPER_PREFIX
topic.