-
Notifications
You must be signed in to change notification settings - Fork 667
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
Fix: Incorporate unlocks in mempool admitter, #3623 #3624
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3624 +/- ##
===========================================
+ Coverage 0.18% 29.75% +29.57%
===========================================
Files 298 298
Lines 275068 275543 +475
===========================================
+ Hits 512 81999 +81487
+ Misses 274556 193544 -81012
... and 203 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
New regression test added:
You can test the regression pretty simply by applying this diff to this PR and then running that test: diff --git a/src/core/mempool.rs b/src/core/mempool.rs
index 7f3c195d2..5d5d121dc 100644
--- a/src/core/mempool.rs
+++ b/src/core/mempool.rs
@@ -180,7 +180,7 @@ impl MemPoolAdmitter {
tx_size: u64,
) -> Result<(), MemPoolRejection> {
chainstate.will_admit_mempool_tx(
- &sortdb.index_conn(),
+ &clarity::vm::database::NULL_BURN_STATE_DB,
&self.cur_consensus_hash,
&self.cur_block,
tx, And then testing: $ cargo test block_construction::mempool_incorporate
...
INFO [1679332313.674012] [src/chainstate/burn/db/sortdb.rs:4694] [chainstate::stacks::tests::block_construction::mempool_incorporate_pox_unlocks] ACCEPTED(38) leader key register 9158ed4afbd48e7c855e025384ddd1c181a8e26ff5b5083e0067f21ca0bc3b06 at 38,1
INFO [1679332313.720628] [src/chainstate/stacks/tests/block_construction.rs:4373] [chainstate::stacks::tests::block_construction::mempool_incorporate_pox_unlocks] Checking balance, v1_unlock_height: 37, burn_block_height: 37
thread 'chainstate::stacks::tests::block_construction::mempool_incorporate_pox_unlocks' panicked at 'called `Result::unwrap()` on an `Err` value: NotEnoughFunds(9999990000, 0)', src/chainstate/stacks/tests/block_construction.rs:4440:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
chainstate::stacks::tests::block_construction::mempool_incorporate_pox_unlocks
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1176 filtered out; finished in 2.31s
error: test failed, to rerun pass `--lib` |
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.
Thanks for jumping on this @kantai!
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.
verified regression - thanks for the fix!
@kantai sorry I missed this review. I'm way overloaded. Thanks for working on this! |
Description
This fixes the mempool admission behavior in #3623 by supplying a pointer to the current burn state (sortition db) to the mempool admission logic.
Will update this PR with regression testing before merging.
Applicable issues
Checklist