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

feat: concurrent deliverTx #53

Merged
merged 4 commits into from
Jan 28, 2021
Merged

feat: concurrent deliverTx #53

merged 4 commits into from
Jan 28, 2021

Conversation

jinsan-line
Copy link
Contributor

@jinsan-line jinsan-line commented Jan 27, 2021

Related with: https://github.com/line/link/issues/1170, Finschia/ostracon#170

Description

To optimize performance, we need to increase concurrency. After implementing concurrent checkTx(#49) and recheckTx(#52), I'd like to implement concurrent deliverTx.

Motivation and context

How has this been tested?

Checklist:

  • I followed the contributing guidelines.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@jinsan-line jinsan-line changed the base branch from develop to feat/perf January 27, 2021 11:03
@jinsan-line jinsan-line self-assigned this Jan 27, 2021
Data: data,
Log: strings.TrimSpace(msgLogs.String()),
Events: events,
return &sdk.MsgsResult{
Copy link

@egonspace egonspace Jan 28, 2021

Choose a reason for hiding this comment

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

fyi: Is there a reason why we need this new type? Based on the code, it looks almost identical to the existing Result. Since we have to keep merging code from origin, I wish that refactoring without functional changes should be avoided and minimal modification should be adhered to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a part of optimization. The cost of marshaling runMsg result is fairly high. Please note that now it marshals the result concurrently.

Copy link

@egonspace egonspace left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wetcod wetcod left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kukugi kukugi left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jinsan-line jinsan-line merged commit fdc5042 into Finschia:feat/perf Jan 28, 2021
@jinsan-line jinsan-line deleted the concurrent-delivertx branch January 28, 2021 08:59
egonspace pushed a commit that referenced this pull request Mar 28, 2021
* solve a TODO in wasm's cli_test

* fix how to compare hash
@zmanian
Copy link
Contributor

zmanian commented Jul 11, 2021

I would expect this implementation to introduce non-determimism and apphash failures. I expect that you need ReadWrite lists or some other mechanism to prevent transactions from concurrently accessing.

In prior design work Cosmos contributors have thoughts after putting access lists natively in the transaction format. Now some applications might want to have dynamic runtime access patterns so it would necessary to have optional support for ReadWrite lists which implies that only part of a block will contain transactions that can be processed in parallel.

@egonspace
Copy link

egonspace commented Jul 12, 2021

Thank you for the great comment. This seems to be the first outside comment since opening our project, and we welcome it.

This PR was for an experimental branch to determine whether performance was improved or not. The main branch does not include concurrent deliveryTx yet, and several issues need to be resolved. I'll listen carefully to your opinion.

Thank you so much!

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.

5 participants