Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

orderwatch,core,blockwatch: Improve Order Event subscription stability #566

Merged
merged 65 commits into from
Dec 18, 2019

Conversation

fabioberger
Copy link
Contributor

@fabioberger fabioberger commented Nov 29, 2019

This PR ensures that Mesh's OrderWatcher is in complete lock-step about what the latest block it knows about is, and therefore also the block at which validations/re-validations are to be conducted. While these eth_call's are in progress, no further block events are processed, so that we don't introduce any race conditions. This eliminates several bugs:

Additionally, it:

  • Batch emits ADDED order events (orderwatch: Batch order events when orders added to Mesh #559)
  • Properly passes down the top-level context to every order validation eth_call request.
  • Ensures that at least one block was processed before processing incoming orders (RPC/P2P), so we have an updated block height at which to process them.

@fabioberger fabioberger changed the title Refactor/more performant order watching orderwatch,core,blockwatch: Improve Order Event subscription performance Nov 29, 2019
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from 8f68748 to 28305bc Compare November 29, 2019 14:57
@fabioberger fabioberger marked this pull request as ready for review December 2, 2019 10:39
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch 3 times, most recently from ea2b1df to 11df17f Compare December 2, 2019 17:01
constants/constants.go Outdated Show resolved Hide resolved
core/core.go Outdated Show resolved Hide resolved
encoding/encoding.go Outdated Show resolved Hide resolved
integration-tests/integration_test.go Outdated Show resolved Hide resolved
meshdb/meshdb.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher_test.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
core/message_handler.go Show resolved Hide resolved
ethereum/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
ethereum/blockwatch/block_watcher.go Outdated Show resolved Hide resolved
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch 2 times, most recently from b770a83 to e429ce3 Compare December 4, 2019 12:07
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from 05c67ad to 1c4f24b Compare December 12, 2019 00:19
@fabioberger fabioberger changed the base branch from refactor/blockWatcher to development December 12, 2019 16:39
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from d1c2756 to 931e05f Compare December 12, 2019 16:43
@fabioberger fabioberger changed the title orderwatch,core,blockwatch: Improve Order Event subscription performance orderwatch,core,blockwatch: Improve Order Event subscription stability Dec 13, 2019
Copy link
Contributor

@albrow albrow left a comment

Choose a reason for hiding this comment

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

Mostly looks pretty good. Much fewer suggestions this time and most of them are minor. I also messaged you separately about test coverage for the Cleanup method.

zeroex/order.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from 958f45b to 123617b Compare December 14, 2019 01:03
zeroex/orderwatch/order_watcher_test.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher_test.go Show resolved Hide resolved
@albrow
Copy link
Contributor

albrow commented Dec 16, 2019

Also need to address merge conflicts now that #580 is merged.

@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from 1aa5e7a to 7141dc9 Compare December 17, 2019 04:42
@fabioberger fabioberger force-pushed the refactor/morePerformantOrderWatching branch from 7141dc9 to 391dd91 Compare December 18, 2019 00:02
@albrow albrow self-requested a review December 18, 2019 00:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants