-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Merged by Bors] - Ensure ComputeBatchSize set when starting smeshing #4293
Closed
+16
−14
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
eeea741
Ensure smeshing api uses initial smeshing config
piersy d97a163
Rename optsCopy -> opts
piersy 128e8ed
Merge remote-tracking branch 'origin/develop' into piersy/fix-crash-o…
piersy b698e53
Merge branch 'develop' into piersy/fix-crash-on-start-smeshing
countvonzero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing in the default options here, I think we should give smapp the option to set
ComputeBatchSize
. This parameter can make a big difference in initialization time on different machines and only fall back toconfig.DefaultComputeBatchSize
if not provided by smapp.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and no. Smapp IMHO can already set the value as they need. The problem is that we would rather need spacemeshos/post#125 than ask the user for the BatchSize. POST is already waaaay too complex with waaaay too many variables. I'd honestly rather leave an open possibility for power-users and hide it from normal users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have to do this now. We can also just set
ComputeBatchSize
toconfig.DefaultComputeBatchSize
(as commented below) and maybe do this in the future, similar howScrypt
options are handled...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not just the default options here though, they are the options provided at startup, which default to the defaults if not set.
So I think there are 2 reasonable approaches here:
I don't have a clear view of what would be the better approach.
What I think we should avoid is allowing users to provide smeshing options at startup, and having an API which accepts partial smeshing options, but then does not use the options initially provided by the user for the remaining fields. I think this will confuse users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piersy important note, you somewhat cannot easily modify the batchSize after the process has started.
It's more like all-or-nothing approach here.
The best would be imho "defaults unless specified" in single call.
@fasmat scrypt options are "hardcoded" no one should modify them in easy way, I would not put them to the same bucket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pigmej Is that one of the 2 reasonable approaches I listed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as I understand it both compute batch size and scrypt options are currently user configurable, but only with the config provided at startup, if they shouldn't be then this becomes pretty simple since all options would be specified by the API call.
But why are they user configurable if they shouldn't be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of how we handle our
config
packages 😅: #4297 (comment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piersy it's even worse... you can technically have a different batchSize than other nodes as that's local only. But script N is a value for the whole network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it sounds like we need a construct similar to ethereum's chain config that allows setting network wide parameters, do we have such a thing?
But for the purposes of this PR I think the current approach is fine. Then we'll wan't a followup PR to remove the ability to set scrypt params per node. And it seems like we need a discussion around batch size.