gno icon indicating copy to clipboard operation
gno copied to clipboard

feat: simplified FIFO mempool implementation

Open Milosevic02 opened this issue 7 months ago • 2 comments

Heavy WIP – major parts still under development, not ready for review or merge.

Based on the issues raised in #1830, especially the unordered execution of transactions and inefficient handling of gas limits in the current CListMempool, I started working on a completely new mempool implementation from scratch.

The main problems with the existing solution:

  • Transactions are not guaranteed to be returned in order of account sequence, which leads to execution failures (e.g. deploying a Realm before the account is created).
  • The block assembly logic is based on declared gas, not actual gas used, which allows potential denial-of-service vectors and inefficient block space utilization.

After discussions and consultation with @zivkovicmilos, we concluded that these are core design flaws that cannot be resolved by simple tweaks. A ground-up rewrite is necessary.

I'm currently actively working on this implementation under Milos’s guidance, and the goal is to gradually build a more robust and production-ready mempool module.

Milosevic02 avatar Apr 30 '25 08:04 Milosevic02

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • [ ] IGNORE the bot requirements for this PR (force green CI check)
  • [ ] The pull request description provides enough details
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info) 🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: dragann-milosevic/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (with state "APPROVED")
    │       ├── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🟢 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

Gno2D2 avatar Apr 30 '25 08:04 Gno2D2

Codecov Report

Attention: Patch coverage is 69.46903% with 69 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tm2/pkg/bft/my_mempool/mempool.go 70.08% 55 Missing and 12 partials :warning:
tm2/pkg/bft/appconn/app_conn.go 0.00% 2 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar May 07 '25 11:05 codecov[bot]

This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months.

github-actions[bot] avatar Sep 26 '25 02:09 github-actions[bot]

@jefft0 It's not stale, it's a PR I have on my back burner 🙏

zivkovicmilos avatar Nov 18 '25 21:11 zivkovicmilos

@jefft0 It's not stale, it's a PR I have on my back burner 🙏

No problem. It was already stale for 53 days until the force push to master reset all the activity counters and Stale labels. That's why I restored the Stale labels. Nothing about this specific PR.

jefft0 avatar Nov 19 '25 03:11 jefft0