-
Notifications
You must be signed in to change notification settings - Fork 701
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
vms/avm
: Add exists
bool to mempool Peek
#2465
Conversation
vms/avm/block/builder/builder.go
Outdated
// Invariant: [mempool.MaxTxSize] < [targetBlockSize]. This guarantees | ||
// that we will only stop building a block once there are no | ||
// transactions in the mempool or the block is at least | ||
// [targetBlockSize - mempool.MaxTxSize] bytes full. | ||
if tx == nil || len(tx.Bytes()) > remainingSize { | ||
if !exists && tx == nil || len(tx.Bytes()) > remainingSize { |
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 don't think we should check if tx == nil anymore
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 thought it could still return nil but we do guard against that since we verify the tx first before adding it to the mempool- dropping
fb32a23
to
0a5c315
Compare
Why this should be merged
Seems odd to use the zero value to determine non-existence, let's be explicit
How this works
Adds an
exists
return paramHow this was tested
CI