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

Problem: cosmos-sdk 0.46 is not used #578

Merged
merged 14 commits into from
Aug 15, 2022

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Jul 8, 2022

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@yihuang yihuang force-pushed the cosnos-0.46 branch 3 times, most recently from 21d1d39 to 9235336 Compare July 13, 2022 03:42
@yihuang yihuang marked this pull request as ready for review July 13, 2022 03:42
@yihuang yihuang requested a review from a team as a code owner July 13, 2022 03:42
@yihuang yihuang requested review from calvinaco, devashishdxt and adu-crypto and removed request for a team July 13, 2022 03:42
@yihuang yihuang marked this pull request as draft July 13, 2022 04:16
@yihuang
Copy link
Collaborator Author

yihuang commented Jul 13, 2022

need to wait for upstream PRs to merge first.

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #578 (249444e) into main (1573a35) will decrease coverage by 0.88%.
The diff coverage is 11.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   33.82%   32.93%   -0.89%     
==========================================
  Files          33       34       +1     
  Lines        1558     1603      +45     
==========================================
+ Hits          527      528       +1     
- Misses        978     1022      +44     
  Partials       53       53              
Impacted Files Coverage Δ
app/export.go 0.00% <0.00%> (ø)
app/state.go 0.00% <0.00%> (ø)
app/upgrades.go 0.00% <0.00%> (ø)
x/cronos/keeper/grpc_query.go 0.00% <0.00%> (ø)
x/cronos/keeper/ibc.go 75.91% <ø> (ø)
x/cronos/keeper/keeper.go 77.24% <ø> (+0.91%) ⬆️
x/cronos/keeper/params.go 72.72% <ø> (ø)
x/cronos/proposal_handler.go 5.88% <ø> (ø)
x/cronos/types/codec.go 0.00% <ø> (ø)
x/cronos/types/events.go 0.00% <ø> (ø)
... and 4 more

@JayT106
Copy link
Collaborator

JayT106 commented Aug 3, 2022

The v1 mempool currently has a limitation we might need to consider: priority mempool only allows 1 tx per sender because Tendermint doesn't understand nonces and how to provide local ordering. The SDK needs to change the nonce checks logic.

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 3, 2022

The v1 mempool currently has a limitation we might need to consider: priority mempool only allows 1 tx per sender because Tendermint doesn't understand nonces and how to provide local ordering. The SDK needs to change the nonce checks logic.

Do you mean the priority order maybe different from nonce order?

@JayT106
Copy link
Collaborator

JayT106 commented Aug 3, 2022

The v1 mempool currently has a limitation we might need to consider: priority mempool only allows 1 tx per sender because Tendermint doesn't understand nonces and how to provide local ordering. The SDK needs to change the nonce checks logic.

Do you mean the priority order maybe different from nonce order?

No, the pool will reject the later tx that has a bigger nonce if it has the same sender.

https://github.com/tendermint/tendermint/blob/main/mempool/v1/mempool.go#L484-L502

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 4, 2022

The v1 mempool currently has a limitation we might need to consider: priority mempool only allows 1 tx per sender because Tendermint doesn't understand nonces and how to provide local ordering. The SDK needs to change the nonce checks logic.

Do you mean the priority order maybe different from nonce order?

No, the pool will reject the later tx that has a bigger nonce if it has the same sender.

https://github.com/tendermint/tendermint/blob/main/mempool/v1/mempool.go#L484-L502

Hmm, I think it'll be reject by checkTx anyway, due to nonce mismatch. But is there a plan to support future list though, to hold the txs with future nonce for a while.

@adu-crypto
Copy link
Contributor

hold txs in mempool after we propose the block could be done by ABCI++ via PrepareProposal:

If the Application considers that tx should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in tx_records. In this case, Tendermint will not remove tx from the mempool.

https://github.com/tendermint/tendermint/blob/v0.36.x/spec/abci%2B%2B/abci++_methods.md#prepareproposal

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 4, 2022

hold txs in mempool after we propose the block could be done by ABCI++ via PrepareProposal:

If the Application considers that tx should not be proposed in this block, e.g., there are other transactions with higher priority, then it should not include it in tx_records. In this case, Tendermint will not remove tx from the mempool.

https://github.com/tendermint/tendermint/blob/v0.36.x/spec/abci%2B%2B/abci++_methods.md#prepareproposal

that's for the tx that's already in the mempool, but current issue is it won't include multiple txs for same sender in the first place. Even if it include multiple txs in mempoo,, the other issue is it won't include them into blocks in the nonce order.

@yihuang yihuang marked this pull request as ready for review August 10, 2022 23:14
@yihuang yihuang requested review from thomas-nguy and tomtau August 10, 2022 23:31
@yihuang
Copy link
Collaborator Author

yihuang commented Aug 11, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 12, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 15, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 15, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang yihuang enabled auto-merge (squash) August 15, 2022 10:27
@yihuang
Copy link
Collaborator Author

yihuang commented Aug 15, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang yihuang disabled auto-merge August 15, 2022 11:01
@yihuang
Copy link
Collaborator Author

yihuang commented Aug 15, 2022

/runsim

@github-actions
Copy link

Simulation tests started and triggered by /runsim.
Can check further progress here

@yihuang
Copy link
Collaborator Author

yihuang commented Aug 15, 2022

as discussed on Slack, this may also need a workaround for the prioritised mempool to allow stable IBC message relaying, but I guess this can be merged first and the mempool workaround can be done in a separate PR?

#634

@yihuang yihuang enabled auto-merge (squash) August 15, 2022 14:21
@yihuang yihuang merged commit 21d79ac into crypto-org-chain:main Aug 15, 2022
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