-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add support for runtime schedule control #4438
Conversation
cc3d529
to
bcb893d
Compare
0f54266
to
37b80a7
Compare
bcb893d
to
029b27d
Compare
029b27d
to
0c1389c
Compare
defer q.Unlock() | ||
|
||
var ( | ||
batch []*transaction.CheckedTransaction |
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.
Might make sense pre-allocating batch here (with length 0)
37b80a7
to
3a18290
Compare
6dfd433
to
540aaab
Compare
go/runtime/scheduling/simple/txpool/priorityqueue/priority_queue.go
Outdated
Show resolved
Hide resolved
6a038f4
to
c95e5a1
Compare
540aaab
to
ca07ed3
Compare
9d265b4
to
a0975f2
Compare
a0975f2
to
a6e547e
Compare
Codecov Report
@@ Coverage Diff @@
## master #4438 +/- ##
==========================================
+ Coverage 68.66% 68.87% +0.21%
==========================================
Files 415 415
Lines 46571 46759 +188
==========================================
+ Hits 31976 32204 +228
+ Misses 10635 10609 -26
+ Partials 3960 3946 -14
Continue to review full report at Codecov.
|
hashes := make([]hash.Hash, len(batch)) | ||
for i, tx := range batch { | ||
hashes[i] = tx.Hash() | ||
hashes := make([]hash.Hash, 0, len(batch)) |
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.
Nit: Since you're inserting duplicates, should this be
hashes := make([]hash.Hash, 0, len(batch)) | |
hashes := make([]hash.Hash, 0, 2*len(batch)) |
Or just remove the capacity entirely.
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.
Looks fine, we're basically running a more involved version of this already.
@@ -254,6 +259,18 @@ func (c *connection) Close() { | |||
c.quitWg.Wait() | |||
} | |||
|
|||
// Implements Connection. | |||
func (c *connection) GetInfo(ctx context.Context) (*RuntimeInfoResponse, error) { | |||
c.Lock() |
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.
Can't this just use defer?
Based on #4415.
Also adds functionality needed for #4436.
TODO