Skip to content

feat: custom priority mempool#2152

Merged
skosito merged 14 commits intodevelopfrom
custom-mempool
May 14, 2024
Merged

feat: custom priority mempool#2152
skosito merged 14 commits intodevelopfrom
custom-mempool

Conversation

@skosito
Copy link
Member

@skosito skosito commented May 10, 2024

Description

In cosmos 0.47, application mempools are possible https://docs.cosmos.network/main/build/building-apps/app-mempool
There are 2 provided implementation, sender nonce and priority nonce mempools. Priority nonce seems like it's most suitable for this usecase - give more priority to system txs.

Mempools from cosmos 0.47 assume signatures can be extracted from sdk.Tx, but it doesn't work for ethermint txs. On latest cosmos-sdk main branch, signer extractor adapter is present, which can be used to provide custom adapter to pull out senders and nonces (check cronos ethermint for example).
But, on 0.47 this option is not present, so I forked priority nonce mempool, and default proposal handler, and only replaced part with that custom signer adapter.

Tests will be added in:
#2182
#2183

Closes: #734

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Nice.

Any way it has been tested? I may think we could maybe introduce a new local env setup where the max gas per block is low and we send many txs, checking if system txs pass through.
This can be a general setup for stress tests, we currently have a stress tests command but it will need to be improved

@github-actions
Copy link

!!!WARNING!!!
nosec detected in the following files: app/custom_proposal_handler.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label May 10, 2024
@skosito
Copy link
Member Author

skosito commented May 10, 2024

@lumtis thanks for review, fixed the comments

regarding testing, i think for unit tests we can also fork them and add ethermint handling if possible in this PR, will do that here

regarding e2e and stress tests, maybe we can discuss proper setup and handle in follow up PR?

@skosito skosito marked this pull request as ready for review May 13, 2024 21:33
Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

@lumtis thanks for review, fixed the comments
regarding testing, i think for unit tests we can also fork them and add ethermint handling if possible in this PR, will do that here
regarding e2e and stress tests, maybe we can discuss proper setup and handle in follow up PR?

Sounds good to me, do we already have a follow up issue?

@skosito
Copy link
Member Author

skosito commented May 14, 2024

@lumtis thanks for review, fixed the comments
regarding testing, i think for unit tests we can also fork them and add ethermint handling if possible in this PR, will do that here
regarding e2e and stress tests, maybe we can discuss proper setup and handle in follow up PR?

Sounds good to me, do we already have a follow up issue?

Yes, added 2 issues for these missing pieces since they are a bit more involved will handle in separate PRs, and will merge this one. Issues are:

#2182
#2183

@skosito skosito requested a review from a team as a code owner May 14, 2024 20:04
@github-actions github-actions bot added the ci Changes to CI pipeline or github actions label May 14, 2024
Copy link
Contributor

@gartnera gartnera left a comment

Choose a reason for hiding this comment

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

stamp

@skosito skosito merged commit b63b5dc into develop May 14, 2024
@skosito skosito deleted the custom-mempool branch May 14, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:cli ci Changes to CI pipeline or github actions nosec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set higher priority for system and other important messages

4 participants