-
Notifications
You must be signed in to change notification settings - Fork 81
Integrate GetTxPriority ABCI interface
#598
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
base: main
Are you sure you want to change the base?
Changes from all commits
748608a
bbc64c8
d33e847
b3f6173
a6c998e
1867362
50782b7
88d8398
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,7 @@ type Context struct { | |
| eventManager *EventManager | ||
| evmEventManager *EVMEventManager | ||
| priority int64 // The tx priority, only relevant in CheckTx | ||
| hasPriority bool // Whether the tx has a priority set | ||
| pendingTxChecker abci.PendingTxChecker // Checker for pending transaction, only relevant in CheckTx | ||
| checkTxCallback func(Context, error) // callback to make at the end of CheckTx. Input param is the error (nil-able) of `runMsgs` | ||
| deliverTxCallback func(Context) // callback to make at the end of DeliverTx. | ||
|
|
@@ -241,12 +242,19 @@ func (c Context) StoreTracer() gaskv.IStoreTracer { | |
| return c.storeTracer | ||
| } | ||
|
|
||
| // WithEventManager returns a Context with an updated tx priority | ||
| // WithPriority returns a Context with an updated tx priority. | ||
| func (c Context) WithPriority(p int64) Context { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this function being called?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By ante handlers. This is the main function that sets priority in the context. I just fixed the godc typo in this PR. Note that I do not call this function in the PR because the priority calculated by SeiTxPrioritizer (in sei-chain) is meant to only be a hint. The actual proiority calculation by ante handlers is unchanged by my series of PRs. |
||
| c.priority = p | ||
| c.hasPriority = true | ||
| return c | ||
| } | ||
|
|
||
| // HasPriority returns true iff the priority is set for this Context even if it | ||
| // was set to zero. | ||
| func (c Context) HasPriority() bool { | ||
| return c.hasPriority | ||
| } | ||
|
|
||
| // HeaderHash returns a copy of the header hash obtained during abci.RequestBeginBlock | ||
| func (c Context) HeaderHash() tmbytes.HexBytes { | ||
| hash := make([]byte, len(c.headerHash)) | ||
|
|
||
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.
This might be consuming some resources, but we can test it out to see if that make a difference or not
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.
Right. I was on the fence for adding this too 👍