Skip to content
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

Set MaxBlockLevels for non-mainnet networks to 250 #1952

Merged
merged 6 commits into from
Feb 20, 2022

Conversation

stasatdaglabs
Copy link
Collaborator

Testnet difficulty is significantly lower than mainnet's. Mainnet's MaxBlockLevel caused testnet to keep significantly more block levels than necessary in RAM, causing OoM crashes and such.

This PR makes MaxBlockLevel depend on the network, and sets it to 250 for non-mainnet networks.

@codecov
Copy link

codecov bot commented Feb 20, 2022

Codecov Report

Merging #1952 (87cb4df) into dev (3f7e482) will decrease coverage by 0.00%.
The diff coverage is 90.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1952      +/-   ##
==========================================
- Coverage   61.07%   61.06%   -0.01%     
==========================================
  Files         640      640              
  Lines       30025    30034       +9     
==========================================
+ Hits        18337    18341       +4     
- Misses       9088     9094       +6     
+ Partials     2600     2599       -1     
Impacted Files Coverage Δ
domain/consensus/model/externalapi/block.go 100.00% <ø> (ø)
domain/dagconfig/params.go 89.47% <ø> (ø)
...ocesses/pruningproofmanager/pruningproofmanager.go 58.04% <60.00%> (+0.10%) ⬆️
domain/consensus/factory.go 93.59% <100.00%> (+0.05%) ⬆️
...processes/blockparentbuilder/blockparentbuilder.go 77.47% <100.00%> (+0.20%) ⬆️
...nsensus/processes/blockprocessor/blockprocessor.go 100.00% <100.00%> (ø)
...cesses/blockprocessor/validate_and_insert_block.go 70.00% <100.00%> (ø)
...rocesses/blockvalidator/block_header_in_context.go 61.94% <100.00%> (ø)
...nsensus/processes/blockvalidator/blockvalidator.go 100.00% <100.00%> (ø)
.../pruning_violation_proof_of_work_and_difficulty.go 68.75% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f7e482...87cb4df. Read the comment docs.

@stasatdaglabs stasatdaglabs merged commit 28d0f1e into kaspanet:dev Feb 20, 2022
@stasatdaglabs stasatdaglabs deleted the testnet-max-block-level branch February 20, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants