rise-node
rise-node copied to clipboard
Enhance TPS value
Right now a medium-end CPU can roughly handle 7tps. While this is more than enough right now, the situation can rapidly change and a solution should be already in place.
Current Implementation: The node is so slow to process the transactions caus of different implementation pitfalls:
- txs and blocks are not saved atomically in one single DB transaction.
- pending txs are undo + block txs are unconfirmed and then confirmed (3 steps)
- Every action hits the Database to ensure data consistency
- The txs checks cannot be parallelize due to the way the core is written
Ways to improve
- [x] Moving the data consistency checks to a faster db (Redis?)
- [x] Avoid undoing all unconfirmed transactions before applying blocks txs.
- [ ] Use redis as single source of through (all writes and reads are there) and sync to postgres later (asynchronously)
- [ ] horizontal scaling through multi-core