sipa
commented at 5:53 pm on April 28, 2015:
member
This is an alternative to @gavinandresen’s #5835, which caches transaction validation results in an mru cache in main, rather than relying on the mempool in consensus code. The cache keeps the last 33k results, and uses around 3 MB on 64-bit systems.
This pull request also contains a rebased version of the unit test from #5835, and the optimizations from #6064.
sipa
commented at 4:55 pm on April 29, 2015:
member
Reimplemented the mrumap using boost::multiindex, which is more compact, and offers erasing elements too. Entries are now removed from the tx validation cache when they are accepted into a block, meaning the last 33k valid unconfirmed transactions are cached, rather than just the last 33k whatsoever.
sipa force-pushed
on Apr 29, 2015
sipa force-pushed
on Apr 30, 2015
sipa force-pushed
on Apr 30, 2015
sipa
commented at 3:35 pm on April 30, 2015:
member
gavinandresen
commented at 9:01 pm on May 15, 2015:
contributor
Concept ACK. I hope to run some benchmarks to see how much this speeds up validation with a stream of real ’tx’ and ‘block’ messages and different -dbcache settings, but that probably won’t happen until I’m back from New York late next week.
sipa
commented at 2:12 pm on June 14, 2015:
member
Rebased.
sipa force-pushed
on Jun 16, 2015
sipa
commented at 2:49 pm on June 16, 2015:
member
Actually rebased.
sipa
commented at 1:22 pm on June 21, 2015:
member
Been running on bitcoin.sipa.be for a week, no problems.
sipa
commented at 12:51 pm on July 27, 2015:
member
ping
jgarzik
commented at 1:19 pm on July 27, 2015:
contributor
“it works” positive & negative test + review ACK
Cache transaction validation successes17b11428c1
sipa force-pushed
on Jul 27, 2015
sipa
commented at 1:30 pm on July 27, 2015:
member
Rebased.
Unit test doublespends in new blocks
As suggested by Greg Maxwell-- unit test to make sure a block
with a double-spend in it doesn't pass validation if half of
the double-spend is already in the memory pool (so full-blown
transaction validation is skipped) when the block is received.
517e6dd256
sipa force-pushed
on Jul 27, 2015
laanwj
commented at 2:13 pm on July 27, 2015:
member
ACK
laanwj merged this
on Jul 27, 2015
laanwj closed this
on Jul 27, 2015
laanwj referenced this in commit
08e9c57ba2
on Jul 27, 2015
sipa referenced this in commit
bc484ef8db
on Jul 27, 2015
laanwj
commented at 4:39 pm on July 27, 2015:
member
Backported to 0.11 as bc484ef8db02715e283e4cddd2c972316c0688dd
jtimon
commented at 4:21 pm on July 28, 2015:
contributor
I missed this..
We want to cache unconfirmed transactions, sure. But why cache the transactions that are being confirmed in connectBlock?
EDIT: As in, couldn’t this have been done in AcceptToMemoryPool instead of CheckScript (which, by the way, it’s called twice inside AcceptToMemoryPool)?
sipa
commented at 4:24 pm on July 28, 2015:
member
@jtimon To avoid rechecking the same transaction when it enters a block, when it has already been verified for the mempool (or whatever other reason).
jtimon
commented at 4:28 pm on July 28, 2015:
contributor
@sipa Thanks, I guess this the simplest way to do that right now.
sdaftuar
commented at 5:54 pm on July 28, 2015:
member
As mentioned on IRC, I think there’s a problem with transaction checks involving block height. Consider a coinbase spend that is valid when the transaction arrives and is accepted into the mempool, but is invalid at any earlier block height because of the coinbase maturity test. If there’s a reorg, then when validating blocks at earlier heights, we’d consider blocks valid even if they include this transaction at a too-early height, because of this validation cache. (A test that demonstrates this is here: https://gist.github.com/sdaftuar/23a3db523e68541a3195)
jtimon
commented at 6:02 pm on July 28, 2015:
contributor
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me