-
Notifications
You must be signed in to change notification settings - Fork 3
feat: implement transaction prioritization and fee policy #29
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
Open
hominlee-wemade
wants to merge
20
commits into
dev
Choose a base branch
from
feat/minter-priority-mempool
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
2d7b2df to
1909c2c
Compare
0xmhha
reviewed
Nov 14, 2025
Contributor
0xmhha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some code suggestions that need review
41e4af7 to
2ced82b
Compare
…ering (enabled when Anzeon is active) - Authorized accounts are always prioritized over normal accounts. - Among authorized accounts: higher fee first, then FIFO if equal. - Among normal accounts: FIFO only (no fee-based comparison). - When Anzeon is disabled, fallback to existing ordering logic. - Temporarily define AuthorizedAccounts map in params/protocol_params.go for development use. (TODO: remove once StateAccount.Extra field is implemented)
…rized accounts - If Anzeon is enabled and the sender is an authorized account, use tx.GasTipCap() directly. - Otherwise, use the header's gas tip value.
…pplyTransaction - DeriveFields() cannot access stateDB, making it impossible to check if the sender is an authorized account. - For authorized accounts, calculate effectiveGasPrice in applyTransaction(). - For normal accounts, keep the existing DeriveFields() logic unchanged.
- Add StateReader interface to check authorized accounts - Pass StateReader to ReadReceipts and DeriveFields - Use IsAuthorized to determine gasTip in receipt derivation - Update all call sites to pass StateReader
f314662 to
ea4d3aa
Compare
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.
Description
This PR implements transaction prioritization and fee policy updates to support Authorized Accounts in StableNet, addressing the requirements outlined in #5 and #22.
Overview
This update introduces two major improvements:
Transactions from Authorized Accounts (accounts that have completed KYC or similar authentication processes) are now prioritized over normal accounts in the mempool. This ensures that authenticated institutional transactions receive preferential treatment even during network congestion.
Authorized Accounts: Gas fees are calculated based on the actual priority fee (GasTipCap) specified in the transaction
Normal Accounts: Gas fees are capped at a pre-agreed
HeaderGasTipvalue, regardless of the priority fee they submitSummary of Changes
GasTipCap()(priority fee).HeaderGasTipdefined in the block header.→ lower EffectiveGasTip(baseFee) → lower GasFeeCap → lower GasTipCap → higher nonce
→ lower GasFeeCap → higher nonce
→ Use the original logic unchanged.
→ Authorized Accounts: Apply original eviction logic using transaction's actual
GasTipCap→ Normal Accounts: Apply original eviction logic but use
HeaderGasTipinstead of transaction'sGasTipCapRelated Issues