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

Make simulation use a transition matrix for block size #2622

Merged
merged 5 commits into from
Oct 31, 2018

Conversation

ValarDragon
Copy link
Contributor

This enables simulating periods of high load, and periods of low to no load.
(low load because future ops will still terminate in that time frame)

Once this is merged, I think we should just delete #1924, and make a new issue tagged postlaunch for those remaining items.

The LCD change is from make format.

  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

This enables simulating periods of high load, and periods of low to no load.
(low load because future ops will still terminate in that time frame)
@codecov
Copy link

codecov bot commented Oct 29, 2018

Codecov Report

Merging #2622 into develop will increase coverage by 0.02%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #2622      +/-   ##
===========================================
+ Coverage    58.82%   58.84%   +0.02%     
===========================================
  Files          152      152              
  Lines         9424     9424              
===========================================
+ Hits          5544     5546       +2     
+ Misses        3510     3508       -2     
  Partials       370      370

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ValarDragon -- left some feedback :-)

client/lcd/certificates.go Show resolved Hide resolved
x/mock/simulation/random_simulate_blocks.go Show resolved Hide resolved
x/mock/simulation/random_simulate_blocks.go Show resolved Hide resolved
func createBlockSimulator(testingMode bool, tb testing.TB, t *testing.T, event func(string), invariants []Invariant, ops []WeightedOperation, operationQueue map[int][]Operation, timeOperationQueue []FutureOperation, totalNumBlocks int, displayLogs func()) func(
blocksize int, r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accounts []Account, header abci.Header, logWriter func(string)) (opCount int) {
totalOpWeight := 0
func createBlockSimulator(testingMode bool, tb testing.TB, t *testing.T, event func(string), invariants []Invariant, ops []WeightedOperation, operationQueue map[int][]Operation, timeOperationQueue []FutureOperation, totalNumBlocks int, avgBlockSize int, displayLogs func()) func(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function signature is extremely hard to read. I think it's not a big change to clean it up here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring it properly will involve wrapping up parameters into structs, but I can split into multipleines here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

x/mock/simulation/constants.go Show resolved Hide resolved
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a general comment improvement, but testedACK 👍

x/mock/simulation/random_simulate_blocks.go Show resolved Hide resolved
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK, 🎃

@cwgoes cwgoes merged commit fcf5b77 into develop Oct 31, 2018
@cwgoes cwgoes deleted the dev/sim_blocksize branch October 31, 2018 19:10
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.

3 participants