-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: performance improvement #5
Conversation
Not sure whether we need to introduce 3 new ABCI methods. |
dcfdf94
to
b7d17d4
Compare
@@ -132,7 +143,7 @@ func (memR *Reactor) GetChannels() []*p2p.ChannelDescriptor { | |||
return []*p2p.ChannelDescriptor{ | |||
{ | |||
ID: mempool.MempoolChannel, | |||
Priority: 5, | |||
Priority: 1, |
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.
Why change the priority here? There are other channels, e.g., syncing, p2p.
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.
When there're too many txs in mempool, it may affect the vote and proposal's transport. So we set mempool's priority to minimum.
state/execution.go
Outdated
@@ -108,7 +114,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock( | |||
// Fetch a limited amount of valid txs | |||
maxDataBytes := types.MaxDataBytes(maxBytes, evSize, state.Validators.Size()) | |||
|
|||
txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, maxGas) | |||
txs := blockExec.mempool.ReapMaxTxsMaxBytesMaxGas(2400, maxDataBytes, maxGas) |
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.
Change 2400
to a const.
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.
or even config?
state/execution.go
Outdated
startTime := time.Now().UnixNano() | ||
interruptCh := make(chan struct{}) | ||
// do pre execute for cache | ||
var wg sync.WaitGroup |
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.
Do we need a wait group here? It seems that one interruptCh is fine.
Description
This pr is to improve the performance of greenfield.
Changes
Notable changes: