feat: impl checkTxAsyncReactor()#168
Merged
jinsan-line merged 5 commits intoFinschia:feat/perffrom Jan 25, 2021
jinsan-line:check-tx-async-reactor
Merged
feat: impl checkTxAsyncReactor()#168jinsan-line merged 5 commits intoFinschia:feat/perffrom jinsan-line:check-tx-async-reactor
checkTxAsyncReactor()#168jinsan-line merged 5 commits intoFinschia:feat/perffrom
jinsan-line:check-tx-async-reactor
Conversation
egonspace
reviewed
Jan 22, 2021
| } | ||
|
|
||
| // It blocks if we're waiting on Update() or Reap(). | ||
| func (mem *CListMempool) checkTxAsync(tx types.Tx, txInfo TxInfo, prepareCb func(error), checkTxCb func(*abci.Response)) { |
Contributor
There was a problem hiding this comment.
Is prepareCb right? I think it's just an error handler.
Author
There was a problem hiding this comment.
I think it's prepareCheckTx callback. If we follow up the argument for callback name, checkTxCb should ABCIResponse callback.
egonspace
approved these changes
Jan 22, 2021
tnasu
approved these changes
Jan 22, 2021
3 tasks
jinsan-line
added a commit
that referenced
this pull request
Apr 27, 2021
5 tasks
jinsan-line
added a commit
that referenced
this pull request
Apr 28, 2021
egonspace
pushed a commit
to egonspace/ostracon
that referenced
this pull request
Jul 8, 2021
* feat: impl checkTxAsyncReactor() (Finschia#168) * fix: tests * fix: lint errors
egonspace
pushed a commit
to egonspace/ostracon
that referenced
this pull request
Jul 8, 2021
* feat: impl checkTxAsyncReactor() (Finschia#168) * fix: tests * fix: lint errors
egonspace
pushed a commit
that referenced
this pull request
Aug 26, 2021
* feat: more prometheus metrics for monitoring performance (#146) (#175) * chore: config timeout and connection pool (#150) (#171) * fix: use line/tm-db instead of tendermint/tm-db * bump up tm-db, iavl; re-apply #201 * chore: use default db backend among the available ones (#212) * chore: use default db backend among the available ones * chore: bump up iavl, tm-db * feat: concurrent checkTx #213; fix tm-db call * fix: rename TM to OC * fix: modify key name; tendermint -> ostracon * chore: rename tendermint to ostracon * chore: remove mempool.postCheck (#158) (#217) * fix: error handling after check tx * fix: typo * chore: (mempool) remove postCheck and impl reserve * chore: fix tests * chore: revise log (remove checkTx.Code) * chore: add `CONTRACT` for `mem.proxyAppConn.CheckTxAsync()` * chore: revise numTxs, txsBytes for `ErrMempoolIsFull` in reserve() * chore: revise to remove redundant `isFull()` * fix: remove tx from cache when `app errors` or `failed to reserve` * Revert "chore: revise to remove redundant `isFull()`" This reverts commit 55990ec. * fix: revise to call Begin/EndRecheck even though mem.Size() is 0 (#219) * fix: revise to call Begin/EndRecheck even though `mem.Size()` is 0 * chore: revise local_client.go * fix: lint error * chore: recheckTxs() just return if mem.Size() == 0 * feat: concurrent recheckTx (#163) (#221) * chore: increase the value of maxPerPage (#223) * chore: fix the type of consensus_block_interval_seconds from histogram to gauge (#224) * feat: impl checkTxAsyncReactor() (#168) (#225) * feat: impl checkTxAsyncReactor() (#168) * fix: tests * fix: lint errors * chore: revise abci.Client, Async() interfaces (#169) (#226) * chore: revise abci.Client, Async() interfaces * chore: regen mock w/ mockery 2.7.4 * fix: lint error * fix: test_race * mempool.Flush() flushes all txs from mempool so it should get `Lock()` instead of `RLock()` * chore: remove iavl dependency (#228) * chore: remove iavl dependency * chore: fix lint error * fix: add more fixing for abci.Client, Async() * feat: revise metric for measuring performance * build: remove needless build tag `!libsecp256k1` (#246) The build tag makes disable go implementation of secp256k1. Cause there is no C implementation, a build error will occur when using tag `libsecp256k1`. * feat: add duration metrics of gauge type (#256) * perf: optimize checking the txs size (#264) * perf: optimize checking the txs size * ci: add GOPRIVATE to workflows * test: add a unit test * fix: fix lint errors * perf: do not flush wal when receive consensus msgs (#273) * perf: do not flush wal when receive consensus msgs * fix: ci failure * fix: lint failure * fix: ci-e2e build failure * fix: bump up tm-db * fix: missing abci api * fix: bump up tm-db; use memdb * test: add test case to raise test coverage * fix: race error * fix: race error * fix: race error * fix: increase e2e test timeout * fix: add test case for coverage * fix: e2e docker file * fix: apply comments * fix: a Ostracon to an Ostracon
50 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #167
Related with: #163, https://github.com/line/link/issues/1152
Description
During #163 CI tests, we sometimes failed
TestReactorBroadcastTxMessage(). After investigation, I thinkwe should guarantee that
tx, called mempool.CheckTxAsync()first, should call app.CheckTxAsync()first. I think this bug comes from originaltendermint. But, in originaltendermint, app.CheckTxAsync()is protected by amutex. Because part of mempool.CheckTxAsync()is serialized by thismutex, it decreases the possibility of failure of the test. Because we removed thismutex, the possibility of failure of the test is increased.To guarantee the execution order, I introduce a
channeland areactor. It makes the mempool.CheckTxAsync()execute in serial.mempool/reactor.Receive()is executed on its owngoroutine. In originaltendermint, mempool.CheckTxAsync()could be executed in parallel except app.CheckTx(). Now, mempool.CheckTxAsync()is executed in serial. It looks like decreasing the performance.Please note that mempool
.CheckTxAsync()itself is so cheap but app.CheckTxXXX()is expensive. Now we compare the original and revised. In the original, cheap mempool.CheckTxAsync()itself could be executed in parallel but expensive app.CheckTx()is executed in serial. But, now, cheap mempool.CheckTxAsync()itself is executed in serial but expensive app.CheckTx()could be executed in parallel. So I maintain that the revised is safer and more performant than the original.For contributor use:
docs/) and code commentsFiles changedin the Github PR explorer