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

[r2r] refactor p2p message processing flow #1436

Merged
merged 21 commits into from
Aug 15, 2022

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Aug 7, 2022

Solutions:

  • Jemalloc implementation for x86_64
  • Deduplicating topics
  • Spawn send_raw_tx_bytess future to avoid blocking the iterator
  • For messages with txhlp topic prefix, check if tx is valid, if not continue.

Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title [wip] refactor p2p message processing flow [r2r] refactor p2p message processing flow Aug 9, 2022
onur-ozkan and others added 3 commits August 10, 2022 00:29
Signed-off-by: ozkanonur <work@onurozkan.dev>
…ion`

Signed-off-by: ozkanonur <work@onurozkan.dev>
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! First review.

mm2src/coins/utxo/utxo_common.rs Outdated Show resolved Hide resolved
mm2src/coins/z_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_network.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_network.rs Outdated Show resolved Hide resolved
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title [r2r] refactor p2p message processing flow [wip] refactor p2p message processing flow Aug 10, 2022
artemii235
artemii235 previously approved these changes Aug 10, 2022
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

I have only one non-blocking question.

README.md Show resolved Hide resolved
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title [wip] refactor p2p message processing flow [r2r] refactor p2p message processing flow Aug 11, 2022
Signed-off-by: ozkanonur <work@onurozkan.dev>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Great work 🔥 ! Only one minor comment :)

mm2src/mm2_main/src/lp_network.rs Outdated Show resolved Hide resolved
Signed-off-by: Onur Özkan <work@onurozkan.dev>
shamardy
shamardy previously approved these changes Aug 12, 2022
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Great progress!
Please consider my suggestions

mm2src/coins/solana.rs Show resolved Hide resolved
mm2src/coins/test_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/lp_coins.rs Outdated Show resolved Hide resolved
mm2src/coins/utxo/utxo_common.rs Outdated Show resolved Hide resolved
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

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

Very good!

@sergeyboyko0791 sergeyboyko0791 merged commit 957fd85 into dev Aug 15, 2022
@sergeyboyko0791 sergeyboyko0791 deleted the workflow-optimization-on-broadcasts branch August 15, 2022 13:53
borngraced pushed a commit that referenced this pull request Aug 17, 2022
* refactor p2p message processing flow

Signed-off-by: ozkanonur <work@onurozkan.dev>

* drop `message` mutability in `process_p2p_message`

Signed-off-by: ozkanonur <work@onurozkan.dev>

* refactor `fn tx_enum_from_bytes` error type

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* check topics in `lp_topic_list_validation`

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* optimize

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* check if there is any byte left in tx deserialization

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* add backwards comparison in `fn deserialization`

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* rollback 78c6810

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* set JEMALLOC_SYS_WITH_MALLOC_CONF on build pipelines

Signed-off-by: ozkanonur <work@onurozkan.dev>

* Update README.md

* add `_` to unused variables

Signed-off-by: ozkanonur <work@onurozkan.dev>

* refactor `lp_topic_list_validation` as `topic_prefix_and_coin_validation`

Signed-off-by: ozkanonur <work@onurozkan.dev>

* fix reviews

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* update `tx_enum_from_bytes` and write unit test

Signed-off-by: ozkanonur <work@onurozkan.dev>

* update `tx_enum_from_bytes` in tendermint

Signed-off-by: ozkanonur <work@onurozkan.dev>

* update error log of `process_p2p_message`

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* create `TxMarshalingErr`

Signed-off-by: ozkanonur <work@onurozkan.dev>

* fix `test_tx_enum_from_bytes`

Signed-off-by: ozkanonur <work@onurozkan.dev>

* fix test compilation

Signed-off-by: ozkanonur <work@onurozkan.dev>

Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants