threefoldtecharchive / rivine

Blockchain technology for creating custom chains.
Apache License 2.0
22 stars 12 forks source link

See if txpool tx validation can be improved #578

Open LeeSmet opened 5 years ago

LeeSmet commented 5 years ago

After recent changes regarding the txpool validation (specifically chaining txes in the pool), every time a new tx is accepted in the pool, this validates the entire pool again. As a result, after N txes are in the pool, the total amount of validations done for the current pool is (n^2+n) / 2 validations. For 500 txes in the pool, this amounts to 125,250 txes. Perhaps there is a way to keep some kind of validation tx open on the db, so we have a pending state and only need to validate new txes as they come in