-
Notifications
You must be signed in to change notification settings - Fork 41
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
1545 without dos and stats cleanups #2046
Open
kladkogex
wants to merge
299
commits into
v4.0.0
Choose a base branch
from
1545_without_dos_and_stats_cleanups
base: v4.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…enetwork/skaled into 1545_without_dos_and_stats_cleanups
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
State locking/ performance improvements for SKALEd.
In the past we had to constantly lock/unlock LevelDB state because it was used both during block processing
(write access) and JSON-RPC calls (read access)
Now we use the actual LevelDB only during block processing, so we do not need to lock it, since LevelDB will always be used by a single thread.
For read-only calls through JSON-RPC we use snapshots created at the end of each block.
This significantly improved performance and made calls much simpler, because we do not do state locking anymore.
Added SnapshotManager class that manages snapshots and closes them once they are not used anymore.
Since we already have a feature to reopen LevelDB during execution, added mechanics to close anbd reopen snapshot objects during reopen of the database (if you want to close database handle, the snapshot objects created for this handle need to be closed first)
Now when a new transaction comes from JSON-RPC it is immediately broadcast to other nodes and added to the pending queue. Previously a transaction would not be added to the blockproposal until it was broadcast, which was making things unnecessary complex and delaying transaction inclusion in the block.
It was only 16 transactions before, which caused the queue to overfill and lose transactions during broadcast.
Removed unnecessary transaction cache on transaction arrival. The cash did not improve performance but caused high memory consumption and memory leaks because it was never cleaned.
Fixed a bug in partial catchup receipts storage, which caused large blocks processing to stuck for seconds and also could process the same block twice. Now for each transaction once it is processed the receipt is immediately written to LevelDB. If there is a crash and restart, only the unprocessed transactions in the block are processed. Added a test for partial catchup (previously there was no test)
Added a set of parallel performance tests to test_eth that test ERC-20 token tranfers, native token transfers and all of major lots of JSON-RPC calls
Changed m_rawData field in Transaction to shared pointer to speed up Transaction copying and save memory. Skaled copies Transaction objects all the time, shared pointer guarantees that copies do not consume additional memory.
Did some small fixes to JSON-RPC API error handling to make it similar to Geth.