Commit Graph

5807 Commits

Author SHA1 Message Date
Jude Nelson
e4d7e304e7 fix: fix broken unit test compile error 2022-10-18 20:09:37 -04:00
Jude Nelson
ecb33a94ad Merge branch 'develop' into feat/interruptable-miner 2022-10-18 14:13:51 -04:00
Jude Nelson
b1b3b2ddaa chore: backport unit tests from 2.05.0.3.0 2022-10-18 10:47:05 -04:00
Jude Nelson
f5518396a1 chore: backport unit tests from 2.05.0.3.0 2022-10-18 10:46:53 -04:00
Jude Nelson
4c56218e0a chore: backport unit tests from 2.05.0.3.0 2022-10-18 10:46:39 -04:00
Jude Nelson
9e57f248c8 chore: backport unit tests from 2.05.0.3.0 2022-10-18 10:46:24 -04:00
Jude Nelson
ea81b42ecf chore: backport unit tests from 2.05.0.3.0 2022-10-18 10:46:11 -04:00
Jude Nelson
6fe44078f6 fix: fix failing unit tests by *not* returning a microblock who has a sibling in a fork whereby it shares a parent with another microblock 2022-10-12 13:49:47 -04:00
Jude Nelson
e5e39b1b04 fix: fix compile-time issue with unit tests 2022-10-11 11:01:38 -04:00
Jude Nelson
d08cd0acfc feat: log when we store a block 2022-10-10 15:37:32 -04:00
Jude Nelson
b5e7ee553c feat: add Error::ChannelClosed() variant to detect thread hangups 2022-10-10 15:36:57 -04:00
Jude Nelson
a27d9f4269 chore: exit_at_block_height is now a bare Option<u64> instead of a borrowed Option<&'a u64> 2022-10-05 23:16:00 -04:00
Jude Nelson
d2c1c59bf8 feat: use new NetworkResult contructor 2022-10-05 23:15:50 -04:00
Jude Nelson
6b0befd79f feat: NetworkResult now reports the p2p thread's burn height 2022-10-05 23:15:36 -04:00
Jude Nelson
0ea6586c79 feat: add a miner-driven mempool submission function so that the miner can add its own transactions while bypassing the usual checks that would prevent them (such as fees or nonce conflicts). Used to submit poison-microblock transactions 2022-10-05 23:14:52 -04:00
Jude Nelson
ab0d95a95a chore: add MinerAborted error variant 2022-10-05 23:14:38 -04:00
Jude Nelson
b1ceaba5e0 feat: make the miner loop interruptable by checking the status of a shared mutex. Mining is blocked as long as at least one thread wants it blocked, and is unblocked if no threads want it blocked. Blocking/unblocking is idempotent when done from the same thread. 2022-10-05 23:13:33 -04:00
Jude Nelson
d47df1fb9f chore: remove fmt warnings 2022-10-05 23:13:14 -04:00
Jude Nelson
6e81ee4bcc feat: add make_readonly_owned() function that effectively takes a read-only snapshot of the the unconfirmed state. Used by a separate miner thread so it doesn't need to hold the relayer thread's chainstate 2022-10-05 23:12:27 -04:00
Jude Nelson
0b8397b6f5 chore: remove fmt warning 2022-10-05 23:12:15 -04:00
Jude Nelson
0fd8fae1c9 feat: add a query to see if there are any pending unprocessed blocks higher than a certain height; add a read-only DB query to see if we have already processed a Stacks block (so we don't need a write lock on the chainstate); catch microblock forks earlier by checking for common ancestors in addition to sequence numbers; 2022-10-05 23:11:26 -04:00
Jude Nelson
5fe6ff7944 feat: when the chains coordinator is about to start processing a burnchain or stacks block, signal to any running miner thread that it should cease what it's doing. This prevents the miner from holding open the write lock on the underlying DB, and in doing so, blocking the coordinator (whose operation takes precedence since the miner builds off of a chain tip produced by the coordinator) 2022-10-05 23:10:20 -04:00
Jude Nelson
602317677b chore: clean up canonical stacks tip memo code to make it more comprehensible 2022-10-05 23:09:52 -04:00
Aaron Blankstein
3b4ca5f3cf set mempool schema version to 5 2022-09-30 14:26:53 -05:00
Aaron Blankstein
f74816fb1e feat: denormalize mempool/fee_estimates table to remove join, only deser txs actually considered 2022-09-30 14:08:02 -05:00
Jude Nelson
1a34c11508 feat: release 2.05.0.3.0 2022-08-31 13:41:12 -04:00
Jude Nelson
74771773c2 Merge branch 'develop' into feat/drop-problematic-transactions 2022-08-03 00:55:05 +00:00
Jude Nelson
c21870f33a refactor: make PeerNetwork::with_inv_state() take a closure that returns R instead of Result<R, net_error> 2022-08-02 11:22:15 -04:00
Jude Nelson
155e0a5809 fix: make the network state-machine processing steps (in particular, mempool sync) infallible -- make them absorb all errors and simply retry their execution instead of propagating them to the caller of PeerNetwork::run() 2022-07-31 09:29:19 -04:00
Jude Nelson
2545a64437 fix: make process_new_sockets() infallible -- it doesn't need to return Err(..) if the http server isn't initialized 2022-07-31 09:28:53 -04:00
Jude Nelson
960cdf82e4 fix: make top-level inv sync state machine infallible -- it absorbs all errors that could happen 2022-07-31 09:28:23 -04:00
Jude Nelson
dc2d1e06a1 fix: make attachment enqueuing fail specifically due to DB errors, since that's the only way it can fail 2022-07-31 09:27:55 -04:00
Jude Nelson
5ead5882d2 Merge branch 'develop' into feat/drop-problematic-transactions 2022-07-29 19:47:31 +00:00
Jude Nelson
3fbbf192b4 Merge branch 'develop' into feat/set-local-peer-privkey 2022-07-26 21:46:14 -04:00
Jude Nelson
71abb88b6c Merge branch 'develop' into feat/drop-problematic-transactions 2022-07-27 01:30:25 +00:00
Jude Nelson
913b0f9dde fix: test coverage for blacklist size shrinkage due to being too big 2022-07-25 14:57:41 -04:00
Jude Nelson
0e241ab32e fix: limit the size of the blacklist by deleting random txids if we go over. 2022-07-25 14:57:03 -04:00
Jude Nelson
b364c213b5 fix: store the private key to local_peer if given to PeerDB::connect() 2022-07-25 14:28:07 -04:00
Jude Nelson
606640f80b feat: unit test to verify that blacklisted transactions never get relayed 2022-07-22 12:43:50 -04:00
Jude Nelson
95f0fbc4ca feat: unit test for dropping and blacklisting transactions 2022-07-22 12:43:35 -04:00
Jude Nelson
0181134ff7 feat: add a blacklisted txid table (bumping the schema version), which contains all txids of transactions the miner found to be problematic (i.e. can't be mined, and shouldn't ever be relayed again). Add an API to drop and blacklist transactions. 2022-07-22 12:42:46 -04:00
Jude Nelson
2a965385db feat: ProblematicTransaction error variant 2022-07-22 12:42:30 -04:00
Jude Nelson
441e1d0e6b feat: identify transactions that fail at *runtime* due to an analysis-time error. This ideally should never happen, but there are a few cases where it does (and, it means that miners spend non-trivial compute time on transactions they can't claim tx fees for). Identify these transactions as "problematic" transactions, and drop them from the mempool and blacklist them so they can't keep circulating in the network. 2022-07-22 12:41:27 -04:00
Jude Nelson
3a9d10d85b refactor: expose handle_clarity_runtime_error() 2022-07-22 12:41:05 -04:00
Jude Nelson
c3611ec336 feat: TemporarilyBlacklisted error variant for mempool rejection 2022-07-22 12:40:46 -04:00
Jude Nelson
d11e77b7f2 chore: remove compile-time test warning 2022-07-22 12:40:26 -04:00
Aaron Blankstein
2ed263671e Merge branch 'develop' into chore/master-to-develop 2022-07-22 09:55:31 -05:00
Aaron Blankstein
1468e6404d fix type error in monitoring_prom build 2022-07-21 18:04:09 -05:00
Aaron Blankstein
c3651079cc Merge branch 'master' into chore/master-to-develop 2022-07-18 14:57:06 -05:00
Greg Coppola
4d2b296ad3 fix: build 2022-07-06 09:53:23 -05:00